From c6047ffaa405a2b03ed1e2fd3725744b8646f9d0 Mon Sep 17 00:00:00 2001 From: Richard R Date: Fri, 29 May 2026 09:20:34 -0600 Subject: [PATCH] fix(onboarding): prevent no-auth auto settings modal races --- src/contexts/OnboardingFlowContext.tsx | 10 +++++++++- tests/folders.spec.ts | 2 -- tests/helpers.ts | 7 ------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/contexts/OnboardingFlowContext.tsx b/src/contexts/OnboardingFlowContext.tsx index 9fcacc9..696e7f5 100644 --- a/src/contexts/OnboardingFlowContext.tsx +++ b/src/contexts/OnboardingFlowContext.tsx @@ -179,7 +179,11 @@ export function OnboardingFlowProvider({ children }: { children: ReactNode }) { if (!local.firstVisitSettingsOpened) { await setFirstVisit(true); - openSettingsNow(); + // In no-auth mode (used by local/CI e2e), avoid background modal opens + // that can race with interactions and steal pointer events. + if (authEnabled) { + openSettingsNow(); + } return; } @@ -263,6 +267,10 @@ export function OnboardingFlowProvider({ children }: { children: ReactNode }) { }, [advanceFlow, authEnabled]); useEffect(() => { + if (!authEnabled) { + return () => { }; + } + return scheduleChangelogCheck({ authEnabled, isSessionPending, diff --git a/tests/folders.spec.ts b/tests/folders.spec.ts index 0b84411..7e36725 100644 --- a/tests/folders.spec.ts +++ b/tests/folders.spec.ts @@ -7,7 +7,6 @@ import { dispatchHtml5DragAndDrop, expectDocumentListed, expectNoDocumentLink, - dismissBlockingModals, } from './helpers'; test.describe('Document folders and hint persistence', () => { @@ -63,7 +62,6 @@ test.describe('Document folders and hint persistence', () => { // Reload and verify persisted folder + membership await page.reload(); await page.waitForLoadState('networkidle'); - await dismissBlockingModals(page); const myFolderRowAfter = folderRow(page, 'My Folder'); await expect(myFolderRowAfter).toBeVisible(); await myFolderRowAfter.click(); diff --git a/tests/helpers.ts b/tests/helpers.ts index 7cae82a..2bdec91 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -177,13 +177,6 @@ async function dismissOnboardingModals(page: Page): Promise { } } -/** - * Dismiss startup/settings overlays that can intermittently appear after reloads. - */ -export async function dismissBlockingModals(page: Page): Promise { - await dismissOnboardingModals(page); -} - /** * Wait for the play button to be clickable and click it */