Repository navigation
Add tmux split resize shortcuts - #4688
austinywang wants to merge 40 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds tmux-style split-resize shortcuts (Ctrl+B → Alt+Arrow) end-to-end: keyboard handling and helper in AppDelegate, TabManager resize APIs, default shortcut configuration and labels, web sequence model/UI, JSON schema update, tests, and locale strings. ChangesTmux-style split resize shortcuts
Sequence Diagram(s)sequenceDiagram
participant Keyboard as Keyboard Event
participant App as AppDelegate.handleCustomShortcut
participant Resolver as AppDelegate.performResizeSplitShortcut
participant TabMgr as TabManager.resizeFocusedSplit / TabManager.resizeSplit
participant Bonsplit as BonsplitController.setDividerPosition
Keyboard->>App: chord trigger (Ctrl+B → Alt+Arrow) or configured shortcut
App->>Resolver: match resizeSplit* action
Resolver->>TabMgr: call resizeFocusedSplit or tab.resizeSplit(amount)
TabMgr->>Bonsplit: setDividerPosition(amount)
Bonsplit-->>TabMgr: success/failure
TabMgr-->>Resolver: Bool result
Resolver-->>App: consume event / return
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors, 1 warning)
✅ Passed checks (15 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryAdds configurable, tmux-style split-resize shortcut chords and routes them through the existing keyboard handling and split-layout systems.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; both previously reported localization issues are fixed at the current head. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Matcher as AppDelegate Chord Matcher
participant Router as Shortcut Router
participant Layout as TabManager / DockSplitStore
User->>Matcher: Ctrl+B, then Option+Arrow
Matcher->>Router: resizeSplit(direction)
alt Focused split is in Dock
Router->>Layout: Resize focused Dock split by 120px
else Focused split is in workspace
Router->>Layout: Resize focused workspace split by 120px
end
Layout->>Layout: Synchronize live and cached layouts
Reviews (21): Last reviewed commit: "Merge branch 'main' of https://github.co..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/app/`[locale]/keyboard-shortcuts.tsx:
- Around line 25-27: Replace the hardcoded "then"/"次に" separator with a
localized message retrieved via next-intl and use it everywhere the separator is
needed: update sequenceToText (which calls comboToText) to accept or import the
localized separator message (e.g., via useTranslations or passed-in messages)
and join with that separator instead of " then ", and also replace the other
occurrences that build search tokens or UI strings (the places reusing the
hardcoded separator around comboToText usage) to use the same localized message
key so all locales in web/i18n/routing.ts are covered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e90556a2-83e7-4424-84f0-6d1af5be851a
📒 Files selected for processing (12)
Resources/Localizable.xcstringsSources/AppDelegate.swiftSources/KeyboardShortcutSettings.swiftSources/TabManager+CompatibilityTypes.swiftSources/TabManager.swiftcmuxTests/AppDelegateEqualizeSplitsShortcutTests.swiftcmuxTests/KeyboardShortcutSettingsEqualizeSplitsTests.swiftweb/app/[locale]/docs/configuration/page.tsxweb/app/[locale]/docs/keyboard-shortcuts/page.tsxweb/app/[locale]/keyboard-shortcuts.tsxweb/data/cmux-shortcuts.tsweb/data/cmux.schema.json
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
…-resize-shortcuts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Sources/KeyboardShortcutSettings.swift (1)
91-102:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftOut-of-scope changes detected: unrelated actions and logic modifications.
This file contains many changes unrelated to the tmux split resize feature:
- History navigation actions (lines 91-102, 185, 192-193, 250-251, 318-319, 326-329):
switchRightSidebarToHistory,focusHistoryBack,focusHistoryForward- TextBox actions (lines 112-113, 204-205, 379-382, 927-928):
focusTextBoxInput,attachTextBoxFile- Settings normalization logic change (lines 511-518): modifies
normalizedSettingsFileShortcutto preserve invalid values for certain actions- Config parsing changes (lines 2237, 2338-2342): alters space-handling behavior in
parseConfigKeyTokenandisUnboundConfigToken- Recorder activity changes (lines 2371-2390): adds
resetForTestingand modifiesstopAllRecordingflowAccording to the review stack context, this layer ("Split resize action definition and configuration") should only add "four resize actions, default tmux-style chord shortcuts and labels, localization entries, and the stepPixels default constant."
Including unrelated changes increases review burden, conflates feature history, and risks introducing unintended side effects. Consider extracting these changes into separate PRs or layers with clear justification.
Also applies to: 112-113, 168-168, 185-185, 192-193, 201-201, 204-205, 250-251, 318-319, 326-329, 379-382, 511-518, 927-928, 2237-2237, 2338-2342, 2371-2390
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Sources/KeyboardShortcutSettings.swift` around lines 91 - 102, The diff includes many unrelated changes beyond the intended "split resize" layer; remove or move out non-split-resize edits so this PR only adds the four resize actions and their metadata—specifically revert or extract modifications to History navigation enums (switchRightSidebarToHistory, focusHistoryBack, focusHistoryForward), TextBox actions (focusTextBoxInput, attachTextBoxFile), the settings normalization logic (normalizedSettingsFileShortcut), config parsing helpers (parseConfigKeyToken, isUnboundConfigToken), and recorder APIs (resetForTesting, stopAllRecording); keep only additions for the new resize actions, their default tmux-style chord shortcuts, labels/localization entries, and the stepPixels default constant, and put all other changes into separate focused commits/PRs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@Sources/KeyboardShortcutSettings.swift`:
- Around line 91-102: The diff includes many unrelated changes beyond the
intended "split resize" layer; remove or move out non-split-resize edits so this
PR only adds the four resize actions and their metadata—specifically revert or
extract modifications to History navigation enums (switchRightSidebarToHistory,
focusHistoryBack, focusHistoryForward), TextBox actions (focusTextBoxInput,
attachTextBoxFile), the settings normalization logic
(normalizedSettingsFileShortcut), config parsing helpers (parseConfigKeyToken,
isUnboundConfigToken), and recorder APIs (resetForTesting, stopAllRecording);
keep only additions for the new resize actions, their default tmux-style chord
shortcuts, labels/localization entries, and the stepPixels default constant, and
put all other changes into separate focused commits/PRs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 40aa80f8-1f68-4d8e-ba6d-49e1b2071f85
📒 Files selected for processing (15)
Resources/Localizable.xcstringsSources/AppDelegate.swiftSources/KeyboardShortcutSettings.swiftSources/TabManager.swiftcmuxTests/AppDelegateEqualizeSplitsShortcutTests.swiftweb/app/[locale]/docs/configuration/page.tsxweb/data/cmux-shortcuts.tsweb/data/cmux.schema.jsonweb/messages/ar.jsonweb/messages/bs.jsonweb/messages/da.jsonweb/messages/de.jsonweb/messages/en.jsonweb/messages/es.jsonweb/messages/fr.json
💤 Files with no reviewable changes (13)
- web/messages/ar.json
- web/messages/bs.json
- web/messages/de.json
- web/messages/fr.json
- web/data/cmux-shortcuts.ts
- web/messages/en.json
- web/messages/da.json
- Resources/Localizable.xcstrings
- cmuxTests/AppDelegateEqualizeSplitsShortcutTests.swift
- web/data/cmux.schema.json
- web/app/[locale]/docs/configuration/page.tsx
- web/messages/es.json
- Sources/TabManager.swift
|
Addressed the earlier CodeRabbit outside-diff note about unrelated |
|
Addressed the CodeRabbit pre-merge items from the PR walkthrough: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bf40fe6. Configure here.
…-resize-shortcuts # Conflicts: # Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction+Defaults.swift # Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift # Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/KeyboardShortcutsSection.swift # Sources/TabManager+CompatibilityTypes.swift # Sources/TabManager.swift
…-resize-shortcuts
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
…-resize-shortcuts
…-4499-tmux-split-resize-shortcuts # Conflicts: # Packages/macOS/CmuxSettings/Sources/CmuxSettings/Values/ShortcutStroke.swift # Sources/AppDelegate.swift # Sources/ControlSurfaceResumeTarget.swift # Sources/DockSplitStore+SessionSnapshot.swift
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
…-resize-shortcuts # Conflicts: # Sources/AppDelegate.swift

Closes #4499
Summary
Testing
git diff --check; JSON parse check forResources/Localizable.xcstringsandweb/data/cmux.schema.json.Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Note
Medium Risk
Touches global keyboard routing and split geometry in TabManager; behavior is covered by new tests but chord/prefix interaction with Ghostty fallbacks is easy to regress.
Overview
Adds tmux-style split resize as four new shortcut actions (
resizeSplitLeft/Right/Up/Down) with defaults Ctrl+B then Option+Arrow, wired throughAppDelegateintoTabManagerresize (120px step) and layout cache updates.Shortcut model & settings: Factory defaults move from stroke-only to
defaultShortcut(full chords); chorded defaults exposedefaultStrokeasnil. Keyboard shortcuts UI uses row snapshots, a chord-mode toggle, smarter conflict detection (shared prefix OK when second strokes differ), and chord-aware placeholders. Global hotkey section followsdefaultShortcut.Routing fix: Ghostty
goto_splitfallbacks apply only when no chord prefix is active, so resize chords do not steal pane focus.Docs & i18n: Schema, web shortcut catalog, config examples, and localized labels/sequence separator for multi-step shortcuts; tests cover defaults, JSON parsing, and end-to-end resize.
Reviewed by Cursor Bugbot for commit 04575e7. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Adds tmux‑style split resizing with four new, opt‑in chord shortcuts. Wired through
AppDelegateintoTabManagerand Dock with 120 px steps; cached and live layouts stay in sync. Implements #4499.New Features
resizeSplitLeft/Right/Up/Down(unbound). Matched inAppDelegate, executed viaTabManager.resizeFocusedSplitorDockShortcutCommand.resizeSplit;splitResizeShortcutStepPixels = 120.defaultShortcut; row toggle to record two‑step chords with persisted state; global hotkey disallows chords and hides the toggle; localized “Shortcut Chords”.web/data/cmux.schema.jsonandweb/data/cmux-shortcuts.ts; keyboard‑shortcuts renders/searches two‑step sequences with a localized “then”; examples accept arrays like ["ctrl+b","alt+right"].Bug Fixes
goto_splitruns only when no chord prefix is active.canonicalKeyToken) so recorded vs hand‑written arrows correctly conflict.Written for commit 78fd946. Summary will update on new commits.
Summary by CodeRabbit