feat: keyboard waves A/B — global shortcut registry, question row machine, Esc-cancel dictation
Wave A (owner key map): registry in src/core/keyboard.ts + KeyboardShortcuts
provider; Cmd+D dictation, Cmd+K model picker, Shift+Tab thinking cycle,
Cmd+B sidebar, Cmd+Shift+F sessions search, Alt+arrows session cycle,
Alt+Enter open, Cmd+G graph, Cmd+N new, F2 rename, ? cheat sheet. Tab
fully suppressed; Esc chain popover > dictation > abort (local stream).
Esc now CANCELS dictation (discard) — flush stays on Cmd+D/Stop. Owner
bug reports fixed: focus outline removed, Alt+Enter setState-in-render,
Cmd+F graph node search (surface-scoped lh:kbd-find).
Wave B: question dock row machine — arrows walk options + dont-know/Other
with wrap + ring highlight, Space picks (mirrors click semantics), Enter
submits when canSubmit; typing surfaces and in-dock keys keep native
behavior. aria-checked={isSel} restored on option buttons.
docs/keyboard.md records the full map.
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
* Shift+Tab cycles the thinking level instead.
|
||||
* - Esc is a layered dismiss: topmost popover first (popovers stopPropagation
|
||||
* on their own Esc — usePopoverDismiss + ModelControl), then dictation
|
||||
* stop, then abort of an in-flight turn.
|
||||
* CANCEL (discard the transcript, owner 2026-09-17 round 3), then abort of
|
||||
* an in-flight turn.
|
||||
* - Global actions dispatch lh:kbd-<action> window events; surfaces that are
|
||||
* mounted listen (the lh:chat-renamed pattern). A surface that isn't
|
||||
* mounted simply doesn't listen — an F2 on the graph view is a no-op, not
|
||||
@@ -71,7 +72,7 @@ export function KeyboardShortcuts() {
|
||||
// abort seam in Chat decides what's honestly stoppable).
|
||||
if (isDictationActive()) {
|
||||
e.preventDefault();
|
||||
window.dispatchEvent(new CustomEvent("lh:kbd-stop-dictation"));
|
||||
window.dispatchEvent(new CustomEvent("lh:kbd-cancel-dictation"));
|
||||
return;
|
||||
}
|
||||
window.dispatchEvent(new CustomEvent("lh:kbd-abort-turn"));
|
||||
|
||||
Reference in New Issue
Block a user