8000 feat(deck): pane navigation keys (#25) by simon-inkie · Pull Request #47 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

Skip to content

feat(deck): pane navigation keys (#25) - #47

Merged
simon-inkie merged 2 commits into
mainfrom
io/deck-25-pane-navigation-keys
Oct 11, 2026
Merged

simon-inkie merged 2 commits into
mainfrom
io/deck-25-pane-navigation-keys

Conversation

@simon-inkie
Copy link
Copy Markdown
Owner

Closes #25.

Reviewed at adcc3ed, two independent legs (CodeRabbit is off):

  • Sol 6.1: PASS with notes
  • Aggy (Gemini 3.8 Flash): PASS, tests green, public hygiene clean

Both reviews checked that the tests fail without the change.

🤖 Generated with Claude Code

https://claude.ai/code/session_018uNaFhmK6yxSR7XfzJDY3Z

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018uNaFhmK6yxSR7XfzJDY3Z
Signed-off-by: Simon <simon@inkie.ink>
@simon-inkie
8000 simon-inkie commented Oct 2, 2026
Copy link
Copy Markdown
Owner Author

Review, Sonnet, 2026-10-02

PR 47 (deck issue 25, pane navigation keys). SHA reviewed: adcc3ed

Verdict: PASS with notes (0 Major)

Ran npx vitest run test/tmux-send.test.ts test/tmux-pane-navigation.test.tsx in packages/deck: 2 files, 38 tests passed. The new tests import symbols that do not exist on main (sendNamedKeyToWindow, buildSendKeysNamedArgs), and assert the 400s, the shell refusal and the post-delay recheck, so they would fail without the change. Hygiene: no internal names, paths or plan mentions; ASCII only.

Critical

None.

Major

None.

Minor

  1. Shell-prompt guard is a whole-viewport scan, so a live agent can be locked out of text sends. packages/deck/app/lib/tmux.server.ts textSendRefusal (about line 252) tests SHELL_PROMPT_RE against every viewport line. The regex (\w+@[\w.-]+[:\s].*[$#%]\s*$) can match agent output such as a quoted user@host:~$ transcript, a git log, or a line like mail a@b.com: 50%. The issue asked for a refusal "when the pane matches the shell-prompt regex used elsewhere", and isIdleComposer at line ~447 only looks at the lowest lines. A stray match in scrollback therefore refuses legitimate text with a message that says the pane is at a shell. Fix: scan only the last few non-empty lines (as the existing classifier does), and add a test with a prompt-like line high in the viewport above a live composer.

  2. When the second recheck refuses (agent exited during the 1s delay), the literal text is already typed into the shell input line, and the error says "Text was not submitted", which is true but leaves the text sitting there. Fix: append "Clear the line before using the terminal" to the message. Do not add C-u to the allowlist for this.

  3. Route and library now carry two copies of the window-name rule: windowSchema in packages/deck/app/routes/api.tmux-send.tsx (/^[a-z0-9][a-z0-9-]*$/) duplicates WINDOW_NAME_RE in tmux.server.ts line 40, and the route used to leave this to the library. They match today. Fix: export and reuse WINDOW_NAME_RE (or isValidWindowName via .refine) so they cannot drift.

  4. The Enter nav key is not guarded against a shell pane (only text is). At a bare shell it runs an empty line, harmless, and Tab triggers completion, also harmless. Acceptable, but worth a one-line comment so a later reader does not assume the guard covers keys.

Nit

  1. Issue 25 asks for buttons labelled "Up, Down, Enter, Esc, Tab". The UI renders Escape; the tests pin that. Cosmetic, but either rename or amend the issue.
  2. Key list is declared twice (NAVIGATION_KEYS in the component, SEND_KEYS_ALLOWED_KEYS on the server). The component cannot import .server code, so a shared non-server constants module would remove the duplication.
  3. Route docstring line is now over-long; reflow.

Not checked

  • Real tmux behaviour of send-keys with BTab and Escape (tests stub execFileSync).
  • Visual layout of the button row under both terminal views and at phone width.
  • That data(...) 400 responses surface correctly through useFetcher in the running app (the component only reads fetcher.data.error; a 400 body still has ok: false, which I believe works, but I did not run it).
  • Typecheck of the whole package.

Keep main's verified text submission and agy pane support alongside the
navigation keys. Named keys keep their fixed allowlist and exact target;
text sends use the verified workflow. Text-send tests updated to the
verified status model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018uNaFhmK6yxSR7XfzJDY3Z
Signed-off-by: Simon <simon@inkie.ink>
@simon-inkie
simon-inkie merged commit e398eb2 into main Oct 11, 2026
4 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.

Deck's terminal view cannot send arrow keys, and text sent to a dead pane runs in bash

1 participant

0