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.
This commit is contained in:
Teknium
2026-08-14 23:06:56 -07:00
parent 9f2e6d05ab
commit 587788405a
@@ -650,10 +650,23 @@ export const UserEditComposer: FC<UserEditComposerProps> = ({ cwd, gateway, sess
)
const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
// 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()