Repository navigation
fix(terminal): app shortcuts no longer type into the pane - #215
Conversation
The app claims its shortcuts in a window capture listener that only calls preventDefault(). xterm.js does not check defaultPrevented, so it still encoded the key: in the terminal lens Ctrl+Shift+Down switched panes and sent ESC[1;6B to the pane it had just switched to (Up sent ESC[1;6A). xterm's key handler now skips any app shortcut. Refs #214. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughTerminal app shortcuts are checked before existing Ctrl-key handling. Matching events do not reach xterm. Browser regression checks verify that Ctrl+Shift+ArrowUp and Ctrl+Shift+ArrowDown switch panes without sending input. ChangesShortcut input handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to Registered app shortcuts are filtered before reaching terminal input, while ordinary keys retain their existing handling. The regression checks both pane-switch shortcuts for pane input; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
# Conflicts: # CHANGELOG.md
## Change Installed apps are on v0.3.35. This PR prepares v0.3.36. The app and plugin versions go up together, and the Unreleased notes move under the dated release heading. It also fixes the CHANGELOG: the #187 entries (edge swipe, Hide keyboard) had been placed in the already released 0.3.34 section. They now sit under Added in 0.3.36, merged with #217's text-selection fix for the swipe. Entries that had no PR link now have one. This release includes: - **Added:** - Left-edge drawer swipe and keyboard dismissal on phones (#187) - Opt-in color palettes and agent icons, with Amber staying the default (#188) - Claude's suggested next prompt in the composer (#198) - Plan meters at the top of the sidebar as an option (#206) - **Fixed:** - A fallback card for blocked screens no reader knows (#205) - Ctrl+Shift+↑/↓ typing into the terminal (#215) - Attach-held races (#207) - Plugin `stop` returning before the server is gone (#210) - A table inside a list (#209) - Queued messages showing only under the chat lens (#213) - Quick replies column on wide screens (#212) - A clear message for Windows hosts (#208) - **Pre-release review:** an adversarial review of everything since v0.3.35 found these problems, fixed in #216 (server) and #217 (client): - Fallback menu inference typed digits into a following prompt and cut off wrapped labels. - The held-attach timeout unlocked input after a refusal. - The suggestion read could delay prompt polling. - `stop` misread zombie processes. - The swipe stole text selection. - Ordered-list numbering restarted after a table. - A stale suggestion survived Send now. - The top usage panel hid provider failures. ## Validation - `bun scripts/release-notes.ts 0.3.36` passes. - Fast checks and Integration and browser must pass before the squash merge. After the merge, publish with `gh workflow run release.yml --ref main -f version=0.3.36`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ession with Mod+Shift+O (#298) ## Change The bugs reported in #214, checked again on main first: 1. **Pane switching leaking `ESC[1;6B` into the terminal**: already fixed by #215. Checked in headless Chrome against an isolated herdr: Ctrl+Shift+↓ in pane A's terminal switched to pane B, and neither pane (both running `cat -v`) received anything; what was typed next landed in B. 2. **New session (Mod+Shift+N) never reaching the page in a Chrome tab**: Chrome reserves Ctrl+Shift+N for a new incognito window. **Mod+Shift+O** now opens New session too, and is the one the app shows; Mod+Shift+N still works where the browser passes it (the installed app). Checked: Ctrl+Shift+O in the terminal opens the New session dialog and types nothing into the pane. 3. **Cmd+Shift+↑/↓ taken from the message box on a Mac**: reproduced with a Mac platform in headless Chrome: the shortcut switched panes and left the message behind. `useShortcuts` now leaves Mod+Shift+arrows to text fields (textarea, text inputs, contenteditable) and switches panes from the terminal (xterm's own input element) and everywhere else. Checked: the same key in the message box no longer switches panes. The configurable shortcuts that #214 proposes are not part of this; the issue stays open for them. ## Validation - Playwright against an isolated herdr session, as above. - `src/lib/shortcuts.test.ts`: which targets keep the arrows, and both new-session keys. - `bun run typecheck`, `bun run test:unit`, `bun run build`. - Not checked: a real Mac (the platform was set in the page) and a real Chrome tab's reserved keys (headless Chrome passes every key to the page).
Change
Refs #214 (Phase 0). In the terminal lens, Ctrl+Shift+↓ switched to the next pane and also typed
ESC[1;6Binto it; Ctrl+Shift+↑ typedESC[1;6A.useShortcutsclaims app shortcuts in a window capture listener that only callspreventDefault(). xterm.js doesn't checkdefaultPrevented, so it still encoded the key. By then React had already switched the selection, so the sequence went to the pane you switched to. The other app shortcuts (Ctrl+Shift+K/J/B/N/,) aren't encoded by xterm in its legacy keyboard mode today, but they are skipped the same way.The fix is a new
isAppShortcut()insrc/lib/shortcuts.ts, built on the samematchShortcutthe listener uses. xterm'sattachCustomKeyEventHandlerreturnsfalsefor any key it matches.Not in this PR: on macOS, Cmd+Shift+↑/↓ in the message box still switches panes instead of selecting text. Fixing that conflicts with keyboard pane switching in the chat lens, where the box has focus, so it stays in #214.
Validation
scripts/ui-regression.tsnow checks the terminal lens: Ctrl+Shift+↓ and Ctrl+Shift+↑ each leave the pane, and noinputframe goes to any pane.Control+Shift+ArrowDown must not reach a pane(text: '\x1B[1;6B').bun run typecheck,src/lib/shortcuts.test.tsandbun run buildpass.🤖 Generated with Claude Code