hermes-agent/apps/desktop/src
xxxigm 8b84d82227
fix(desktop): send on Enter from live editor text, not stale composer state (#39639)
* fix(desktop): send on Enter from live editor text, not stale composer state

Pressing Enter often did nothing (~90% with IME / fast typing); adding a
trailing space "fixed" it. The composer's submit path read the draft from the
AUI composer state (`useAuiState(s => s.composer.text)`) and the derived
`hasComposerPayload`, both of which lag the contentEditable DOM by a render. On
fast typing or IME composition the final keystroke(s) weren't in state yet, so
`submitDraft()` saw an empty draft and dropped the message. A trailing space
only worked around it by forcing an extra input event that flushed the state.

submitDraft() now refreshes draftRef from the editor node and submits/queues
based on the live DOM text, and the Enter handler decides the queue-drain vs
submit branch from the DOM too. draftRef is already synced on every input
event, so this just closes the in-flight-keystroke gap.

Fixes #39630. Also addresses the "typing + Enter does nothing" reports in

#39623.

* test(desktop): cover Enter-submit from live editor text (#39630)

Pin the contract that the composer's Enter path reads the live DOM editor
text, not the render-lagged composer state: a just-typed message sends even
when state hasn't synced; while busy it queues (never drains the queue or
cancels); an empty Enter while busy is a no-op; and an empty idle Enter
drains the next queued prompt. Faithful DOM-event repro mirroring
handleEditorKeyDown + submitDraft.
2026-06-10 00:51:23 +00:00
..
app fix(desktop): send on Enter from live editor text, not stale composer state (#39639) 2026-06-10 00:51:23 +00:00
components fix(desktop): show a staging spinner in the edit composer while OS drops upload 2026-06-09 18:26:54 -05:00
hooks Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
i18n fix(desktop): show a staging spinner in the edit composer while OS drops upload 2026-06-09 18:26:54 -05:00
lib fix(desktop): render optimistic image thumbnails from in-hand base64 2026-06-09 17:03:42 -05:00
store fix(desktop): close eager-upload races flagged in review 2026-06-09 18:21:10 -05:00
themes feat(desktop): assignable themes per profile (#42286) 2026-06-08 17:42:17 +00:00
types fix(desktop): local-only recents, per-platform sidebar sections, and Ctrl+N regressions (#42537) 2026-06-09 14:24:25 +00:00
global.d.ts fix(desktop): recover chat after sleep/wake by revalidating a stale remote backend 2026-06-07 17:29:12 -07:00
hermes.test.ts fix(desktop): scope session list to active profile + longer timeout 2026-06-07 02:15:23 -07:00
hermes.ts feat(desktop): remote update overlay sourced from backend 2026-06-08 08:58:26 -07:00
main.tsx feat(desktop): add i18n with Simplified Chinese (zh-Hans) support 2026-06-05 10:32:26 -07:00
styles.css feat(desktop): hover-reveal collapsed sidebars as fixed overlays (#41670) 2026-06-07 22:41:21 -05:00
vite-env.d.ts Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00