Caution
Review failed
The pull request is closed.
Walkthrough
This pull request adds two new keybindings: a terminal close command (mod+w) that works when terminal focus is active, and a local chat thread command (mod+shift+n) that creates new threads while preserving the current git branch and worktree state. The changes update keybinding definitions, add context-aware shortcut detection helpers, and modify UI components to handle and display these new shortcuts.
Changes
| Cohort / File(s) | Summary |
|---|---|
Keybinding Definitions KEYBINDINGS.md, apps/server/src/keybindings.ts, packages/contracts/src/keybindings.ts | Added terminal.close (mod+w) with terminalFocus condition and chat.newLocal (mod+shift+n) with !terminalFocus condition. Updated terminal and chat command semantics to be gated by focus state. Extended keybinding schema to include new command types. |
Keybinding Utilities & Tests apps/web/src/keybindings.ts, apps/web/src/keybindings.test.ts, packages/contracts/src/keybindings.test.ts | Added isTerminalCloseShortcut() and isChatNewLocalShortcut() helper functions following existing patterns. Extended test coverage to validate new shortcuts across platform-specific key combinations and focus states. |
Chat View Component apps/web/src/components/ChatView.tsx | Added terminal close shortcut handling that verifies an active terminal exists and calls closeTerminal(). Introduced memoized closeShortcutLabel for display via ThreadTerminalDrawer prop. Extended keyboard handler dependencies. |
Sidebar Component apps/web/src/components/Sidebar.tsx | Updated handleNewThread() signature to accept optional branch and worktreePath parameters. Added keyboard handler for isChatNewLocalShortcut that creates new threads while preserving current thread's git state. |
Terminal Drawer Component apps/web/src/components/ThreadTerminalDrawer.tsx | Added closeShortcutLabel prop. Introduced computed closeTerminalActionLabel for consistent labeling. Replaced plain close button (×) with Popover-based control displaying close tooltip with shortcut hint. Updated per-terminal close labels to include shortcut information. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately describes the main changes: adding shortcuts for terminal close (mod+w) and a new chat command that preserves Git state (mod+shift+n for chat.newLocal). |
| Merge Conflict Detection | ✅ Passed | ✅ No merge conflicts detected when merging into main |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
codething/48203257
Comment @coderabbitai help to get the list of available commands and usage tips.