Skip to content

File explorer keyboard open selection - #6001

Merged
austinywang merged 69 commits into
mainfrom
issue-5996-file-explorer-keyboard-open
Jun 21, 2026
Merged

austinywang merged 69 commits into
mainfrom
issue-5996-file-explorer-keyboard-open

Conversation

@austinywang

@austinywang austinywang commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds configurable file-explorer open-selection shortcuts for Return/Enter and the Finder-style Cmd+Down alias.
  • Routes keyboard open through the same shared node-open helper used by outline-view double-click, so folders keep the existing expand/collapse behavior and files keep the current preview/editor semantics.
  • Mirrors the new actions through KeyboardShortcutSettings, CmuxSettings ShortcutAction metadata, cmux.json schema/docs, and localized Settings labels.

Notes

Verification

  • git diff --check
  • jq empty Resources/Localizable.xcstrings web/data/cmux.schema.json
  • node -e "const fs=require('fs'); JSON.parse(fs.readFileSync('web/data/cmux.schema.json','utf8')); JSON.parse(fs.readFileSync('Resources/Localizable.xcstrings','utf8')); console.log('json ok')"
  • Local tests/build not run per task instruction; CI owns test execution.

Localization

  • Added shortcut.fileExplorerOpenSelection.label and shortcut.fileExplorerOpenSelectionFinderAlias.label to Resources/Localizable.xcstrings with English and Japanese translations.
  • Parsed touched localization/schema JSON and verified both new keys have en/ja values.

Closes #5996


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Adds configurable File Explorer open-selection shortcuts (Return and Finder‑style Cmd+Down) across the outline, search field, and results, routed through the shared open handler. Visible in Keyboard Shortcut Settings with shared CmuxSettings ordering and localized labels; implements #5996.

  • New Features

    • Added fileExplorerOpenSelection (Return) and fileExplorerOpenSelectionFinderAlias (Cmd+Down); toggles folders and opens files per preview/default/preferred editor rules; works from outline, search field, and results.
    • Shown in Keyboard Shortcut Settings via shared ShortcutAction.settingsVisibleActions ordering (after right‑sidebar toggles and “Find in Directory”); bare first strokes allowed, chords disallowed. Schema/docs/localization updated; web renders ↩ and ⌘↓ via localizedShortcutText. Split File Explorer into focused AppKit views with no UI changes.
  • Bug Fixes

    • Routed open‑selection from child focus to the pane before stale menu suppression; excluded from app‑wide bare‑start routing; respects the shortcut event window; pane routing wins when File Explorer is focused.
    • Preserved search‑field Return commit when unbound and respected IME; accepts “return”/“enter” in config. Tests cover defaults, ordering, routing, context, and search/IME fallbacks.

Written for commit f5b0d27. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Two new customizable file-explorer shortcuts: "Open selection" (Return) and a Finder-style variant (Cmd + ↓). Appear in keyboard settings with localized labels, default to right‑sidebar focus, allow bare first-stroke keys, and disallow two‑stroke chords. UI now handles and consumes these shortcuts across file explorer views.
  • Tests

    • Added suites validating defaults, focus context, allowance flags, chord exclusion, persistence, and routing/suppression behavior.
  • Documentation

    • Shortcut catalog/schema and localization entries updated with descriptions.

@vercel

vercel Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 21, 2026 10:34pm
cmux-staging Building Building Preview, Comment Jun 21, 2026 10:34pm

@coderabbitai

coderabbitai Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds two user-configurable file-explorer open-selection shortcuts (Return and Cmd+Down), registers them in settings and schema, enforces chord/bare-first policies, wires runtime handling across outline/search views, updates localization and web docs, adds tests, and updates Xcode project wiring.

Changes

File Explorer Keyboard Open Shortcuts

