Skip to content

Route unclaimed popup keys back to the prompt - #1011

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-6723-route-unclaimed-ephemeral-popup-keys-back-to-the-prompt
Sep 14, 2026
Merged

Route unclaimed popup keys back to the prompt#1011
TheGreatAxios merged 3 commits into
mainfrom
cl-6723-route-unclaimed-ephemeral-popup-keys-back-to-the-prompt

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

With a suggestion popup open, keystrokes the popup does not use were silently dropped instead of reaching the prompt, so filter text could vanish without feedback. Unclaimed printable keys now fall through to the prompt buffer while the overlay stays open; permission and operator gates keep their modal key handling.

Verification

  • New routing tests in src/tui/overlay-key-routing.test.ts pass (3/3).
  • Targeted TUI shell/palette/key suites green; full gate result posted as a comment.

Fixes CL-6723

DO NOT MERGE

@linear-code

linear-code Bot commented Sep 13, 2026

Copy link
Copy Markdown

CL-6723

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Verification: targeted TUI suites green (134 pass, 0 fail across slash-popup-gate, mention-popup, mention-filter, overlays, overlay-key-routing, focus-routing, shell, keybindings). Full gate bun run check exit 0: 7300 pass, 0 fail across 501 files. DO NOT MERGE.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Critic review · no blockers

Does what the Outcome claims: unclaimed printables with an overlay open land in the prompt via prompt insertText plus sentHistoryOnEdit, overlay stays open, permissions/operator gates keep modal handling. Placement is right — the fallthrough sits after every claim (slash/mention/answer/filter/action/nav/Enter), so claimed keys, Enter accept, and Esc dismiss are structurally untouched. Guard (isPrintableInsertKey: single char, no modifiers, >= space) provably excludes Return and Esc sequences, so those paths cannot reach the new code.

Verified, not vibes: on the branch worktree at 46c4546, src/tui/overlay-key-routing.test.ts 3/3 pass, plus throwaway probes (since removed) confirmed a permissions gate swallows x (prompt stays empty, gate stays open) and help + x routes to the prompt with the overlay open. Worktree left clean, no commits.

Should-fix (non-blocking)

  • src/tui/overlay-key-routing.test.ts — the "ephemeral popup symmetry" test does not exercise the new code: m after / is claimed by handleSlashPopupKey before the fallthrough is reached. Valid regression guard, misattributed name. Either rename it or add a case that hits the fallthrough through an ephemeral popup surface.
  • The modal exception — the Outcome's headline carve-out — has no test in this file. Keepers worth adding (route to testsmith/builder, not necessarily this PR): printable swallowed while a permissions gate is open (gate stays open), same for the operator gate.

Notes

  • Rebase needed before merge: branch base a76f1c6, origin/main now at 9f37404. DO NOT MERGE stands.
  • Hygiene clean: no dead code, no scope creep, test setup mirrors existing harness patterns.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Critic nits addressed in 976871c (tests only, routing unchanged):

  • Added modal keepers: printable x while a permissions gate is open leaves the prompt empty and the gate open; same for the operator gate.
  • Fixed the misattributed symmetry test: m after / is claimed by handleSlashPopupKey and never reached the new fallthrough. It now opens a plain palette (not a slash popup) and asserts an unclaimed printable reaches the prompt via the fallthrough, with isSlashPopupOpen false.

Verification: targeted TUI suites (overlay-key-routing, slash-popup-gate, mention-popup, prompt-box, focus-routing) 76 pass 0 fail; bun run check 7302 pass 0 fail across 501 files. Not merged.

@TheGreatAxios
TheGreatAxios merged commit 05f390d into main Sep 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant