diff --git a/apps/electron/tests/basic.spec.ts b/apps/electron/tests/basic.spec.ts
index 5336cea91d..c7bde31b83 100644
--- a/apps/electron/tests/basic.spec.ts
+++ b/apps/electron/tests/basic.spec.ts
@@ -16,6 +16,9 @@ test.beforeEach(async () => {
colorScheme: 'light',
});
page = await electronApp.firstWindow();
+ await page.getByTestId('onboarding-modal-close-button').click({
+ delay: 100,
+ });
// cleanup page data
await page.evaluate(() => localStorage.clear());
});
@@ -76,3 +79,21 @@ test('affine cloud disabled', async () => {
state: 'visible',
});
});
+test('affine onboarding button', async () => {
+ await page.getByTestId('help-island').click();
+ await page.getByTestId('easy-guide').click();
+ const onboardingModal = page.locator('[data-testid=onboarding-modal]');
+ expect(await onboardingModal.isVisible()).toEqual(true);
+ const switchVideo = page.locator(
+ '[data-testid=onboarding-modal-switch-video]'
+ );
+ expect(await switchVideo.isVisible()).toEqual(true);
+ await page.getByTestId('onboarding-modal-next-button').click();
+ const editingVideo = page.locator(
+ '[data-testid=onboarding-modal-editing-video]'
+ );
+ expect(await editingVideo.isVisible()).toEqual(true);
+ await page.getByTestId('onboarding-modal-ok-button').click();
+
+ expect(await onboardingModal.isVisible()).toEqual(false);
+});
diff --git a/apps/web/public/editingVideo.mp4 b/apps/web/public/editingVideo.mp4
new file mode 100644
index 0000000000..12fa935e4f
Binary files /dev/null and b/apps/web/public/editingVideo.mp4 differ
diff --git a/apps/web/public/switchVideo.mp4 b/apps/web/public/switchVideo.mp4
new file mode 100644
index 0000000000..14452bf78f
Binary files /dev/null and b/apps/web/public/switchVideo.mp4 differ
diff --git a/apps/web/src/atoms/guide.ts b/apps/web/src/atoms/guide.ts
index 9b872b3e42..305438b8ef 100644
--- a/apps/web/src/atoms/guide.ts
+++ b/apps/web/src/atoms/guide.ts
@@ -52,3 +52,18 @@ export const guideChangeLogAtom = atom<
}));
}
);
+export const guideOnboardingAtom = atom<
+ Guide['onBoarding'],
+ [open: boolean],
+ void
+>(
+ get => {
+ return get(guidePrimitiveAtom).onBoarding;
+ },
+ (_, set, open) => {
+ set(guidePrimitiveAtom, tips => ({
+ ...tips,
+ onBoarding: open,
+ }));
+ }
+);
diff --git a/apps/web/src/atoms/index.ts b/apps/web/src/atoms/index.ts
index 176563fd6a..950476f9b5 100644
--- a/apps/web/src/atoms/index.ts
+++ b/apps/web/src/atoms/index.ts
@@ -77,6 +77,7 @@ export const currentEditorAtom = rootCurrentEditorAtom;
export const openWorkspacesModalAtom = atom(false);
export const openCreateWorkspaceModalAtom = atom(false);
export const openQuickSearchModalAtom = atom(false);
+export const openOnboardingModalAtom = atom(false);
export const openDisableCloudAlertModalAtom = atom(false);
diff --git a/apps/web/src/components/blocksuite/workspace-header/header-right-items/EditorOptionMenu.tsx b/apps/web/src/components/blocksuite/workspace-header/header-right-items/EditorOptionMenu.tsx
index fba8e276b2..d30745b67e 100644
--- a/apps/web/src/components/blocksuite/workspace-header/header-right-items/EditorOptionMenu.tsx
+++ b/apps/web/src/components/blocksuite/workspace-header/header-right-items/EditorOptionMenu.tsx
@@ -45,7 +45,7 @@ const CommonMenu = () => {