From 11aad143f8d0519c8ff389dfa2d37a220a8debd7 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Wed, 14 Oct 2026 17:48:08 -0700 Subject: [PATCH] fix(app-shell): let users close the profile storage delay warning (#28900) The warning sticks until profile saving catches up, but it turned off the close button every other Orca toast gets from the app toaster. --- ...profile-state-save-delay-notice.sonner.test.tsx | 14 ++++++++++++-- .../use-profile-state-save-delay-notice.test.tsx | 4 +--- .../use-profile-state-save-delay-notice.ts | 4 +--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx index 471dfaf3ed5..44242495404 100644 --- a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx +++ b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx @@ -11,9 +11,9 @@ const title = 'Profile storage is taking longer than usual' const frames: FrameRequestCallback[] = [] const listeners = new Set<(delayed: boolean) => void>() -function Notice() { +function Notice({ closeButton = false }: { closeButton?: boolean }) { useProfileStateSaveDelayNotice() - return + return } beforeEach(() => { @@ -97,6 +97,16 @@ it('does not let StrictMode cleanup dismiss the initial delayed snapshot', async expect(view.queryAllByText(title)).toHaveLength(1) }) +it('lets the user close the warning with the app toaster close button', async () => { + const view = render() + await advanceTimers() + expect(view.queryByText(title)).not.toBeNull() + + act(() => view.getByRole('button', { name: 'Close toast' }).click()) + await finishDismissal() + expect(view.queryByText(title)).toBeNull() +}) + it('keeps a new warning if recovery and another delay arrive before a dismissal frame', async () => { const view = render() await advanceTimers() diff --git a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx index d673aba02c1..05018d5aef7 100644 --- a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx +++ b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx @@ -62,9 +62,7 @@ it('restores a persistent warning from main and clears it on completion', async { id: undefined, description: 'Further saves may be delayed while this operation finishes.', - duration: Infinity, - dismissible: false, - closeButton: false + duration: Infinity } ) publish(false) diff --git a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.ts b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.ts index 99815c1c3f4..7b35bba58eb 100644 --- a/src/renderer/src/app-shell/use-profile-state-save-delay-notice.ts +++ b/src/renderer/src/app-shell/use-profile-state-save-delay-notice.ts @@ -34,9 +34,7 @@ export function useProfileStateSaveDelayNotice(): void { 'app.saving.delayedDescription', 'Further saves may be delayed while this operation finishes.' ), - duration: Infinity, - dismissible: false, - closeButton: false + duration: Infinity } ) }