diff --git a/apps/web/.env.local.template b/apps/web/.env.local.template index 637a28b6e4..682dfc1757 100644 --- a/apps/web/.env.local.template +++ b/apps/web/.env.local.template @@ -16,6 +16,7 @@ ENABLE_BC_PROVIDER=1 EXPOSE_INTERNAL=1 ENABLE_DEBUG_PAGE= ENABLE_SUBPAGE= +ENABLE_CHANGELOG= # Sentry SENTRY_AUTH_TOKEN= diff --git a/apps/web/preset.config.mjs b/apps/web/preset.config.mjs index a2203168e8..1930e9f9b6 100644 --- a/apps/web/preset.config.mjs +++ b/apps/web/preset.config.mjs @@ -11,5 +11,6 @@ const config = { process.env.ENABLE_DEBUG_PAGE ?? process.env.NODE_ENV === 'development' ), enableSubpage: Boolean(process.env.ENABLE_SUBPAGE), + enableChangeLog: Boolean(process.env.ENABLE_CHANGELOG), }; export default config; diff --git a/apps/web/src/components/pure/help-island/index.tsx b/apps/web/src/components/pure/help-island/index.tsx index f853a71842..2b29876d67 100644 --- a/apps/web/src/components/pure/help-island/index.tsx +++ b/apps/web/src/components/pure/help-island/index.tsx @@ -1,4 +1,5 @@ import { MuiFade, Tooltip } from '@affine/component'; +import { config } from '@affine/env'; import { useTranslation } from '@affine/i18n'; import { CloseIcon, DoneIcon } from '@blocksuite/icons'; import dynamic from 'next/dynamic'; @@ -12,7 +13,6 @@ import { StyledIsland, StyledTriggerWrapper, } from './style'; - const ContactModal = dynamic( () => import('@affine/component/contact-modal').then(({ ContactModal }) => ({ @@ -25,7 +25,9 @@ const ContactModal = dynamic( export type IslandItemNames = 'whatNew' | 'contact' | 'shortcuts'; export const HelpIsland = ({ - showList = ['whatNew', 'contact', 'shortcuts'], + showList = config.enableChangeLog + ? ['whatNew', 'contact', 'shortcuts'] + : ['contact', 'shortcuts'], }: { showList?: IslandItemNames[]; }) => { diff --git a/apps/web/src/components/pure/workspace-slider-bar/index.tsx b/apps/web/src/components/pure/workspace-slider-bar/index.tsx index 86aa5648b2..a6081db388 100644 --- a/apps/web/src/components/pure/workspace-slider-bar/index.tsx +++ b/apps/web/src/components/pure/workspace-slider-bar/index.tsx @@ -109,7 +109,7 @@ export const WorkSpaceSliderBar: React.FC = ({ currentWorkspace={currentWorkspace} onClick={onOpenWorkspaceListModal} /> - + {config.enableChangeLog && } { diff --git a/apps/web/src/layouts/index.tsx b/apps/web/src/layouts/index.tsx index e7141ec722..75e65a07e7 100644 --- a/apps/web/src/layouts/index.tsx +++ b/apps/web/src/layouts/index.tsx @@ -1,4 +1,5 @@ import { DebugLogger } from '@affine/debug'; +import { config } from '@affine/env'; import { setUpLanguage, useTranslation } from '@affine/i18n'; import { createAffineGlobalChannel } from '@affine/workspace/affine/sync'; import { jotaiWorkspacesAtom } from '@affine/workspace/atom'; @@ -339,7 +340,11 @@ export const WorkspaceLayoutInner: React.FC = ({ {!isPublicWorkspace && ( )} diff --git a/packages/env/src/index.ts b/packages/env/src/index.ts index 13bb3bd4ee..5044970442 100644 --- a/packages/env/src/index.ts +++ b/packages/env/src/index.ts @@ -111,6 +111,7 @@ export const publicRuntimeConfigSchema = z.object({ // expose internal api to globalThis, **development only** exposeInternal: z.boolean(), enableSubpage: z.boolean(), + enableChangeLog: z.boolean(), }); export type PublicRuntimeConfig = z.infer; diff --git a/playwright.config.ts b/playwright.config.ts index 4a4e7ea128..a5278de593 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -74,6 +74,8 @@ const config: PlaywrightTestConfig = { env: { COVERAGE: process.env.COVERAGE || 'false', ENABLE_DEBUG_PAGE: '1', + ENABLE_SUBPAGE: '1', + ENABLE_CHANGELOG: '1', NODE_API_SERVER: 'local', }, }, diff --git a/scripts/vitest/next-config-mock.ts b/scripts/vitest/next-config-mock.ts index ab9f3b0cc9..4f60e7aeba 100644 --- a/scripts/vitest/next-config-mock.ts +++ b/scripts/vitest/next-config-mock.ts @@ -13,6 +13,7 @@ export default function getConfig() { prefetchWorkspace: false, exposeInternal: true, enableSubpage: true, + enableChangeLog: true, }, }; }