Layer / File(s) Summary
Shortcut action contracts and defaults
Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift, Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction+Defaults.swift, Sources/KeyboardShortcutContext.swift
Two new ShortcutAction enum cases (fileExplorerOpenSelection, fileExplorerOpenSelectionFinderAlias) are registered with Return/Cmd+Down defaults, grouped under .panes, defaulting to .atom(.sidebarFocus)/.rightSidebarFocus, allowing bare-first-stroke but disallowing chord shortcuts, and exposing localized display names.
Keyboard settings framework registration
Sources/KeyboardShortcutSettings.swift
Adds the two actions to the colocated right-sidebar ordering with localized labels and default bindings in Action.defaultShortcut.
Shortcut normalization and chord enforcement
Sources/KeyboardShortcutSettings.swift, Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/KeyboardShortcutsSection.swift
Recorded shortcut normalization, settings-file normalization, persistence, and the UI chord-assignment path now reject or block chord-shaped shortcuts for actions where allowsChordShortcut == false.
File explorer keyboard event handling
Sources/FileExplorerKeyboardShortcuts.swift
Implements matching and handling of the open-selection shortcuts across outline, search field, and search results; coordinator logic toggles folders or opens file previews (provider-checked) as appropriate.
File explorer view integration
Sources/FileExplorerView.swift
Widened helper access, refactored double-click to use shared open logic, and short-circuited keyDown/performKeyEquivalent/command routing to consume the open-selection shortcut where handled.
Shortcut routing and menu-backed classification
Sources/AppDelegate.swift, Sources/App/ShortcutBareStartRouting.swift
Chord-arming candidates are filtered by allowsChordShortcut; file-explorer open-selection actions are treated as non-menu-backed to avoid stale menu suppression and are excluded from app-wide bare-start routing.
Web schema generalization
web/data/cmux.schema.json
Adds new action ids and properties; replaces diff-viewer-specific first-stroke defs with reusable bare-first-stroke definitions and updates accepted-key patterns/descriptions.
Localization and web documentation
Resources/Localizable.xcstrings, web/data/cmux-shortcuts.ts
Adds localized labels for both actions (including Finder Alias wording) and inserts catalog entries with key combos, descriptions, and notes.
Keyboard settings unit tests
cmuxTests/FileExplorerShortcutSettingsTests.swift, Packages/CmuxSettings/Tests/CmuxSettingsTests/ShortcutActionNumberedDigitTests.swift
Adds tests asserting default key/modifier pairs, bare-first-stroke allowances, chord disallowance, sidebar focus context, and ShortcutAction-derived defaults/display names.
Shortcut routing integration test
cmuxTests/AppDelegateFileExplorerShortcutRoutingTests.swift
Adds an integration test ensuring the Cmd+Down Finder-alias shortcut is not suppressed as a stale menu-backed shortcut.
Xcode project configuration
cmux.xcodeproj/project.pbxproj
Adds PBXFileReference/PBXBuildFile entries and wires new source/test files into app and test target build phases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • manaflow-ai/cmux#4445: Modifies AppDelegate.swift chord eligibility filtering related to chord-action routing.

Suggested reviewers

  • lawrencecchen

Poem

