From e24f4a8c8abc8616959bc4d3a5ba8dd781fe9ada Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Sat, 4 Jul 2026 12:26:03 +0100 Subject: [PATCH] Defer opening the rename dialog past the context menu's close Opening the dialog synchronously from the menu item's onSelect races Radix's menu close/focus-restore against the dialog's focus lock and can freeze the webview (observed as an app crash on rename). Deferring one tick lets the menu fully close first. Co-Authored-By: Claude Fable 5 --- desktop/src/features/chats/ui/ChatListItem.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/desktop/src/features/chats/ui/ChatListItem.tsx b/desktop/src/features/chats/ui/ChatListItem.tsx index ac400a613..7b0bcd3ba 100644 --- a/desktop/src/features/chats/ui/ChatListItem.tsx +++ b/desktop/src/features/chats/ui/ChatListItem.tsx @@ -141,7 +141,14 @@ export function ChatListItem({ {row} {onRenameChat && canRename ? ( - onRenameChat(chat.id)}> + { + // Defer past the menu's close/focus-restore: opening a dialog + // in the same tick wrestles Radix's focus management and can + // freeze the webview (observed as an app "crash" on rename). + window.setTimeout(() => onRenameChat(chat.id), 0); + }} + > Rename chat