test: keep Chief Home out of the Option-digit routing suite's windows (main red)
Summary
Fixes a red on main: AppDelegateOptionDigitShortcutRoutingTests fails fileConfiguredOptionOnlyArrowBindingsRouteBeforeTerminalFallback and terminalKeyEquivalentRoutesActiveOptionDigitWorkspaceShortcut (main CI https://github.com/manaflow-ai/cmux/actions/runs/41756939544, focused run on 0ad82b81590 https://github.com/manaflow-ai/cmux/actions/runs/41786859413). It blocks https://github.com/manaflow-ai/cmux/pull/19082.
Root cause
Chief Home (https://github.com/manaflow-ai/cmux/pull/21287, 2026-10-20) is on by default (chief.enabled defaults to true). Each new main window's ContentView.onAppear calls ChiefHomeNavigation.restoreConversations ā ensureHome, which adds a pinned Home workspace group and moves it to index 0.
Both failing tests do manager.addTab(select: false) and then manager.selectTab(at: 0), expecting index 0 to be the window's initial terminal workspace. Index 0 is now Chief Home, so:
- the initial workspace's terminal is hidden and never takes first responder (
isSurfaceViewFirstResponder()fails), and - Option+Down/Up move from Home, so the selection lands on the wrong workspaces (the CI log shows a third workspace id, Home, after Option+Up wraps).
The product behavior is intentional; the tests are stale. Assertions are unchanged.
Fix
The suite's withIsolatedShortcutRoutingState wrapper now disables Chief for the duration of each test and restores the prior value afterwards, the same pattern WorkspaceGroupNumberedSelectionTests already uses. The tests are about shortcut routing, not Chief Home.
Related: https://github.com/manaflow-ai/cmux/pull/27251 changes the same two tests' focus setup to focusTerminalForTesting as part of an unrelated feature; that does not change which workspace selectTab(at: 0) selects.
Testing
- Focused app-host run of
cmuxTests/AppDelegateOptionDigitShortcutRoutingTestson this head: link in a comment once complete.
š¤ Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith Ā· Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes two failing tests in AppDelegateOptionDigitShortcutRoutingTests: Chief Home (on by default) adds a pinned Home workspace at index 0 of every new main window, so the tests' selectTab(at: 0) selected Home instead of the initial terminal workspace, breaking routing and focus assertions.
Disables Chief within the test suite's isolation wrapper and restores the prior setting afterward, matching the pattern WorkspaceGroupNumberedSelectionTests already uses. The import is scoped to ChiefCatalogSection so StoredShortcut stays unambiguous. Product behavior is intentional; test assertions are unchanged.
Summary by CodeRabbit
- Tests
- Improved shortcut-routing test isolation by ensuring the Chief Home setting does not affect test results. The setting is restored to its previous value after the tests run, or remains unset if it was unset before. These changes affect test reliability only and do not change user-facing behavior.