From 587788405a7e8e957a69dc565b277fc244e071b4 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 14 Aug 2026 23:06:56 -0700 Subject: [PATCH] fix(desktop): extend stale-flag self-heal and keyCode 229 guard to the edit composer Widen the composer-side IME fixes to the inline edit composer: the same missed-compositionend wedge and post-compositionend keyCode 229 Enter apply to its handleKeyDown path. --- .../assistant-ui/thread/user-edit-composer.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx b/apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx index a9b4fd0516..c54e9ec6f6 100644 --- a/apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx +++ b/apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx @@ -650,10 +650,23 @@ export const UserEditComposer: FC = ({ cwd, gateway, sess ) const handleKeyDown = (event: KeyboardEvent) => { + // Self-heal a stale composition flag (same recovery as the main composer's + // handleEditorKeyDown, #44135): compositionend can be missed, and a wedged + // composingRef would swallow every Enter until the edit composer remounts. + if (composingRef.current && !event.nativeEvent.isComposing) { + composingRef.current = false + } + if (composingRef.current || event.nativeEvent.isComposing) { return } + // IME commit Enter still carrying keyCode 229 (VK_PROCESSKEY) after + // compositionend — same guard as the main composer. + if (event.key === 'Enter' && event.keyCode === 229) { + return + } + if (trigger && triggerItems.length > 0) { if (event.key === 'ArrowDown') { event.preventDefault()