keyboard: Enter submits from the custom answer; Enter opens the waiting check (keyboard 1-2 of 4)
Slice 1 — the ask's custom-answer field: Enter submits directly. A single-line input with no newline to protect, and typing has already selected the row — every Enter (shift or not) rides the same submit() seam as the button, dictation finish-first included. No more the Esc-then-Enter dance to file a custom answer. Slice 2 — Enter opens the waiting check (owner, keyboard round 2026-10-06): while a question waits with the dock CLOSED (behind its reveal invitation, or collapsed by scroll) Enter is never dead. Any live dictation finishes FIRST — the flush lands in the reading-thinking field, the live claim, per the nothing-gets-lost law — then the check reveals/expands. Two seams: the reading-thinking field's own Enter (plain or ⌘/Ctrl; Shift+Enter keeps the newline convention — the dump convention survives for deliberate breaks, and Enter stays a newline once the check is OPEN), and a document-level listener for plain-focus Enter — gated to skip typing surfaces and focused buttons, which own their own Enter. 1427 tests, tsc, lint, build green.
This commit is contained in:
@@ -22,12 +22,18 @@ export function ReadingThinkingField({
|
||||
value,
|
||||
onChange,
|
||||
onEscape,
|
||||
onOpen,
|
||||
claim,
|
||||
}: {
|
||||
value: string;
|
||||
onChange: (v: string) => void;
|
||||
/** Esc in the field stops dictation (threaded from the page's hook). */
|
||||
onEscape?: () => void;
|
||||
/** The check waits CLOSED — Enter opens it (owner, keyboard round
|
||||
* 2026-10-06). The caller finishes any live dictation FIRST (the
|
||||
* flush lands here — the field is the live claim), then reveals.
|
||||
* Absent = the check is open: Enter keeps the dumping convention. */
|
||||
onOpen?: () => void;
|
||||
/** Primary dictation claim — true while the check is behind its reveal. */
|
||||
claim: boolean;
|
||||
}) {
|
||||
@@ -60,6 +66,17 @@ export function ReadingThinkingField({
|
||||
onEscape?.();
|
||||
return;
|
||||
}
|
||||
// ENTER OPENS THE WAITING CHECK (owner, keyboard round
|
||||
// 2026-10-06): while the check sits closed, plain Enter
|
||||
// (and the universal ⌘/Ctrl+Enter) opens it — the dictation
|
||||
// flush lands HERE first via the caller's finishDictation,
|
||||
// so spoken thoughts ride along. Shift+Enter stays a newline.
|
||||
if (e.key === "Enter" && onOpen !== undefined && (!e.shiftKey || e.metaKey || e.ctrlKey)) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onOpen();
|
||||
return;
|
||||
}
|
||||
// The dock's dumping convention: plain Enter is a newline.
|
||||
// No submit button here — the check's own submit is this
|
||||
// field's carrier — so ⌘↵ just blurs.
|
||||
|
||||
Reference in New Issue
Block a user