From ec96aa05967827a42fba8132b53215dea21db950 Mon Sep 17 00:00:00 2001 From: Abhijay Jain Date: Wed, 2 Sep 2026 20:44:38 +0000 Subject: [PATCH] fix(desktop): resolve UI freeze after renaming session (#11759) --- ui/desktop/src/components/SessionActionsHeader.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/desktop/src/components/SessionActionsHeader.tsx b/ui/desktop/src/components/SessionActionsHeader.tsx index c7d966439..31413fa1b 100644 --- a/ui/desktop/src/components/SessionActionsHeader.tsx +++ b/ui/desktop/src/components/SessionActionsHeader.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent } from 'react'; +import { flushSync } from 'react-dom'; import { Activity, ChevronDown, @@ -385,13 +386,14 @@ export default function SessionActionsHeader({ setIsRenaming(true); try { await acpRenameSession(session.id, trimmedName); + flushSync(() => setIsRenameOpen(false)); + document.body.style.removeProperty('pointer-events'); onSessionChange((current) => ({ ...current, name: trimmedName, user_set_name: true })); window.dispatchEvent( new CustomEvent(AppEvents.SESSION_RENAMED, { detail: { sessionId: session.id, newName: trimmedName, userInitiated: true }, }) ); - setIsRenameOpen(false); toast.success(intl.formatMessage(i18n.renamed)); } catch (error) { toast.error( @@ -555,7 +557,7 @@ export default function SessionActionsHeader({ - setIsRenameOpen(true)}> + setTimeout(() => setIsRenameOpen(true), 0)}> {intl.formatMessage(i18n.renameSession)}