Repository navigation
fix(shortcuts): leave Mod+Shift+arrows to text fields, and open New session with Mod+Shift+O - #298
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)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 (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe New session shortcut now uses Mod+Shift+O, while Mod+Shift+N remains available. Pane-switch shortcuts leave arrow keys available for recognized text-editing targets. The changelog and guide document these shortcut behaviors. ChangesKeyboard shortcuts
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 The shortcut changes are mergeable after normal checks. Real-Mac and browser-reserved-key behavior has not been validated, but no specific failure is established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
…sage box (#827) ## Change Mod+Shift+↑/↓ switch panes from the terminal view, but not from the chat view. The chat view puts the focus in the message box, and #298 leaves Mod+Shift+arrows to every text field (`keepsArrowsForText`), so in chat the shortcut never reaches `selectAdjacentPane`. #298 kept the arrows in the message box for two reasons: they select text, and switching would leave a message behind. An empty field has neither, so `keepsArrowsForText` now returns `false` when the target's `value` is `""`. A field with text keeps the arrows as before. Contenteditable targets have no `value` and are unchanged. One condition in `src/lib/shortcuts.ts`, plus tests, `docs/guide.md` and a changelog line. ## Validation - `scripts/ui-regression.ts`: new check after the switch to chat. From the empty message box, Ctrl+Shift+↓ leaves the pane; with a draft, it stays. - Without the fix: `Timed out: the empty message box leaves the pane`. - With the fix: `PASS pane shortcut from the empty message box; a draft keeps text selection`, and the full script passes. - `src/lib/shortcuts.test.ts`: empty textarea and empty text input switch panes; fields with text keep the arrows. The new expectations fail without the fix. - `bun run generate:types --check`, `bun run typecheck`, `bun run build`, `bun run test:unit` (2720 pass, 0 fail). - Not checked: a real Mac. - Unrelated: one of three `ui-regression.ts` runs failed earlier, at the palette check `a scroll under a resting pointer leaves the arrow's selection alone` (line 308), with and without this change. The other runs passed it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Hako <[email protected]>
Change
The bugs reported in #214, checked again on main first:
ESC[1;6Binto the terminal: already fixed by fix(terminal): app shortcuts no longer type into the pane #215. Checked in headless Chrome against an isolated herdr: Ctrl+Shift+↓ in pane A's terminal switched to pane B, and neither pane (both runningcat -v) received anything; what was typed next landed in B.useShortcutsnow 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
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.