diff --git a/packages/common/infra/src/app-config-storage.ts b/packages/common/infra/src/app-config-storage.ts index 19e045f7f3..539416d56e 100644 --- a/packages/common/infra/src/app-config-storage.ts +++ b/packages/common/infra/src/app-config-storage.ts @@ -3,8 +3,6 @@ import { z } from 'zod'; const _appConfigSchema = z.object({ /** whether to show onboarding first */ onBoarding: z.boolean().optional().default(true), - /** whether to show change workspace guide modal */ - dismissWorkspaceGuideModal: z.boolean().optional().default(false), }); export type AppConfigSchema = z.infer; export const defaultAppConfig = _appConfigSchema.parse({}); diff --git a/packages/frontend/core/src/components/affine/onboarding/assets/thumb.tsx b/packages/frontend/core/src/components/affine/onboarding/assets/thumb.tsx deleted file mode 100644 index e18d89f71c..0000000000 --- a/packages/frontend/core/src/components/affine/onboarding/assets/thumb.tsx +++ /dev/null @@ -1,311 +0,0 @@ -import { memo } from 'react'; - -export default memo(function Thumb() { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}); diff --git a/packages/frontend/core/src/components/affine/onboarding/workspace-guide-modal.css.tsx b/packages/frontend/core/src/components/affine/onboarding/workspace-guide-modal.css.tsx deleted file mode 100644 index bd991c7738..0000000000 --- a/packages/frontend/core/src/components/affine/onboarding/workspace-guide-modal.css.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { style } from '@vanilla-extract/css'; - -export const title = style({ - padding: '20px 24px 8px 24px', - fontSize: '18px', - fontFamily: 'var(--affine-font-family)', - fontWeight: '600', - lineHeight: '26px', -}); - -export const content = style({ - padding: '0px 24px', - fontSize: '15px', - lineHeight: '24px', - fontWeight: 400, -}); - -export const footer = style({ - padding: '20px 28px', - display: 'flex', - justifyContent: 'flex-end', -}); - -export const gotItBtn = style({ - fontWeight: 500, -}); diff --git a/packages/frontend/core/src/components/affine/onboarding/workspace-guide-modal.tsx b/packages/frontend/core/src/components/affine/onboarding/workspace-guide-modal.tsx deleted file mode 100644 index 451c3e1ce1..0000000000 --- a/packages/frontend/core/src/components/affine/onboarding/workspace-guide-modal.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { OverlayModal } from '@affine/component'; -import type { ModalProps } from '@affine/component/ui/modal'; -import { useAFFiNEI18N } from '@affine/i18n/hooks'; -import { memo, useCallback, useEffect, useState } from 'react'; - -import { useAppConfigStorage } from '../../../hooks/use-app-config-storage'; -import Thumb from './assets/thumb'; - -const overlayOptions: ModalProps['overlayOptions'] = { - style: { - background: - 'linear-gradient(95deg, transparent 0px, var(--affine-background-primary-color) 400px)', - }, -}; - -export const WorkspaceGuideModal = memo(function WorkspaceGuideModal() { - const t = useAFFiNEI18N(); - const [dismiss, setDismiss] = useAppConfigStorage( - 'dismissWorkspaceGuideModal' - ); - const [open, setOpen] = useState(!dismiss); - - // blur modal background, can't use css: `backdrop-filter: blur()`, - // because it won't behave as expected on client side (texts over transparent window are not blurred) - useEffect(() => { - const appDom = document.querySelector('#app') as HTMLElement; - if (!appDom) return; - appDom.style.filter = open ? 'blur(7px)' : 'none'; - - return () => { - appDom.style.filter = 'none'; - }; - }, [open]); - - const gotIt = useCallback(() => { - setDismiss(true); - }, [setDismiss]); - - const onOpenChange = useCallback((v: boolean) => { - setOpen(v); - // should set dismiss here ? - // setDismiss(true) - }, []); - - return ( - } - title={t['com.affine.onboarding.workspace-guide.title']()} - description={t['com.affine.onboarding.workspace-guide.content']()} - onConfirm={gotIt} - overlayOptions={overlayOptions} - withoutCancelButton - confirmButtonOptions={{ - style: { - fontWeight: 500, - }, - type: 'primary', - size: 'large', - }} - confirmText={t['com.affine.onboarding.workspace-guide.got-it']()} - /> - ); -}); diff --git a/packages/frontend/core/src/providers/modal-provider.tsx b/packages/frontend/core/src/providers/modal-provider.tsx index b76a06f396..9f413d17bc 100644 --- a/packages/frontend/core/src/providers/modal-provider.tsx +++ b/packages/frontend/core/src/providers/modal-provider.tsx @@ -53,14 +53,6 @@ const TmpDisableAffineCloudModal = lazy(() => ) ); -const WorkspaceGuideModal = lazy(() => - import('../components/affine/onboarding/workspace-guide-modal').then( - module => ({ - default: module.WorkspaceGuideModal, - }) - ) -); - const SignOutModal = lazy(() => import('../components/affine/sign-out-modal').then(module => ({ default: module.SignOutModal, @@ -205,7 +197,6 @@ export function CurrentWorkspaceModals() { - {currentWorkspace ? : null} {currentWorkspace?.flavour === WorkspaceFlavour.LOCAL && ( <> diff --git a/packages/frontend/electron/src/main/index.ts b/packages/frontend/electron/src/main/index.ts index 3bde9f9d8f..fbd321b222 100644 --- a/packages/frontend/electron/src/main/index.ts +++ b/packages/frontend/electron/src/main/index.ts @@ -36,7 +36,6 @@ if (process.env.SKIP_ONBOARDING) { launchStage.value = 'main'; persistentConfig.set({ onBoarding: false, - dismissWorkspaceGuideModal: true, }); } diff --git a/tests/kit/playwright.ts b/tests/kit/playwright.ts index 34695c0e66..ba5f827aaa 100644 --- a/tests/kit/playwright.ts +++ b/tests/kit/playwright.ts @@ -35,10 +35,7 @@ type CurrentDocCollection = { export const skipOnboarding = async (context: BrowserContext) => { await context.addInitScript(() => { - window.localStorage.setItem( - 'app_config', - '{"onBoarding":false, "dismissWorkspaceGuideModal":true}' - ); + window.localStorage.setItem('app_config', '{"onBoarding":false}'); }); }; diff --git a/tests/storybook/.storybook/preview.tsx b/tests/storybook/.storybook/preview.tsx index d7b03568da..651bef1678 100644 --- a/tests/storybook/.storybook/preview.tsx +++ b/tests/storybook/.storybook/preview.tsx @@ -66,10 +66,7 @@ const ThemeChange = () => { localStorage.clear(); // do not show onboarding for storybook -window.localStorage.setItem( - 'app_config', - '{"onBoarding":false, "dismissWorkspaceGuideModal":true}' -); +window.localStorage.setItem('app_config', '{"onBoarding":false}'); const services = new ServiceCollection();