From 58e7fd0e3eac1666536d7484871cafc692349f72 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 26 May 2026 15:37:17 +0700 Subject: [PATCH] Close rewind menu when the action errors handleSelect only ran setIsOpen(false) on the success path. When the rewind action failed, the catch block swallowed the error but the menu stayed open, blocking subsequent interactions with the page. Close in finally so success and error both dismiss the menu. --- packages/app/src/components/rewind/rewind-menu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/components/rewind/rewind-menu.tsx b/packages/app/src/components/rewind/rewind-menu.tsx index 05db2900d..5b1b80e94 100644 --- a/packages/app/src/components/rewind/rewind-menu.tsx +++ b/packages/app/src/components/rewind/rewind-menu.tsx @@ -61,11 +61,11 @@ export const RewindMenu = memo(function RewindMenu({ setPendingMode(mode); try { await onRewind({ mode, rewoundText }); - setIsOpen(false); } catch { // useRewindAgentMutation owns the toast; the menu only owns flow state. } finally { setPendingMode(null); + setIsOpen(false); } }, [isLocked, onRewind, rewoundText],