A rabbit hops through folders deep,
With Return and Cmd-Down to keep —
No more mouse-clicks to find the way,
Keyboard keys now save the day,
Happy hops through files all day! 🐰✨


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error web/data/cmux-shortcuts.ts adds fileExplorerOpenSelection* texts only for en/ja, while web/i18n/routing.ts lists 20 locales; web/messages has no matching entries for these ids. Move these shortcut description/note strings to next-intl web/messages and add translations for every locale in web/i18n/routing.ts, or extend web/data to all locales per the rule.
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 (19 passed)
Check name Status Explanation
Title check ✅ Passed The title 'File explorer keyboard open selection' directly and clearly describes the main change: adding keyboard shortcut support for opening selected files in the file explorer.
Linked Issues check ✅ Passed All objectives from issue #5996 are met: Return/Enter opens selected files, Cmd+Down provides Finder parity, folders expand/collapse, shortcuts are customizable through KeyboardShortcutSettings, and multi-selection semantics are preserved.
Out of Scope Changes check ✅ Passed All code changes are directly aligned with issue #5996 objectives: adding file explorer open selection shortcuts, their keyboard routing, settings/schema updates, and localization—no extraneous modifications detected.
Cmux Swift Actor Isolation ✅ Passed Scanned production Swift changes for MainActor/Sendable/concurrency issues: new file-explorer shortcut handling is synchronous or inside @MainActor SwiftUI/AppKit flows; no added background UI-stor...
Cmux Swift Blocking Runtime ✅ Passed Checked rule file and scanned git diff (origin/main..HEAD) + touched non-test Swift for sleep/Task.sleep/semaphore/wait/asyncAfter/DispatchQueue.sync/locks/polling; no matches found.
Cmux Expensive Synchronous Load ✅ Passed Inspected PR-touched shortcut routing in Sources/AppDelegate.swift: no RestorableAgentSessionIndex.load in currentConfiguredShortcutChordActions/isMenuBackedShortcutAction; existing RestorableAgent...
Cmux Cache Substitution Correctness ✅ Passed Checked .github review rules and PR diff vs those keywords (persistence/history/undo/snapshot/cold/stale cache substitution). No such cache→persistence swap found in production changes; only stale...
Cmux No Hacky Sleeps ✅ Passed In web/data/cmux-shortcuts.ts, scans for setTimeout/setInterval/sleep/usleep/timers and polling found 0 hits; non-Swift changes are data/localization only, so no hacky sleeps added.
Cmux Algorithmic Complexity ✅ Passed Diff adds new shortcut actions and routing guards but no nested full-collection scans/sorts/filters in added lines; detected zero new loop lines and only constant-size array contains checks.
Cmux Swift Concurrency ✅ Passed PR diff (main..HEAD) contains no DispatchQueue/Combine/completion-handler/Task { /fire-and-forget usage; only change is an added guard inside an existing async assignChord(_:) function.
Cmux Swift @Concurrent ✅ Passed Scanned the PR’s Swift files: no occurrences of @concurrent or nonisolated async. UI async code (e.g., KeyboardShortcutsSection) awaits actor-isolated JSONConfigStore calls, avoiding annotation rul...
Cmux Swift File And Package Boundaries ✅ Passed No Swift file-package-boundary violation found: new/added production glue FileExplorerKeyboardShortcuts.swift is 65 LOC and is single-purpose UI shortcut handling; other changes are localized in la...
Cmux Swift Logging ✅ Passed No disallowed Swift logging (print/debugPrint/dump/NSLog) appears in the PR’s diff hunks; scanned PR-related production Swift files for those patterns and found none added, and no @MainActor file-s...
Cmux User-Facing Error Privacy ✅ Passed Checked added shortcut label/description entries in Localizable.xcstrings and cmux-shortcuts.ts; they contain no upstream/vendor/provider/billing/env/db/secret details. No new user-facing alert/err...
Cmux Swiftui State Layout ✅ Passed PR changes only settings/keyboard plumbing and AppKit outline selection handling; no new ObservableObject/@Published/@observable, GeometryReader, or SwiftUI @State/list store subtrees in diff.
Cmux Architecture Rethink ✅ Passed swift-architectural-rethink.md flags sleeps/asyncAfter/polling/locks/side-channel state; PR’s added routing code (e.g., FileExplorerView open-selection) delegates to the shared coordinator and diff...
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed Diff introduces file-explorer keyboard shortcut plumbing only; no added/changed NSWindow/NSPanel/WindowGroup or cmuxAuxiliaryWindowIdentifiers/cmuxWindowShouldOwnCloseShortcut assignments detected.
Cmux Source Artifacts ✅ Passed git diff --name-only is empty (no changed paths to evaluate), and repo scan found no forbidden artifact dirs (DerivedData/tmp/artifacts/etc.).
Description check ✅ Passed PR description comprehensively covers all required sections: detailed summary of changes, testing verification steps, localization details, and structured approach for future features.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-5996-file-explorer-keyboard-open

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds two configurable file-explorer keyboard shortcuts — fileExplorerOpenSelection (Return) and fileExplorerOpenSelectionFinderAlias (Cmd+Down) — routed through the existing shared openNode helper so folders toggle and files follow the double-click-action setting. It also splits the monolithic FileExplorerView.swift into focused AppKit subclasses (FileExplorerNSOutlineView, FileExplorerSearchField, FileExplorerSearchResultsTableView, etc.), reducing that file from ~2355 to ~1637 lines.

  • Shortcut plumbing: New ShortcutAction cases added to CmuxSettings with allowsBareFirstStroke, allowsChordShortcut, whenClause (sidebarFocus), and defaults; reflected in KeyboardShortcutSettings, bare-start routing exclusion, stale-menu-suppression exclusion, and isMenuBackedShortcutAction guards.
  • Event routing: handleFocusedFileExplorerOpenSelectionShortcut walks the view hierarchy to find the focused file-explorer view and dispatches to the correct handler; called before stale-menu suppression in both NSApplication.sendEvent and NSWindow.sendEvent, and in the global shortcut handler.
  • Localization and docs: Resources/Localizable.xcstrings entries carry translations for all 20 supported locales; cmux-shortcuts.ts inline translations cover all 20 web locales; schema and configuration docs updated.

Confidence Score: 5/5

Safe to merge — all previously identified issues were addressed in prior commits, localization is complete across all 20 app and web locales, and the event-routing additions follow the established stale-menu-suppression and bare-start-routing patterns.

The change is a well-scoped feature addition: new shortcut actions are fully gated by allowsChordShortcut and allowsBareFirstStroke, excluded from app-wide bare-start routing and stale-menu suppression loops, and dispatched through a focused view-hierarchy walk rather than a broad event intercept. The three previously flagged issues (compile error in the NSEvent extension, unbound-shortcut beep in results table, and missing xcstrings locales) are all confirmed fixed. Web and app locale coverage is complete.

No files require special attention.

Important Files Changed

Filename Overview
Sources/FileExplorerKeyboardShortcuts.swift New file centralizing keyboard-shortcut handling across outline view, search field, and results table; correctly guards IME, plain-printable-text, and unbound cases
Sources/FileExplorerNSOutlineView.swift Extracted NSOutlineView subclass with quick-search, open-selection shortcut, and placement property; event ordering is correct (printable-text quick-search → open-selection → special-key quick-search → move/disclosure)
Sources/FileExplorerSearchField.swift Extracted search field; adds performKeyEquivalent for Cmd+Down alias and handleOpenSelectionShortcut in keyDown; unbound-Return falls through to super.keyDown → insertNewline in delegate
Sources/FileExplorerSearchResultsTableView.swift Extracted results table view; open-selection shortcut checked first, then hardcoded keyCode 36/76 fallback ensures commit even when shortcut is unbound
Sources/KeyboardShortcutContext.swift Adds handleFocusedFileExplorerOpenSelectionShortcut routing via view-hierarchy walk; also inverts shortcutResolvedEventWindow to prefer NSApp.window(withWindowNumber:) for synthesized-event robustness
Sources/AppDelegate.swift Routes file-explorer shortcut before stale-menu-suppression paths in both NSApplication.sendEvent and NSWindow.sendEvent overrides; excludes new actions from menu-backed and chord-routing logic
Sources/KeyboardShortcutSettings.swift Adds allowsChordShortcut, isBareFirstStroke allowance, whenClause (rightSidebarFocus), default shortcuts, and configKeyString mappings for return/tab
Packages/macOS/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift Adds two new ShortcutAction cases with correct allowsBareFirstStroke, allowsChordShortcut, whenClause, and localized labels
web/data/cmux-shortcuts.ts Adds two new shortcut entries with full inline translations for all 20 web locales; extracts localizedShortcutText helper
Sources/FileExplorerView.swift Reduced from ~2355 to ~1637 lines by extracting AppKit subclasses; resolvedSelectionRow widened from private to internal for cross-file production caller

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant NSApp as NSApplication.sendEvent
    participant Win as NSWindow.sendEvent
    participant AD as AppDelegate
    participant FE as FileExplorer view
    participant Coord as Coordinator

    User->>NSApp: keyDown / keyEquivalent
    NSApp->>AD: handleFocusedFileExplorerOpenSelectionShortcut(event)
    AD->>AD: shortcutFileExplorerFocusView(for: firstResponder)
    alt outline view focused
        AD->>FE: outlineView.handleOpenSelectionShortcut(event)
        FE->>Coord: openSelectedNode(in: outlineView)
        Coord->>Coord: openNode(expand/collapse or openFile)
    else results table focused
        AD->>FE: resultsView.handleOpenSelectionShortcut(event)
        FE-->>AD: calls onCommit
    else search field focused
        AD->>FE: searchField.handleOpenSelectionShortcut(event)
        FE-->>AD: calls onCommit (if not IME, not plain text)
    else not file explorer
        AD-->>NSApp: false
        NSApp->>Win: shouldSuppressStaleCmuxMenuShortcut?
        Win->>AD: handleFocusedFileExplorerOpenSelectionShortcut(event)
        AD-->>Win: false, continue normal routing
    end
Loading
%%{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
    participant NSApp as NSApplication.sendEvent
    participant Win as NSWindow.sendEvent
    participant AD as AppDelegate
    participant FE as FileExplorer view
    participant Coord as Coordinator

    User->>NSApp: keyDown / keyEquivalent
    NSApp->>AD: handleFocusedFileExplorerOpenSelectionShortcut(event)
    AD->>AD: shortcutFileExplorerFocusView(for: firstResponder)
    alt outline view focused
        AD->>FE: outlineView.handleOpenSelectionShortcut(event)
        FE->>Coord: openSelectedNode(in: outlineView)
        Coord->>Coord: openNode(expand/collapse or openFile)
    else results table focused
        AD->>FE: resultsView.handleOpenSelectionShortcut(event)
        FE-->>AD: calls onCommit
    else search field focused
        AD->>FE: searchField.handleOpenSelectionShortcut(event)
        FE-->>AD: calls onCommit (if not IME, not plain text)
    else not file explorer
        AD-->>NSApp: false
        NSApp->>Win: shouldSuppressStaleCmuxMenuShortcut?
        Win->>AD: handleFocusedFileExplorerOpenSelectionShortcut(event)
        AD-->>Win: false, continue normal routing
    end
Loading

Reviews (50): Last reviewed commit: "Merge branch 'main' of https://github.co..." | Re-trigger Greptile

Comment thread Resources/Localizable.xcstrings

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/KeyboardShortcutsSection.swift (1)

302-308: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Include the two file-explorer open actions in the colocated sidebar ordering list.

settingsVisibleActions currently colocates .focusRightSidebar, .toggleRightSidebar, and .findInDirectory, but omits .fileExplorerOpenSelection and .fileExplorerOpenSelectionFinderAlias. This drifts from the app-side ordering and leaves the new actions outside the intended sidebar shortcut cluster.

Suggested fix
         let colocated: [ShortcutAction] = [
             .focusRightSidebar,
             .toggleRightSidebar,
+            .fileExplorerOpenSelection,
+            .fileExplorerOpenSelectionFinderAlias,
             .findInDirectory,
         ].filter(base.contains)

Also applies to: 317-319

🤖 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
`@Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/KeyboardShortcutsSection.swift`
around lines 302 - 308, The colocated sidebar ordering in the static var
settingsVisibleActions currently omits the two file-explorer actions, causing
them to be placed outside the intended shortcut cluster; update
settingsVisibleActions (and the other similar list around the 317–319 region) to
include .fileExplorerOpenSelection and .fileExplorerOpenSelectionFinderAlias
alongside .focusRightSidebar, .toggleRightSidebar, and .findInDirectory so the
file-explorer actions are grouped with the sidebar shortcuts.
Sources/KeyboardShortcutSettings.swift (1)

903-914: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Disallowed chords can still be persisted for file-explorer open actions.

Line 903 currently accepts resolvedRecordedShortcutIgnoringConflicts results without enforcing allowsChordShortcut. Since that resolver returns .accepted for most actions, a two-stroke binding can still be written for actions that explicitly disallow chords.

Suggested fix
 private static func storedShortcutForPersistence(
     _ shortcut: StoredShortcut,
     action: Action
 ) -> StoredShortcut? {
     if shortcut.isUnbound {
         return shortcut
     }
+    if shortcut.hasChord && !action.allowsChordShortcut {
+        return nil
+    }

     switch action.resolvedRecordedShortcutIgnoringConflicts(shortcut) {
     case let .accepted(normalizedShortcut):
         return normalizedShortcut
     case .rejected:
         if action.usesNumberedDigitMatching ||
             action == .showHideAllWindows ||
             action == .globalSearch ||
             !action.allowsChordShortcut {
             return nil
         }
         return shortcut
     }
 }
🤖 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 903 - 914, The accepted
branch of resolvedRecordedShortcutIgnoringConflicts currently returns
normalizedShortcut unconditionally, allowing chord shortcuts where
action.allowsChordShortcut is false; modify the .accepted(normalizedShortcut)
case to detect chord shortcuts (e.g., normalizedShortcut.isChord or equivalent)
and if the action disallows chords (action.allowsChordShortcut == false) treat
it like the .rejected branch (apply the same logic used there: if
action.usesNumberedDigitMatching || action == .showHideAllWindows || action ==
.globalSearch || !action.allowsChordShortcut then return nil else return the
original shortcut) so disallowed chords are not persisted for actions like
file-explorer open.
🤖 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
`@Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/KeyboardShortcutsSection.swift`:
- Around line 302-308: The colocated sidebar ordering in the static var
settingsVisibleActions currently omits the two file-explorer actions, causing
them to be placed outside the intended shortcut cluster; update
settingsVisibleActions (and the other similar list around the 317–319 region) to
include .fileExplorerOpenSelection and .fileExplorerOpenSelectionFinderAlias
alongside .focusRightSidebar, .toggleRightSidebar, and .findInDirectory so the
file-explorer actions are grouped with the sidebar shortcuts.

In `@Sources/KeyboardShortcutSettings.swift`:
- Around line 903-914: The accepted branch of
resolvedRecordedShortcutIgnoringConflicts currently returns normalizedShortcut
unconditionally, allowing chord shortcuts where action.allowsChordShortcut is
false; modify the .accepted(normalizedShortcut) case to detect chord shortcuts
(e.g., normalizedShortcut.isChord or equivalent) and if the action disallows
chords (action.allowsChordShortcut == false) treat it like the .rejected branch
(apply the same logic used there: if action.usesNumberedDigitMatching || action
== .showHideAllWindows || action == .globalSearch || !action.allowsChordShortcut
then return nil else return the original shortcut) so disallowed chords are not
persisted for actions like file-explorer open.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ffe312b1-f814-40ff-9a28-1e688d82bbd1

📥 Commits

Reviewing files that changed from the base of the PR and between 96fa3a4 and 86e79d9.

⛔ Files ignored due to path filters (1)
  • .github/swift-file-length-budget.tsv is excluded by !**/*.tsv
📒 Files selected for processing (12)
  • Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift
  • Packages/CmuxSettings/Tests/CmuxSettingsTests/ShortcutActionNumberedDigitTests.swift
  • Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/KeyboardShortcutsSection.swift
  • Resources/Localizable.xcstrings
  • Sources/AppDelegate.swift
  • Sources/FileExplorerKeyboardShortcuts.swift
  • Sources/FileExplorerView.swift
  • Sources/KeyboardShortcutSettings.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/AppDelegateFileExplorerShortcutRoutingTests.swift
  • cmuxTests/FileExplorerShortcutSettingsTests.swift
  • web/data/cmux.schema.json

Comment thread Sources/FileExplorerKeyboardShortcuts.swift Outdated
@austinywang

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…rer-keyboard-open

# Conflicts:
#	.github/swift-file-length-budget.tsv
…-5996-file-explorer-keyboard-open

# Conflicts:
#	.github/swift-file-length-budget.tsv
@austinywang
austinywang merged commit 861f363 into main Jun 21, 2026
35 checks passed
@austinywang
austinywang deleted the issue-5996-file-explorer-keyboard-open branch June 21, 2026 22:45

This branch was successfully deployed

1 active deployment
Preview – cmux — f5b0d276 Deployed Jun 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File explorer: open selected file with the keyboard (Return/Enter) — currently only double-click opens

1 participant