fix(desktop): repair stale composingRef to resolve Enter key issue on Windows - #64372
fix(desktop): repair stale composingRef to resolve Enter key issue on Windows#64372iborazzi wants to merge 1 commit into
Conversation
…on Windows Rebase the NousResearch#39649 fix onto current main and address sweeper review on NousResearch#39660: - Enter no longer submitting was only one symptom of a stuck composingRef (Chromium/Electron on Windows can fire compositionstart for plain, non-IME input and never a matching compositionend). The original PR only special-cased the keydown guard, leaving handleEditorInput and the Send-button form submit still reading the same stale ref. - handleEditorKeyDown and handleEditorInput now resync composingRef from that event's own native isComposing before deciding whether to block, so a stale true can't outlive whatever (possibly fake) composition set it, while a genuine IME composition is unaffected since isComposing is actually true for its duration. - The Send-button path has no composition event to resync from, so composingRef is cleared synchronously on blur instead — losing focus means composition, real or falsely stuck, is over either way. - Added windows-stale-composing-guard.test.tsx: false compositionstart with no compositionend still lets Enter and the Send button submit, and a genuine IME composition still blocks Enter until compositionend. Fixes NousResearch#39649
|
Thanks for the focused regression fix. The premise remains present on current main: The PR reconciles the ref before the input/keydown guards, preserves the genuine-IME Automated hermes-sweeper review. |
Summary43 candidate PRs span gateway restart safety, Desktop IME composition, stale composer state, inline editing, busy-turn steering, configurable Enter behavior, and first-message submission. For the Windows Enter/Send failure targeted here, #64372 directly repairs a stale Related pull requests
Duplicates#39660, #44149, #45999, and #64372 substantially overlap on stale Suggested consolidationKeep #64372 open with a salvage path: rebase its input/keydown reconciliation, blur reset, and three stale-versus-genuine-IME regressions onto current main, as supported by the high-salvage maintainer-bot review and its recorded best-fix status. Treat #39660, #44149, and #45999 as competing implementations until #64372’s current-main port demonstrably preserves their covered paths; handle the distinct post-composition, inline-edit, steering, preference, gateway, and first-message PRs under their own issue lanes. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I39107(["issue #39107 (open)"])
I39112(["issue #39112 (open)"])
I39649(["issue #39649 (open)"])
I40226(["issue #40226 (open)"])
I44135(["issue #44135 (open)"])
I71701(["issue #71701 (closed)"])
subgraph Dup39660 ["PRs duplicating each other"]
P39660["PR #39660 (open)"]
P44149["PR #44149 (open)"]
P45999["PR #45999 (open)"]
P64372["PR #64372 (open)"]
end
P64372 -->|best fix| I39107
P64372 -->|best fix| I39112
P64372 -->|best fix| I39649
P64372 -->|best fix| I40226
P64372 -->|best fix| I44135
P64372 -.->|partial| I71701
class I39107 open
class I39112 open
class I39649 open
class I40226 open
class I44135 open
class I71701 closed
class P39660 open
class P44149 open
class P45999 open
class P64372 open
class P39660 best
class P44149 best
class P44149 best
class P45999 best
class P45999 best
class P45999 best
class P64372 best
class P64372 best
class P64372 best
class P64372 best
class P64372 best
class P64372 target
click I39107 "https://github.com/NousResearch/hermes-agent/issues/39107"
click I39112 "https://github.com/NousResearch/hermes-agent/issues/39112"
click I39649 "https://github.com/NousResearch/hermes-agent/issues/39649"
click I40226 "https://github.com/NousResearch/hermes-agent/issues/40226"
click I44135 "https://github.com/NousResearch/hermes-agent/issues/44135"
click I71701 "https://github.com/NousResearch/hermes-agent/issues/71701"
click P39660 "https://github.com/NousResearch/hermes-agent/pull/39660"
click P44149 "https://github.com/NousResearch/hermes-agent/pull/44149"
click P45999 "https://github.com/NousResearch/hermes-agent/pull/45999"
click P64372 "https://github.com/NousResearch/hermes-agent/pull/64372"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 43 pull requests and 33 issues in this complex. Each diff was read against this issue; Assessment working set: 328 kB of PR diffs, 159 kB of issue/PR text, 63 kB of discussion (113 comments), 189 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
|
Thanks for the thorough cross-PR triage and best-fix classification! Rebased and verified against current main. The input/keydown reconciliation, blur reset, and stale-vs-genuine IME regression tests are green and ready for final maintainer review/merge. |
Problem:
On Windows, the Electron/Chromium IME handling fires compositionstart for standard keyboard input. This leaves composingRef.current stuck at true, causing the handleEditorKeyDown guard to silently drop the Enter key event.
Solution:
Instead of merely bypassing the guard, this PR repairs the stale composingRef state:
Clears composingRef when isComposing is false before the IME guard.
Explicitly clears the ref on blur for the form-submit path.
Ensures that genuine IME composition remains guarded while standard input is no longer blocked.
Testing:
Verified on Windows 10: Enter key now triggers immediate message submission.
Verified that genuine IME composition still blocks premature submission.