Repository navigation
Fix workspace digit shortcut routing - #6978
austinywang wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughCmd+1…9 workspace selection now stays with the shortcut dispatcher: the menu shortcut for ChangesWorkspace number shortcut routing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches🧪 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 |
a2c45e0 to
3ab95a0
Compare
Greptile SummaryThis PR fixes workspace switching regressions (#5588) by making
Confidence Score: 5/5Safe to merge — the change narrows shortcut ownership to a single well-tested path with no new risk surface. The fix is tightly scoped: one new case in menuShortcut(for:) returns .unbound, the corresponding dead branch in cmuxApp.swift is cleaned up, and a regression test locks in both invariants. No new concurrency, global state, or test seams are introduced. The dead else branch flagged by the previous review is fully removed in this version. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User as User (Cmd+1…9)
participant SwiftUIMenu as SwiftUI Menu
participant AppDelegate as AppDelegate Dispatcher
participant TabManager as TabManager
Note over SwiftUIMenu: Before fix: could silently consume Cmd+1…9 after focus churn without invoking command closure
Note over SwiftUIMenu: After fix: menuShortcut(for: .selectWorkspaceByNumber) returns .unbound — no menu key equivalent registered
User->>AppDelegate: Cmd+digit keyDown
AppDelegate->>AppDelegate: shortcut(for: .selectWorkspaceByNumber) returns default digit shortcut
AppDelegate->>TabManager: selectWorkspaceByNumber(digit)
TabManager-->>User: workspace switched
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User as User (Cmd+1…9)
participant SwiftUIMenu as SwiftUI Menu
participant AppDelegate as AppDelegate Dispatcher
participant TabManager as TabManager
Note over SwiftUIMenu: Before fix: could silently consume Cmd+1…9 after focus churn without invoking command closure
Note over SwiftUIMenu: After fix: menuShortcut(for: .selectWorkspaceByNumber) returns .unbound — no menu key equivalent registered
User->>AppDelegate: Cmd+digit keyDown
AppDelegate->>AppDelegate: shortcut(for: .selectWorkspaceByNumber) returns default digit shortcut
AppDelegate->>TabManager: selectWorkspaceByNumber(digit)
TabManager-->>User: workspace switched
Reviews (7): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
f1830f0 to
4745462
Compare
4745462 to
21920cf
Compare
…spacebynumber-default-cmd-1-9-silen # Conflicts: # cmux.xcodeproj/project.pbxproj
…spacebynumber-default-cmd-1-9-silen
…spacebynumber-default-cmd-1-9-silen
…spacebynumber-default-cmd-1-9-silen # Conflicts: # .github/swift-file-length-budget.tsv
Fixes #5588
Summary
menuShortcut(for: .selectWorkspaceByNumber)now always returns.unbound, and the per-digit.keyboardShortcutbindings were removed from the Workspace 1…9 menu items.WorkspaceNumberShortcutMenuRoutingTests) that locks in the invariant: the dispatcher keeps the default digit shortcut while the menu stays unbound.Testing
./scripts/lint-pbxproj-test-wiring.sh— confirms the new test file is wired into thecmuxTeststarget.git diff --checkswift-package-tests, andrelease-build; the newWorkspaceNumberShortcutMenuRoutingTestsregression test runs there.xcodebuildwere intentionally not run per task instructions (no-build constraint).Demo Video
Not applicable — this is a non-visual keyboard-shortcut routing fix with no change to UI appearance. Behavior is verified by the
WorkspaceNumberShortcutMenuRoutingTestsregression test plus the full CI suite; manual/dogfood builds were intentionally not run per task instructions.Review Trigger (Copy/Paste as PR comment)
Checklist
WorkspaceNumberShortcutMenuRoutingTests)Summary by cubic
Keep Cmd+1…9 workspace shortcuts owned by the AppDelegate dispatcher so SwiftUI menus can’t intercept them, ensuring consistent workspace switching. Fixes #5588.
menuShortcut(for: .selectWorkspaceByNumber)now returns.unbound; removed all per-digit.keyboardShortcuts from Workspace 1…9 menu items so Cmd+1…9 always routes through the dispatcher.WorkspaceNumberShortcutMenuRoutingTeststo verify the dispatcher uses the default digit shortcut and the menu stays unbound.Written for commit cfa515e. Summary will update on new commits.
Summary by CodeRabbit