From d441a8594dec86acb805babd85d70e0c350ce3e6 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Mon, 25 May 2026 19:03:59 -0700 Subject: [PATCH 1/8] Add cyclic pane focus shortcuts --- Resources/Localizable.xcstrings | 136 ++++++++++++++++++ Sources/AppDelegate.swift | 12 ++ ...ntentView+RightSidebarCommandPalette.swift | 4 + Sources/ContentView.swift | 24 ++++ Sources/KeyboardShortcutSettings.swift | 10 ++ Sources/TabManager.swift | 12 ++ Sources/Workspace.swift | 34 +++++ Sources/cmuxApp.swift | 6 + cmuxTests/KeyboardShortcutContextTests.swift | 13 ++ cmuxTests/TabManagerUnitTests.swift | 43 ++++++ web/data/cmux-shortcuts.ts | 2 + web/data/cmux.schema.json | 2 + 12 files changed, 298 insertions(+) diff --git a/Resources/Localizable.xcstrings b/Resources/Localizable.xcstrings index 12e580643703..54235bc44241 100644 --- a/Resources/Localizable.xcstrings +++ b/Resources/Localizable.xcstrings @@ -24627,6 +24627,40 @@ } } }, + "command.nextPane.subtitle": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Pane Navigation" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "ペインナビゲーション" + } + } + } + }, + "command.nextPane.title": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Next Pane" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "次のペイン" + } + } + } + }, "command.nextTabInPane.subtitle": { "extractionState": "manual", "localizations": { @@ -26016,6 +26050,40 @@ } } }, + "command.previousPane.subtitle": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Pane Navigation" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "ペインナビゲーション" + } + } + } + }, + "command.previousPane.title": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Previous Pane" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "前のペイン" + } + } + } + }, "command.previousTabInPane.subtitle": { "extractionState": "manual", "localizations": { @@ -49329,6 +49397,23 @@ } } }, + "menu.view.nextPane": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Next Pane" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "次のペイン" + } + } + } + }, "menu.view.nextSurface": { "extractionState": "manual", "localizations": { @@ -49567,6 +49652,23 @@ } } }, + "menu.view.previousPane": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Previous Pane" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "前のペイン" + } + } + } + }, "menu.view.previousSurface": { "extractionState": "manual", "localizations": { @@ -87668,6 +87770,23 @@ } } }, + "shortcut.nextPane.label": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Next Pane" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "次のペイン" + } + } + } + }, "shortcut.nextSurface.label": { "extractionState": "manual", "localizations": { @@ -88683,6 +88802,23 @@ } } }, + "shortcut.previousPane.label": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Previous Pane" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "前のペイン" + } + } + } + }, "shortcut.previousSurface.label": { "extractionState": "manual", "localizations": { diff --git a/Sources/AppDelegate.swift b/Sources/AppDelegate.swift index fefd060ca08f..252815d5f5c3 100644 --- a/Sources/AppDelegate.swift +++ b/Sources/AppDelegate.swift @@ -12215,6 +12215,18 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent return true } + // Pane cycling: focus the next/previous split pane in stable split-tree order. + if matchConfiguredShortcut(event: event, action: .nextPane) { + let targetManager = preferredMainWindowContextForShortcutRouting(event: event)?.tabManager ?? tabManager + _ = targetManager?.focusNextPane() + return true + } + if matchConfiguredShortcut(event: event, action: .prevPane) { + let targetManager = preferredMainWindowContextForShortcutRouting(event: event)?.tabManager ?? tabManager + _ = targetManager?.focusPreviousPane() + return true + } + // Surface navigation: Cmd+Shift+] / Cmd+Shift+[ if matchConfiguredShortcut(event: event, action: .nextSurface) { tabManager?.selectNextSurface() diff --git a/Sources/ContentView+RightSidebarCommandPalette.swift b/Sources/ContentView+RightSidebarCommandPalette.swift index 6b43db52f1ad..0edf97e42899 100644 --- a/Sources/ContentView+RightSidebarCommandPalette.swift +++ b/Sources/ContentView+RightSidebarCommandPalette.swift @@ -45,6 +45,10 @@ extension ContentView { return .nextSurface case "palette.previousTabInPane": return .prevSurface + case "palette.nextPane": + return .nextPane + case "palette.previousPane": + return .prevPane case "palette.browserToggleDevTools": return .toggleBrowserDeveloperTools case "palette.browserConsole": diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index 1799a8618ed3..cb9385c5cbf6 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -6899,6 +6899,24 @@ struct ContentView: View { when: { $0.bool(CommandPaletteContextKeys.hasFocusedPanel) } ) ) + contributions.append( + CommandPaletteCommandContribution( + commandId: "palette.nextPane", + title: constant(String(localized: "command.nextPane.title", defaultValue: "Next Pane")), + subtitle: constant(String(localized: "command.nextPane.subtitle", defaultValue: "Pane Navigation")), + keywords: ["next", "pane", "split", "focus"], + when: { $0.bool(CommandPaletteContextKeys.hasFocusedPanel) } + ) + ) + contributions.append( + CommandPaletteCommandContribution( + commandId: "palette.previousPane", + title: constant(String(localized: "command.previousPane.title", defaultValue: "Previous Pane")), + subtitle: constant(String(localized: "command.previousPane.subtitle", defaultValue: "Pane Navigation")), + keywords: ["previous", "pane", "split", "focus"], + when: { $0.bool(CommandPaletteContextKeys.hasFocusedPanel) } + ) + ) contributions.append( CommandPaletteCommandContribution( @@ -7740,6 +7758,12 @@ struct ContentView: View { registry.register(commandId: "palette.previousTabInPane") { tabManager.selectPreviousSurface() } + registry.register(commandId: "palette.nextPane") { + _ = tabManager.focusNextPane() + } + registry.register(commandId: "palette.previousPane") { + _ = tabManager.focusPreviousPane() + } registry.register(commandId: "palette.openWorkspacePullRequests") { DispatchQueue.main.async { if !openWorkspacePullRequestsInConfiguredBrowser() { diff --git a/Sources/KeyboardShortcutSettings.swift b/Sources/KeyboardShortcutSettings.swift index 81e0f422a430..e2cd5d30c730 100644 --- a/Sources/KeyboardShortcutSettings.swift +++ b/Sources/KeyboardShortcutSettings.swift @@ -110,6 +110,8 @@ enum KeyboardShortcutSettings { case attachTextBoxFile // Panes / splits + case nextPane + case prevPane case focusLeft case focusRight case focusUp @@ -193,6 +195,8 @@ enum KeyboardShortcutSettings { case .toggleTerminalCopyMode: return String(localized: "shortcut.toggleTerminalCopyMode.label", defaultValue: "Toggle Terminal Copy Mode") case .focusTextBoxInput: return String(localized: "shortcut.focusTextBoxInput.label", defaultValue: "Focus TextBox Input") case .attachTextBoxFile: return String(localized: "shortcut.attachTextBoxFile.label", defaultValue: "Attach File to TextBox Input") + case .nextPane: return String(localized: "shortcut.nextPane.label", defaultValue: "Next Pane") + case .prevPane: return String(localized: "shortcut.previousPane.label", defaultValue: "Previous Pane") case .focusLeft: return String(localized: "shortcut.focusPaneLeft.label", defaultValue: "Focus Pane Left") case .focusRight: return String(localized: "shortcut.focusPaneRight.label", defaultValue: "Focus Pane Right") case .focusUp: return String(localized: "shortcut.focusPaneUp.label", defaultValue: "Focus Pane Up") @@ -351,6 +355,10 @@ enum KeyboardShortcutSettings { return StoredShortcut(key: "a", command: true, shift: true, option: false, control: false) case .attachTextBoxFile: return StoredShortcut(key: "a", command: true, shift: true, option: true, control: false) + case .nextPane: + return StoredShortcut(key: "]", command: true, shift: false, option: true, control: true) + case .prevPane: + return StoredShortcut(key: "[", command: true, shift: false, option: true, control: true) case .selectWorkspaceByNumber: return StoredShortcut(key: "1", command: true, shift: false, option: false, control: false) case .toggleRightSidebar: @@ -868,6 +876,8 @@ enum KeyboardShortcutSettings { static func focusRightShortcut() -> StoredShortcut { shortcut(for: .focusRight) } static func focusUpShortcut() -> StoredShortcut { shortcut(for: .focusUp) } static func focusDownShortcut() -> StoredShortcut { shortcut(for: .focusDown) } + static func nextPaneShortcut() -> StoredShortcut { shortcut(for: .nextPane) } + static func prevPaneShortcut() -> StoredShortcut { shortcut(for: .prevPane) } static func splitRightShortcut() -> StoredShortcut { shortcut(for: .splitRight) } static func splitDownShortcut() -> StoredShortcut { shortcut(for: .splitDown) } diff --git a/Sources/TabManager.swift b/Sources/TabManager.swift index 42543ea1339d..e4471f9cb690 100644 --- a/Sources/TabManager.swift +++ b/Sources/TabManager.swift @@ -7339,6 +7339,18 @@ class TabManager: ObservableObject { tab.moveFocus(direction: direction) } + /// Move focus to the next pane in split-tree order. + @discardableResult + func focusNextPane() -> Bool { + selectedWorkspace?.focusNextPane() ?? false + } + + /// Move focus to the previous pane in split-tree order. + @discardableResult + func focusPreviousPane() -> Bool { + selectedWorkspace?.focusPreviousPane() ?? false + } + // MARK: - Recent Tab History Navigation private func recordTabInHistory(_ tabId: UUID) { diff --git a/Sources/Workspace.swift b/Sources/Workspace.swift index 322856d16b6f..2418044a7978 100644 --- a/Sources/Workspace.swift +++ b/Sources/Workspace.swift @@ -14194,6 +14194,40 @@ final class Workspace: Identifiable, ObservableObject { } + @discardableResult + func focusNextPane() -> Bool { + focusPane(offset: 1) + } + + @discardableResult + func focusPreviousPane() -> Bool { + focusPane(offset: -1) + } + + @discardableResult + private func focusPane(offset: Int) -> Bool { + let paneIds = bonsplitController.allPaneIds + guard paneIds.count > 1 else { return false } + + let currentPaneId = bonsplitController.focusedPaneId ?? focusedPanelId.flatMap { paneId(forPanelId: $0) } + guard let currentPaneId, + let currentIndex = paneIds.firstIndex(of: currentPaneId) else { + return false + } + + let targetIndex = (currentIndex + offset + paneIds.count) % paneIds.count + let targetPaneId = paneIds[targetIndex] + let targetTab = bonsplitController.selectedTab(inPane: targetPaneId) + ?? bonsplitController.tabs(inPane: targetPaneId).first + guard let targetTab, + let targetPanelId = panelIdFromSurfaceId(targetTab.id) else { + return false + } + + focusPanel(targetPanelId) + return true + } + // MARK: - Surface Navigation /// Select the next surface in the currently focused pane diff --git a/Sources/cmuxApp.swift b/Sources/cmuxApp.swift index 52654c8d0144..615d2eb10123 100644 --- a/Sources/cmuxApp.swift +++ b/Sources/cmuxApp.swift @@ -683,6 +683,12 @@ struct cmuxApp: App { } } Divider() + splitCommandButton(title: String(localized: "menu.view.nextPane", defaultValue: "Next Pane"), shortcut: menuShortcut(for: .nextPane)) { + _ = activeTabManager.focusNextPane() + } + splitCommandButton(title: String(localized: "menu.view.previousPane", defaultValue: "Previous Pane"), shortcut: menuShortcut(for: .prevPane)) { + _ = activeTabManager.focusPreviousPane() + } splitCommandButton(title: String(localized: "menu.view.nextSurface", defaultValue: "Next Surface"), shortcut: menuShortcut(for: .nextSurface)) { activeTabManager.selectNextSurface() } diff --git a/cmuxTests/KeyboardShortcutContextTests.swift b/cmuxTests/KeyboardShortcutContextTests.swift index 6c3d29e2deb8..b79fe13c4f82 100644 --- a/cmuxTests/KeyboardShortcutContextTests.swift +++ b/cmuxTests/KeyboardShortcutContextTests.swift @@ -141,6 +141,19 @@ final class KeyboardShortcutContextTests: XCTestCase { XCTAssertEqual(KeyboardShortcutSettings.Action.toggleReactGrab.shortcutContext, .application) } + func testPaneCycleShortcutsArePublicConfigurableActions() { + XCTAssertTrue(KeyboardShortcutSettings.publicShortcutActions.contains(.nextPane)) + XCTAssertTrue(KeyboardShortcutSettings.publicShortcutActions.contains(.prevPane)) + XCTAssertEqual( + KeyboardShortcutSettings.Action.nextPane.defaultShortcut, + StoredShortcut(key: "]", command: true, shift: false, option: true, control: true) + ) + XCTAssertEqual( + KeyboardShortcutSettings.Action.prevPane.defaultShortcut, + StoredShortcut(key: "[", command: true, shift: false, option: true, control: true) + ) + } + func testShortcutSettingsFilePreservesConfiguredShortcutWithoutGlobalConflictLookup() throws { let directoryURL = try makeTemporaryDirectory() defer { try? FileManager.default.removeItem(at: directoryURL) } diff --git a/cmuxTests/TabManagerUnitTests.swift b/cmuxTests/TabManagerUnitTests.swift index d2716228a0ee..44d039722ff0 100644 --- a/cmuxTests/TabManagerUnitTests.swift +++ b/cmuxTests/TabManagerUnitTests.swift @@ -2098,6 +2098,49 @@ final class TabManagerPendingUnfocusPolicyTests: XCTestCase { } +@MainActor +final class TabManagerPaneFocusCycleTests: XCTestCase { + func testFocusNextPaneCyclesThroughSplitTreeOrder() throws { + let manager = TabManager() + let workspace = try XCTUnwrap(manager.selectedWorkspace) + let leftPanelId = try XCTUnwrap(workspace.focusedPanelId) + let rightPanel = try XCTUnwrap( + workspace.newTerminalSplit(from: leftPanelId, orientation: .horizontal, focus: false) + ) + + workspace.focusPanel(leftPanelId) + + XCTAssertTrue(manager.focusNextPane()) + XCTAssertEqual(workspace.focusedPanelId, rightPanel.id) + + XCTAssertTrue(manager.focusNextPane()) + XCTAssertEqual(workspace.focusedPanelId, leftPanelId) + } + + func testFocusPreviousPaneWrapsToLastPane() throws { + let manager = TabManager() + let workspace = try XCTUnwrap(manager.selectedWorkspace) + let firstPanelId = try XCTUnwrap(workspace.focusedPanelId) + let lastPanel = try XCTUnwrap( + workspace.newTerminalSplit(from: firstPanelId, orientation: .horizontal, focus: false) + ) + + workspace.focusPanel(firstPanelId) + + XCTAssertTrue(manager.focusPreviousPane()) + XCTAssertEqual(workspace.focusedPanelId, lastPanel.id) + } + + func testFocusNextPaneReturnsFalseForSinglePaneWorkspace() throws { + let manager = TabManager() + let workspace = try XCTUnwrap(manager.selectedWorkspace) + let originalFocusedPanelId = workspace.focusedPanelId + + XCTAssertFalse(manager.focusNextPane()) + XCTAssertEqual(workspace.focusedPanelId, originalFocusedPanelId) + } +} + @MainActor final class TabManagerSurfaceCreationTests: XCTestCase { func testNewSurfaceFocusesCreatedSurface() { diff --git a/web/data/cmux-shortcuts.ts b/web/data/cmux-shortcuts.ts index fbab27d5bf54..faa89915baee 100644 --- a/web/data/cmux-shortcuts.ts +++ b/web/data/cmux-shortcuts.ts @@ -128,6 +128,8 @@ export const shortcutCategories: ShortcutCategory[] = [ id: "split-panes", titleKey: "splitPanes", shortcuts: [ + { id: "nextPane", combos: [["⌃", "⌥", "⌘", "]"]], description: { en: "Next pane", ja: "次のペイン" } }, + { id: "prevPane", combos: [["⌃", "⌥", "⌘", "["]], description: { en: "Previous pane", ja: "前のペイン" } }, { id: "focusLeft", combos: [["⌥", "⌘", "←"]], description: { en: "Focus pane left", ja: "左のペインにフォーカス" } }, { id: "focusRight", combos: [["⌥", "⌘", "→"]], description: { en: "Focus pane right", ja: "右のペインにフォーカス" } }, { id: "focusUp", combos: [["⌥", "⌘", "↑"]], description: { en: "Focus pane up", ja: "上のペインにフォーカス" } }, diff --git a/web/data/cmux.schema.json b/web/data/cmux.schema.json index ec6f4f7e145f..e9dd541a40c6 100644 --- a/web/data/cmux.schema.json +++ b/web/data/cmux.schema.json @@ -941,6 +941,8 @@ "toggleTerminalCopyMode", "focusTextBoxInput", "attachTextBoxFile", + "nextPane", + "prevPane", "focusLeft", "focusRight", "focusUp", From 0ccc6a738a43c271438992552a2d1ac2b004b892 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Mon, 25 May 2026 19:27:36 -0700 Subject: [PATCH 2/8] Add pane shortcut translations --- Resources/Localizable.xcstrings | 144 ++----------------- web/app/[locale]/docs/configuration/page.tsx | 2 +- web/app/[locale]/keyboard-shortcuts.tsx | 2 +- web/data/cmux-shortcuts.ts | 55 ++++++- 4 files changed, 63 insertions(+), 140 deletions(-) diff --git a/Resources/Localizable.xcstrings b/Resources/Localizable.xcstrings index 54235bc44241..2913b40ef056 100644 --- a/Resources/Localizable.xcstrings +++ b/Resources/Localizable.xcstrings @@ -24627,40 +24627,8 @@ } } }, - "command.nextPane.subtitle": { - "extractionState": "manual", - "localizations": { - "en": { - "stringUnit": { - "state": "translated", - "value": "Pane Navigation" - } - }, - "ja": { - "stringUnit": { - "state": "translated", - "value": "ペインナビゲーション" - } - } - } - }, - "command.nextPane.title": { - "extractionState": "manual", - "localizations": { - "en": { - "stringUnit": { - "state": "translated", - "value": "Next Pane" - } - }, - "ja": { - "stringUnit": { - "state": "translated", - "value": "次のペイン" - } - } - } - }, + "command.nextPane.subtitle": {"extractionState":"manual","localizations":{"ar":{"stringUnit":{"state":"translated","value":"التنقل بين اللوحات"}},"bs":{"stringUnit":{"state":"translated","value":"Navigacija panelima"}},"da":{"stringUnit":{"state":"translated","value":"Panelnavigation"}},"de":{"stringUnit":{"state":"translated","value":"Bereichsnavigation"}},"en":{"stringUnit":{"state":"translated","value":"Pane Navigation"}},"es":{"stringUnit":{"state":"translated","value":"Navegación de paneles"}},"fr":{"stringUnit":{"state":"translated","value":"Navigation entre panneaux"}},"it":{"stringUnit":{"state":"translated","value":"Navigazione pannelli"}},"ja":{"stringUnit":{"state":"translated","value":"ペインナビゲーション"}},"km":{"stringUnit":{"state":"translated","value":"ការរុករកផ្ទាំង"}},"ko":{"stringUnit":{"state":"translated","value":"패널 탐색"}},"nb":{"stringUnit":{"state":"translated","value":"Panelnavigering"}},"pl":{"stringUnit":{"state":"translated","value":"Nawigacja po panelach"}},"pt-BR":{"stringUnit":{"state":"translated","value":"Navegação de Painéis"}},"ru":{"stringUnit":{"state":"translated","value":"Навигация по панелям"}},"th":{"stringUnit":{"state":"translated","value":"การนำทางบานหน้าต่าง"}},"tr":{"stringUnit":{"state":"translated","value":"Bölme Gezinmesi"}},"uk":{"stringUnit":{"state":"translated","value":"Навігація панелями"}},"zh-Hans":{"stringUnit":{"state":"translated","value":"面板导航"}},"zh-Hant":{"stringUnit":{"state":"translated","value":"面板導覽"}}}}, + "command.nextPane.title": {"extractionState":"manual","localizations":{"ar":{"stringUnit":{"state":"translated","value":"اللوحة التالية"}},"bs":{"stringUnit":{"state":"translated","value":"Sljedeći panel"}},"da":{"stringUnit":{"state":"translated","value":"Næste panel"}},"de":{"stringUnit":{"state":"translated","value":"Nächster Bereich"}},"en":{"stringUnit":{"state":"translated","value":"Next Pane"}},"es":{"stringUnit":{"state":"translated","value":"Siguiente panel"}},"fr":{"stringUnit":{"state":"translated","value":"Panneau suivant"}},"it":{"stringUnit":{"state":"translated","value":"Pannello successivo"}},"ja":{"stringUnit":{"state":"translated","value":"次のペイン"}},"km":{"stringUnit":{"state":"translated","value":"ផ្ទាំងបន្ទាប់"}},"ko":{"stringUnit":{"state":"translated","value":"다음 패널"}},"nb":{"stringUnit":{"state":"translated","value":"Neste panel"}},"pl":{"stringUnit":{"state":"translated","value":"Następny panel"}},"pt-BR":{"stringUnit":{"state":"translated","value":"Próximo Painel"}},"ru":{"stringUnit":{"state":"translated","value":"Следующая панель"}},"th":{"stringUnit":{"state":"translated","value":"บานหน้าต่างถัดไป"}},"tr":{"stringUnit":{"state":"translated","value":"Sonraki Bölme"}},"uk":{"stringUnit":{"state":"translated","value":"Наступна панель"}},"zh-Hans":{"stringUnit":{"state":"translated","value":"下一个面板"}},"zh-Hant":{"stringUnit":{"state":"translated","value":"下一個面板"}}}}, "command.nextTabInPane.subtitle": { "extractionState": "manual", "localizations": { @@ -26050,40 +26018,8 @@ } } }, - "command.previousPane.subtitle": { - "extractionState": "manual", - "localizations": { - "en": { - "stringUnit": { - "state": "translated", - "value": "Pane Navigation" - } - }, - "ja": { - "stringUnit": { - "state": "translated", - "value": "ペインナビゲーション" - } - } - } - }, - "command.previousPane.title": { - "extractionState": "manual", - "localizations": { - "en": { - "stringUnit": { - "state": "translated", - "value": "Previous Pane" - } - }, - "ja": { - "stringUnit": { - "state": "translated", - "value": "前のペイン" - } - } - } - }, + "command.previousPane.subtitle": {"extractionState":"manual","localizations":{"ar":{"stringUnit":{"state":"translated","value":"التنقل بين اللوحات"}},"bs":{"stringUnit":{"state":"translated","value":"Navigacija panelima"}},"da":{"stringUnit":{"state":"translated","value":"Panelnavigation"}},"de":{"stringUnit":{"state":"translated","value":"Bereichsnavigation"}},"en":{"stringUnit":{"state":"translated","value":"Pane Navigation"}},"es":{"stringUnit":{"state":"translated","value":"Navegación de paneles"}},"fr":{"stringUnit":{"state":"translated","value":"Navigation entre panneaux"}},"it":{"stringUnit":{"state":"translated","value":"Navigazione pannelli"}},"ja":{"stringUnit":{"state":"translated","value":"ペインナビゲーション"}},"km":{"stringUnit":{"state":"translated","value":"ការរុករកផ្ទាំង"}},"ko":{"stringUnit":{"state":"translated","value":"패널 탐색"}},"nb":{"stringUnit":{"state":"translated","value":"Panelnavigering"}},"pl":{"stringUnit":{"state":"translated","value":"Nawigacja po panelach"}},"pt-BR":{"stringUnit":{"state":"translated","value":"Navegação de Painéis"}},"ru":{"stringUnit":{"state":"translated","value":"Навигация по панелям"}},"th":{"stringUnit":{"state":"translated","value":"การนำทางบานหน้าต่าง"}},"tr":{"stringUnit":{"state":"translated","value":"Bölme Gezinmesi"}},"uk":{"stringUnit":{"state":"translated","value":"Навігація панелями"}},"zh-Hans":{"stringUnit":{"state":"translated","value":"面板导航"}},"zh-Hant":{"stringUnit":{"state":"translated","value":"面板導覽"}}}}, + "command.previousPane.title": {"extractionState":"manual","localizations":{"ar":{"stringUnit":{"state":"translated","value":"اللوحة السابقة"}},"bs":{"stringUnit":{"state":"translated","value":"Prethodni panel"}},"da":{"stringUnit":{"state":"translated","value":"Forrige panel"}},"de":{"stringUnit":{"state":"translated","value":"Vorheriger Bereich"}},"en":{"stringUnit":{"state":"translated","value":"Previous Pane"}},"es":{"stringUnit":{"state":"translated","value":"Panel anterior"}},"fr":{"stringUnit":{"state":"translated","value":"Panneau précédent"}},"it":{"stringUnit":{"state":"translated","value":"Pannello precedente"}},"ja":{"stringUnit":{"state":"translated","value":"前のペイン"}},"km":{"stringUnit":{"state":"translated","value":"ផ្ទាំងមុន"}},"ko":{"stringUnit":{"state":"translated","value":"이전 패널"}},"nb":{"stringUnit":{"state":"translated","value":"Forrige panel"}},"pl":{"stringUnit":{"state":"translated","value":"Poprzedni panel"}},"pt-BR":{"stringUnit":{"state":"translated","value":"Painel Anterior"}},"ru":{"stringUnit":{"state":"translated","value":"Предыдущая панель"}},"th":{"stringUnit":{"state":"translated","value":"บานหน้าต่างก่อนหน้า"}},"tr":{"stringUnit":{"state":"translated","value":"Önceki Bölme"}},"uk":{"stringUnit":{"state":"translated","value":"Попередня панель"}},"zh-Hans":{"stringUnit":{"state":"translated","value":"上一个面板"}},"zh-Hant":{"stringUnit":{"state":"translated","value":"上一個面板"}}}}, "command.previousTabInPane.subtitle": { "extractionState": "manual", "localizations": { @@ -49397,23 +49333,7 @@ } } }, - "menu.view.nextPane": { - "extractionState": "manual", - "localizations": { - "en": { - "stringUnit": { - "state": "translated", - "value": "Next Pane" - } - }, - "ja": { - "stringUnit": { - "state": "translated", - "value": "次のペイン" - } - } - } - }, + "menu.view.nextPane": {"extractionState":"manual","localizations":{"ar":{"stringUnit":{"state":"translated","value":"اللوحة التالية"}},"bs":{"stringUnit":{"state":"translated","value":"Sljedeći panel"}},"da":{"stringUnit":{"state":"translated","value":"Næste panel"}},"de":{"stringUnit":{"state":"translated","value":"Nächster Bereich"}},"en":{"stringUnit":{"state":"translated","value":"Next Pane"}},"es":{"stringUnit":{"state":"translated","value":"Siguiente panel"}},"fr":{"stringUnit":{"state":"translated","value":"Panneau suivant"}},"it":{"stringUnit":{"state":"translated","value":"Pannello successivo"}},"ja":{"stringUnit":{"state":"translated","value":"次のペイン"}},"km":{"stringUnit":{"state":"translated","value":"ផ្ទាំងបន្ទាប់"}},"ko":{"stringUnit":{"state":"translated","value":"다음 패널"}},"nb":{"stringUnit":{"state":"translated","value":"Neste panel"}},"pl":{"stringUnit":{"state":"translated","value":"Następny panel"}},"pt-BR":{"stringUnit":{"state":"translated","value":"Próximo Painel"}},"ru":{"stringUnit":{"state":"translated","value":"Следующая панель"}},"th":{"stringUnit":{"state":"translated","value":"บานหน้าต่างถัดไป"}},"tr":{"stringUnit":{"state":"translated","value":"Sonraki Bölme"}},"uk":{"stringUnit":{"state":"translated","value":"Наступна панель"}},"zh-Hans":{"stringUnit":{"state":"translated","value":"下一个面板"}},"zh-Hant":{"stringUnit":{"state":"translated","value":"下一個面板"}}}}, "menu.view.nextSurface": { "extractionState": "manual", "localizations": { @@ -49652,23 +49572,7 @@ } } }, - "menu.view.previousPane": { - "extractionState": "manual", - "localizations": { - "en": { - "stringUnit": { - "state": "translated", - "value": "Previous Pane" - } - }, - "ja": { - "stringUnit": { - "state": "translated", - "value": "前のペイン" - } - } - } - }, + "menu.view.previousPane": {"extractionState":"manual","localizations":{"ar":{"stringUnit":{"state":"translated","value":"اللوحة السابقة"}},"bs":{"stringUnit":{"state":"translated","value":"Prethodni panel"}},"da":{"stringUnit":{"state":"translated","value":"Forrige panel"}},"de":{"stringUnit":{"state":"translated","value":"Vorheriger Bereich"}},"en":{"stringUnit":{"state":"translated","value":"Previous Pane"}},"es":{"stringUnit":{"state":"translated","value":"Panel anterior"}},"fr":{"stringUnit":{"state":"translated","value":"Panneau précédent"}},"it":{"stringUnit":{"state":"translated","value":"Pannello precedente"}},"ja":{"stringUnit":{"state":"translated","value":"前のペイン"}},"km":{"stringUnit":{"state":"translated","value":"ផ្ទាំងមុន"}},"ko":{"stringUnit":{"state":"translated","value":"이전 패널"}},"nb":{"stringUnit":{"state":"translated","value":"Forrige panel"}},"pl":{"stringUnit":{"state":"translated","value":"Poprzedni panel"}},"pt-BR":{"stringUnit":{"state":"translated","value":"Painel Anterior"}},"ru":{"stringUnit":{"state":"translated","value":"Предыдущая панель"}},"th":{"stringUnit":{"state":"translated","value":"บานหน้าต่างก่อนหน้า"}},"tr":{"stringUnit":{"state":"translated","value":"Önceki Bölme"}},"uk":{"stringUnit":{"state":"translated","value":"Попередня панель"}},"zh-Hans":{"stringUnit":{"state":"translated","value":"上一个面板"}},"zh-Hant":{"stringUnit":{"state":"translated","value":"上一個面板"}}}}, "menu.view.previousSurface": { "extractionState": "manual", "localizations": { @@ -87770,23 +87674,7 @@ } } }, - "shortcut.nextPane.label": { - "extractionState": "manual", - "localizations": { - "en": { - "stringUnit": { - "state": "translated", - "value": "Next Pane" - } - }, - "ja": { - "stringUnit": { - "state": "translated", - "value": "次のペイン" - } - } - } - }, + "shortcut.nextPane.label": {"extractionState":"manual","localizations":{"ar":{"stringUnit":{"state":"translated","value":"اللوحة التالية"}},"bs":{"stringUnit":{"state":"translated","value":"Sljedeći panel"}},"da":{"stringUnit":{"state":"translated","value":"Næste panel"}},"de":{"stringUnit":{"state":"translated","value":"Nächster Bereich"}},"en":{"stringUnit":{"state":"translated","value":"Next Pane"}},"es":{"stringUnit":{"state":"translated","value":"Siguiente panel"}},"fr":{"stringUnit":{"state":"translated","value":"Panneau suivant"}},"it":{"stringUnit":{"state":"translated","value":"Pannello successivo"}},"ja":{"stringUnit":{"state":"translated","value":"次のペイン"}},"km":{"stringUnit":{"state":"translated","value":"ផ្ទាំងបន្ទាប់"}},"ko":{"stringUnit":{"state":"translated","value":"다음 패널"}},"nb":{"stringUnit":{"state":"translated","value":"Neste panel"}},"pl":{"stringUnit":{"state":"translated","value":"Następny panel"}},"pt-BR":{"stringUnit":{"state":"translated","value":"Próximo Painel"}},"ru":{"stringUnit":{"state":"translated","value":"Следующая панель"}},"th":{"stringUnit":{"state":"translated","value":"บานหน้าต่างถัดไป"}},"tr":{"stringUnit":{"state":"translated","value":"Sonraki Bölme"}},"uk":{"stringUnit":{"state":"translated","value":"Наступна панель"}},"zh-Hans":{"stringUnit":{"state":"translated","value":"下一个面板"}},"zh-Hant":{"stringUnit":{"state":"translated","value":"下一個面板"}}}}, "shortcut.nextSurface.label": { "extractionState": "manual", "localizations": { @@ -88802,23 +88690,7 @@ } } }, - "shortcut.previousPane.label": { - "extractionState": "manual", - "localizations": { - "en": { - "stringUnit": { - "state": "translated", - "value": "Previous Pane" - } - }, - "ja": { - "stringUnit": { - "state": "translated", - "value": "前のペイン" - } - } - } - }, + "shortcut.previousPane.label": {"extractionState":"manual","localizations":{"ar":{"stringUnit":{"state":"translated","value":"اللوحة السابقة"}},"bs":{"stringUnit":{"state":"translated","value":"Prethodni panel"}},"da":{"stringUnit":{"state":"translated","value":"Forrige panel"}},"de":{"stringUnit":{"state":"translated","value":"Vorheriger Bereich"}},"en":{"stringUnit":{"state":"translated","value":"Previous Pane"}},"es":{"stringUnit":{"state":"translated","value":"Panel anterior"}},"fr":{"stringUnit":{"state":"translated","value":"Panneau précédent"}},"it":{"stringUnit":{"state":"translated","value":"Pannello precedente"}},"ja":{"stringUnit":{"state":"translated","value":"前のペイン"}},"km":{"stringUnit":{"state":"translated","value":"ផ្ទាំងមុន"}},"ko":{"stringUnit":{"state":"translated","value":"이전 패널"}},"nb":{"stringUnit":{"state":"translated","value":"Forrige panel"}},"pl":{"stringUnit":{"state":"translated","value":"Poprzedni panel"}},"pt-BR":{"stringUnit":{"state":"translated","value":"Painel Anterior"}},"ru":{"stringUnit":{"state":"translated","value":"Предыдущая панель"}},"th":{"stringUnit":{"state":"translated","value":"บานหน้าต่างก่อนหน้า"}},"tr":{"stringUnit":{"state":"translated","value":"Önceki Bölme"}},"uk":{"stringUnit":{"state":"translated","value":"Попередня панель"}},"zh-Hans":{"stringUnit":{"state":"translated","value":"上一个面板"}},"zh-Hant":{"stringUnit":{"state":"translated","value":"上一個面板"}}}}, "shortcut.previousSurface.label": { "extractionState": "manual", "localizations": { diff --git a/web/app/[locale]/docs/configuration/page.tsx b/web/app/[locale]/docs/configuration/page.tsx index 513efe27f742..6ea24d6e7fba 100644 --- a/web/app/[locale]/docs/configuration/page.tsx +++ b/web/app/[locale]/docs/configuration/page.tsx @@ -109,7 +109,7 @@ export async function generateMetadata({ params }: { params: Promise<{ locale: s } function localizedText(text: LocalizedText, locale: string) { - return locale.startsWith("ja") ? text.ja : text.en; + return text[locale] ?? (locale.startsWith("ja") ? text.ja : text.en); } function shortcutComboToConfig(combo: string[]) { diff --git a/web/app/[locale]/keyboard-shortcuts.tsx b/web/app/[locale]/keyboard-shortcuts.tsx index 6072d4e037f7..09eacfbae811 100644 --- a/web/app/[locale]/keyboard-shortcuts.tsx +++ b/web/app/[locale]/keyboard-shortcuts.tsx @@ -5,7 +5,7 @@ import { useLocale, useTranslations } from "next-intl"; import { shortcutCategories, type LocalizedText, type Shortcut } from "../../data/cmux-shortcuts"; function localizedText(text: LocalizedText, locale: string) { - return locale.startsWith("ja") ? text.ja : text.en; + return text[locale] ?? (locale.startsWith("ja") ? text.ja : text.en); } function normalize(s: string) { diff --git a/web/data/cmux-shortcuts.ts b/web/data/cmux-shortcuts.ts index faa89915baee..57703a387448 100644 --- a/web/data/cmux-shortcuts.ts +++ b/web/data/cmux-shortcuts.ts @@ -1,6 +1,7 @@ export type LocalizedText = { en: string; ja: string; + [locale: string]: string; }; export type Shortcut = { @@ -128,8 +129,58 @@ export const shortcutCategories: ShortcutCategory[] = [ id: "split-panes", titleKey: "splitPanes", shortcuts: [ - { id: "nextPane", combos: [["⌃", "⌥", "⌘", "]"]], description: { en: "Next pane", ja: "次のペイン" } }, - { id: "prevPane", combos: [["⌃", "⌥", "⌘", "["]], description: { en: "Previous pane", ja: "前のペイン" } }, + { + id: "nextPane", + combos: [["⌃", "⌥", "⌘", "]"]], + description: { + ar: "اللوحة التالية", + bs: "Sljedeći panel", + da: "Næste panel", + de: "Nächster Bereich", + en: "Next pane", + es: "Siguiente panel", + fr: "Panneau suivant", + it: "Pannello successivo", + ja: "次のペイン", + km: "ផ្ទាំងបន្ទាប់", + ko: "다음 패널", + no: "Neste panel", + pl: "Następny panel", + "pt-BR": "Próximo painel", + ru: "Следующая панель", + th: "บานหน้าต่างถัดไป", + tr: "Sonraki bölme", + uk: "Наступна панель", + "zh-CN": "下一个面板", + "zh-TW": "下一個面板", + }, + }, + { + id: "prevPane", + combos: [["⌃", "⌥", "⌘", "["]], + description: { + ar: "اللوحة السابقة", + bs: "Prethodni panel", + da: "Forrige panel", + de: "Vorheriger Bereich", + en: "Previous pane", + es: "Panel anterior", + fr: "Panneau précédent", + it: "Pannello precedente", + ja: "前のペイン", + km: "ផ្ទាំងមុន", + ko: "이전 패널", + no: "Forrige panel", + pl: "Poprzedni panel", + "pt-BR": "Painel anterior", + ru: "Предыдущая панель", + th: "บานหน้าต่างก่อนหน้า", + tr: "Önceki bölme", + uk: "Попередня панель", + "zh-CN": "上一个面板", + "zh-TW": "上一個面板", + }, + }, { id: "focusLeft", combos: [["⌥", "⌘", "←"]], description: { en: "Focus pane left", ja: "左のペインにフォーカス" } }, { id: "focusRight", combos: [["⌥", "⌘", "→"]], description: { en: "Focus pane right", ja: "右のペインにフォーカス" } }, { id: "focusUp", combos: [["⌥", "⌘", "↑"]], description: { en: "Focus pane up", ja: "上のペインにフォーカス" } }, From caca4e14ee23c72b1b2d6bea96990baf59efc06d Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Mon, 25 May 2026 19:56:58 -0700 Subject: [PATCH 3/8] Remove unreachable pane focus fallback --- Sources/Workspace.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/Workspace.swift b/Sources/Workspace.swift index 2418044a7978..c7efc3d953ec 100644 --- a/Sources/Workspace.swift +++ b/Sources/Workspace.swift @@ -14209,8 +14209,7 @@ final class Workspace: Identifiable, ObservableObject { let paneIds = bonsplitController.allPaneIds guard paneIds.count > 1 else { return false } - let currentPaneId = bonsplitController.focusedPaneId ?? focusedPanelId.flatMap { paneId(forPanelId: $0) } - guard let currentPaneId, + guard let currentPaneId = bonsplitController.focusedPaneId, let currentIndex = paneIds.firstIndex(of: currentPaneId) else { return false } From ccc06d37bf40f38031dcabf151e4715e2f8f03d6 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Sat, 6 Jun 2026 02:16:47 -0700 Subject: [PATCH 4/8] fix: preserve find selection when cycling panes --- Sources/AppDelegate.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Sources/AppDelegate.swift b/Sources/AppDelegate.swift index 67bfb1d81544..5e3872e83d59 100644 --- a/Sources/AppDelegate.swift +++ b/Sources/AppDelegate.swift @@ -13060,12 +13060,18 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent // Pane cycling: focus the next/previous split pane in stable split-tree order. if matchConfiguredShortcut(event: event, action: .nextPane) { - let targetManager = preferredMainWindowContextForShortcutRouting(event: event)?.tabManager ?? tabManager + let targetContext = preferredMainWindowContextForShortcutRouting(event: event) + let targetManager = targetContext?.tabManager ?? tabManager + let targetWindow = targetContext.flatMap { $0.window ?? windowForMainWindowId($0.windowId) } ?? NSApp.keyWindow + cmuxRememberFindSelectionBeforePanelFocusMove(tabManager: targetManager, window: targetWindow) _ = targetManager?.focusNextPane() return true } if matchConfiguredShortcut(event: event, action: .prevPane) { - let targetManager = preferredMainWindowContextForShortcutRouting(event: event)?.tabManager ?? tabManager + let targetContext = preferredMainWindowContextForShortcutRouting(event: event) + let targetManager = targetContext?.tabManager ?? tabManager + let targetWindow = targetContext.flatMap { $0.window ?? windowForMainWindowId($0.windowId) } ?? NSApp.keyWindow + cmuxRememberFindSelectionBeforePanelFocusMove(tabManager: targetManager, window: targetWindow) _ = targetManager?.focusPreviousPane() return true } From 6b43feb1bbb031ae7a43e9c29eae99600c448d4b Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Sat, 6 Jun 2026 02:23:55 -0700 Subject: [PATCH 5/8] fix: keep pane cycling within zoomed pane --- Sources/Workspace.swift | 15 +++++++++++++-- cmuxTests/TabManagerUnitTests.swift | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Sources/Workspace.swift b/Sources/Workspace.swift index 23fa6e8a3658..126b944ebfff 100644 --- a/Sources/Workspace.swift +++ b/Sources/Workspace.swift @@ -16504,6 +16504,12 @@ final class Workspace: Identifiable, ObservableObject { @discardableResult private func focusPane(offset: Int) -> Bool { + if let zoomedPaneId = bonsplitController.zoomedPaneId { + guard bonsplitController.allPaneIds.contains(zoomedPaneId) else { return false } + guard bonsplitController.focusedPaneId != zoomedPaneId else { return false } + return focusSelectedPanel(inPane: zoomedPaneId) + } + let paneIds = bonsplitController.allPaneIds guard paneIds.count > 1 else { return false } @@ -16514,8 +16520,13 @@ final class Workspace: Identifiable, ObservableObject { let targetIndex = (currentIndex + offset + paneIds.count) % paneIds.count let targetPaneId = paneIds[targetIndex] - let targetTab = bonsplitController.selectedTab(inPane: targetPaneId) - ?? bonsplitController.tabs(inPane: targetPaneId).first + return focusSelectedPanel(inPane: targetPaneId) + } + + @discardableResult + private func focusSelectedPanel(inPane paneId: PaneID) -> Bool { + let targetTab = bonsplitController.selectedTab(inPane: paneId) + ?? bonsplitController.tabs(inPane: paneId).first guard let targetTab, let targetPanelId = panelIdFromSurfaceId(targetTab.id) else { return false diff --git a/cmuxTests/TabManagerUnitTests.swift b/cmuxTests/TabManagerUnitTests.swift index f5e83b96301d..d34e3560aa0a 100644 --- a/cmuxTests/TabManagerUnitTests.swift +++ b/cmuxTests/TabManagerUnitTests.swift @@ -2241,6 +2241,26 @@ final class TabManagerPaneFocusCycleTests: XCTestCase { XCTAssertFalse(manager.focusNextPane()) XCTAssertEqual(workspace.focusedPanelId, originalFocusedPanelId) } + + func testFocusPaneCycleDoesNotLeaveZoomedPane() throws { + let manager = TabManager() + let workspace = try XCTUnwrap(manager.selectedWorkspace) + let leftPanelId = try XCTUnwrap(workspace.focusedPanelId) + let rightPanel = try XCTUnwrap( + workspace.newTerminalSplit(from: leftPanelId, orientation: .horizontal, focus: false) + ) + + workspace.focusPanel(leftPanelId) + XCTAssertTrue(workspace.toggleSplitZoom(panelId: leftPanelId)) + + XCTAssertFalse(manager.focusNextPane()) + XCTAssertEqual(workspace.focusedPanelId, leftPanelId) + XCTAssertNotEqual(workspace.focusedPanelId, rightPanel.id) + + XCTAssertFalse(manager.focusPreviousPane()) + XCTAssertEqual(workspace.focusedPanelId, leftPanelId) + XCTAssertNotEqual(workspace.focusedPanelId, rightPanel.id) + } } @MainActor From 399128f0c1eae7a08c7af939bef0b3f7bd7603b5 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Sun, 14 Jun 2026 13:14:27 -0700 Subject: [PATCH 6/8] chore: refresh Swift file length budget --- .github/swift-file-length-budget.tsv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/swift-file-length-budget.tsv b/.github/swift-file-length-budget.tsv index 0cb8b0dddfef..8015f338234b 100644 --- a/.github/swift-file-length-budget.tsv +++ b/.github/swift-file-length-budget.tsv @@ -3,7 +3,7 @@ # Reduce counts as files shrink. CI fails if tracked files exceed this budget. 33857 CLI/cmux.swift 17932 Sources/AppDelegate.swift -16764 Sources/ContentView.swift +16733 Sources/ContentView.swift 14612 Sources/TerminalController.swift 13595 Sources/Panels/BrowserPanel.swift 12088 Sources/GhosttyTerminalView.swift @@ -13,8 +13,8 @@ 7911 Sources/Panels/BrowserPanelView.swift 7350 cmuxTests/WorkspaceUnitTests.swift 6944 cmuxTests/WorkspaceRemoteConnectionTests.swift +6363 cmuxTests/GhosttyConfigTests.swift 6317 cmuxTests/SessionPersistenceTests.swift -6299 cmuxTests/GhosttyConfigTests.swift 6153 CLI/cmux_open.swift 6086 Sources/TabManager.swift 6074 Sources/TextBoxInput.swift From f1ecccea0bb2d8c95a953eb85774a7c884643b2b Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Sun, 14 Jun 2026 13:47:34 -0700 Subject: [PATCH 7/8] fix: expose pane cycle shortcuts in settings --- .../Values/ShortcutAction+Defaults.swift | 2 ++ .../CmuxSettings/Values/ShortcutAction.swift | 11 ++++++++-- cmuxTests/KeyboardShortcutContextTests.swift | 21 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction+Defaults.swift b/Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction+Defaults.swift index 70037d0be683..a8678c275b37 100644 --- a/Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction+Defaults.swift +++ b/Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction+Defaults.swift @@ -66,6 +66,8 @@ extension ShortcutAction { case .groupSelectedWorkspaces: return ShortcutStroke(key: "g", command: true, shift: true) case .toggleFocusedWorkspaceGroupCollapsed: return ShortcutStroke(key: ".", command: true, control: true) case .reopenClosedBrowserPanel: return ShortcutStroke(key: "t", command: true, shift: true) + case .nextPane: return ShortcutStroke(key: "]", command: true, option: true, control: true) + case .prevPane: return ShortcutStroke(key: "[", command: true, option: true, control: true) case .focusLeft: return ShortcutStroke(key: "←", command: true, option: true) case .focusRight: return ShortcutStroke(key: "→", command: true, option: true) case .focusUp: return ShortcutStroke(key: "↑", command: true, option: true) diff --git a/Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift b/Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift index 50fa11b58056..758d9404a1d1 100644 --- a/Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift +++ b/Packages/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift @@ -72,6 +72,8 @@ public enum ShortcutAction: String, CaseIterable, Sendable, Hashable, SettingCod case sendCtrlFToTerminal // MARK: Panes + case nextPane + case prevPane case focusLeft case focusRight case focusUp @@ -178,8 +180,9 @@ extension ShortcutAction { .reopenClosedBrowserPanel, .newSurface, .toggleTerminalCopyMode, .focusTextBoxInput, .attachTextBoxFile, .sendCtrlFToTerminal: return .navigation - case .focusLeft, .focusRight, .focusUp, .focusDown, .splitRight, .splitDown, - .toggleSplitZoom, .equalizeSplits, .splitBrowserRight, .splitBrowserDown, + case .nextPane, .prevPane, .focusLeft, .focusRight, .focusUp, .focusDown, + .splitRight, .splitDown, .toggleSplitZoom, .equalizeSplits, + .splitBrowserRight, .splitBrowserDown, .toggleRightSidebar, .toggleCanvasLayout, .canvasRevealFocusedPane, .canvasOverview, .canvasZoomIn, .canvasZoomOut, .canvasZoomReset, .canvasTidy, @@ -345,6 +348,10 @@ extension ShortcutAction { case .attachTextBoxFile: return "Attach File to TextBox Input" case .sendCtrlFToTerminal: return String(localized: "shortcut.sendCtrlFToTerminal.label", defaultValue: "Send Ctrl-F to Terminal") + case .nextPane: + return String(localized: "shortcut.nextPane.label", defaultValue: "Next Pane") + case .prevPane: + return String(localized: "shortcut.previousPane.label", defaultValue: "Previous Pane") case .focusLeft: return "Focus Pane Left" case .focusRight: return "Focus Pane Right" case .focusUp: return "Focus Pane Up" diff --git a/cmuxTests/KeyboardShortcutContextTests.swift b/cmuxTests/KeyboardShortcutContextTests.swift index ec7582e14f90..4efb570a2933 100644 --- a/cmuxTests/KeyboardShortcutContextTests.swift +++ b/cmuxTests/KeyboardShortcutContextTests.swift @@ -163,6 +163,27 @@ final class KeyboardShortcutContextTests: XCTestCase { KeyboardShortcutSettings.Action.prevPane.defaultShortcut, StoredShortcut(key: "[", command: true, shift: false, option: true, control: true) ) + XCTAssertEqual( + ShortcutAction.nextPane.defaultStroke, + ShortcutStroke(key: "]", command: true, option: true, control: true) + ) + XCTAssertEqual( + ShortcutAction.prevPane.defaultStroke, + ShortcutStroke(key: "[", command: true, option: true, control: true) + ) + XCTAssertEqual(ShortcutAction.nextPane.displayName, KeyboardShortcutSettings.Action.nextPane.label) + XCTAssertEqual(ShortcutAction.prevPane.displayName, KeyboardShortcutSettings.Action.prevPane.label) + } + + func testPublicShortcutActionsHaveSettingsPackageCounterparts() { + let missingActions = KeyboardShortcutSettings.publicShortcutActions + .filter { ShortcutAction(rawValue: $0.rawValue) == nil } + .map(\.rawValue) + + XCTAssertTrue( + missingActions.isEmpty, + "Missing CmuxSettings.ShortcutAction cases: \(missingActions.joined(separator: ", "))" + ) } func testBrowserFocusModeToggleIsBrowserScopedAndDoesNotCollideWithSplitZoom() { From 718884440d5ca38b0e560160346d669cbc9deda0 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Sun, 14 Jun 2026 14:07:37 -0700 Subject: [PATCH 8/8] chore: refresh shortcut test file length budget --- .github/swift-file-length-budget.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/swift-file-length-budget.tsv b/.github/swift-file-length-budget.tsv index 8015f338234b..6f5bd6d82d61 100644 --- a/.github/swift-file-length-budget.tsv +++ b/.github/swift-file-length-budget.tsv @@ -119,13 +119,13 @@ 738 Packages/CMUXProjectModel/Sources/CMUXProjectModel/XcodeProjectAdapter.swift 736 Packages/CmuxAuthRuntime/Sources/CmuxAuthRuntime/Coordinator/AuthCoordinator.swift 726 cmuxTests/CLICodexHookTimeoutRegressionTests.swift +722 cmuxTests/KeyboardShortcutContextTests.swift 716 Sources/TaskManagerSnapshot.swift 715 Packages/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+Input.swift 715 Sources/AppleScriptSupport.swift 710 Sources/TerminalSSHSessionDetector.swift 707 CLI/CMUXCLI+AgentHookDefinitions.swift 706 CLI/CMUXCLI+Config.swift -701 cmuxTests/KeyboardShortcutContextTests.swift 699 Sources/RightSidebarPanelView.swift 699 cmuxTests/TerminalNotificationClearAllTests.swift 698 cmuxTests/RestorableAgentHookProviderResumeTests.swift