Repository navigation
fix(focus): pin CCmuxAppFFI to #30356's release: a sidebar AppKit picks never takes a restored terminal's keyboard (REOPEN-F4, F5) - #31684
Conversation
…d never takes the restored terminal (REOPEN-F4, red on the stale CCmuxAppFFI pin) The Swift side of #30356: the app links cmux-focus-core only through the pinned CCmuxAppFFI (ae1499a), which predates the rule. On the feat tip, 10 of 15 Cmd-Q keep + reopen cycles on cmux21 lost the first key: the journal shows 'responder sidebar, programmatic' 41-55 ms after the window became key, and the focus then stayed on the sidebar.
…e): a sidebar AppKit picks never takes a restored terminal's keyboard (REOPEN-F4, REOPEN-F5) check-app-ffi-pin.sh failed on every feat-cmux-next push since #30356 changed cmux-focus-core: app-ffi-release published cmux-app-ffi-382e54b7 (2026-11-01 07:40Z), and its bot repin #26434 stayed red on base reds of that day. HEAD's FFI sources match 382e54b; --verify-release passes. With the stale pin the app never got #30356's rule: at a relaunch AppKit makes the sidebar list the first key view before the restored pane's surface shows, and the focus stayed on the sidebar. The first key after a Cmd-Q keep + reopen was lost in 10 of 15 cycles (REOPEN-F4), and the line typed after a kill-all reopen never reached the shell (REOPEN-F5).
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
|
Found 2 test failures on Blacksmith runners: Failures
|
|
Review (reopen-f4-reviewer-pr1): SHIP at 124b668 Independent correctness review. I read the code. I did not compile or run Swift or Rust on this machine. The fleet red/green results are pending; this verdict does not include them. What I checked:
Non-blocking notes:
|
|
Non-green checks at this head, classified (agent reopen-f4): tooling-tests (Developer ID and stub tests) and nightly-guards release-notary (whats-new/test_digest.py) fail in files this PR does not touch; the independent review (comment 6568309608) found them red on unrelated PRs too, so they are base findings. cmux-tui steps fail on the stale cmux-tui/Cargo.lock of #31462 (fix #31654/#31697). This PR changes only Package.swift's CCmuxAppFFI pin and one test file. |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
After a relaunch, the first key a person types into the restored terminal can go to the sidebar list instead. On the feat tip (d3feb066), 10 of 15 Cmd-Q keep + reopen cycles on cmux21 lost the first key (REOPEN-F4, STATUS 4618). After a kill-all reopen, the line typed about 2 s after the terminals settled never reached the shell in 2 of 3 runs (REOPEN-F5).
The cause: the restored window comes forward before its focused terminal's surface is shown, and AppKit makes the sidebar list its first key view. The input journal of every lost cycle shows
responder sidebar, programmatic41-55 ms after the window became key. Then the focus stays on the sidebar (keyboard: false): the latercontentPresentedandrestoredPaneevents do not move it back.#30356 fixed this rule in cmux-focus-core: a sidebar responder the platform picks never takes a pane's keyboard. But the app links the reducer only through the pinned CCmuxAppFFI, and the pin (ae1499a) is older than #30356. The release
cmux-app-ffi-382e54b7exists (2026-11-01 07:40Z). Its bot repin #26434 stayed red because of base reds of that day (ActionCatalog counts, generated action surfaces, an xcstrings plural error), not because of the pin. Soscripts/cmux-next/check-app-ffi-pin.shhas been red on every feat push since 382e54b.This PR pins CCmuxAppFFI to
cmux-app-ffi-382e54b7(the change from #26434, on today's base) and adds the Swift tests that #30356 left for its PR 2. It supersedes #26434.check-app-ffi-pin.sh --verify-releasepasses at the head. The only FFI input change since the old pin is #30356 itself.Why the dogfood line passes (lead question, STATUS 4872): it has its own fix of the same fault, 99c70f7 (perf/chrome-parity, 2026-10-27,
ShellWindow.refusesOrderInKeyView: AppKit's first-key-view pick is refused while a window is ordered in). That commit was never ported to feat. Feat fixed the fault its own way in #30356, which this PR finally brings into the app. So no feat commit broke a working path: the feat app never had either fix.The other half of REOPEN-F4 is a key typed before the focused terminal's surface exists (the panes show in hash order, one new surface per frame). That half goes in a second PR: the focused pane is presented first, and a key for a focused terminal with no surface yet waits for it (the 1193 hold).
Testing
Regression tests,
WindowFocusRestoreTests(CmuxNextAppTests):theSidebarAppKitPicksAsARestoredWindowComesForwardNeverTakesTheRestoredTerminal: the journal's order of a lost cycle (restored record, topology, window key, programmatic sidebar responder,contentPresented). The focus must stay on the restored terminal. A mouse click on the sidebar must still move the focus there.aKillAllReopenWithAHomeColumnKeepsTheTerminalFocusedLongAfterItsSurfaceShows: the F5 shape (Home page column + one terminal). After the same events the focus and the published context must stay on the terminal.Fleet runs (
scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNextwithWindowFocusRestoreTestsnamed 5 times, throughproof-step.py). The refs carry the cmux-tui/Cargo.lock of base-red fix #31654 on top (proof only; the stale lock of #31462 stops every cmux-tui build on the base):cmux-next swift testred at the base-merge head adbd64a is a base finding: on the fleet, SidebarRenameInPlaceTests, NewTabHoldCancellationTests and SSHRecoveryShotsTests fail 3 of 3 at this head (job 15cb5f66ea83c91c8b30c23d) and 3 of 3 at its feat parent f6036b4 (job 3789d04de3a2f758a4aad1df); ToolbarButtonsStateTests passes 3 of 3 at both (a load timing in CI).Observed / Not run
/work/tmp/reopen-video/rounds/r2-feat-marks-quit-keep-hid-light/(kitcp/reopen-video-kit@d76e5b72c7a): lost iffresponder sidebar, programmaticcame before the key (10 of 15), kept iff the focused pane showed first (5 of 15).check-app-ffi-pin.sh --verify-releasepasses at the head.prepush-gate.py: no new violations.Changelog
Fixed: After cmux reopens, typing goes to the restored terminal instead of the sidebar
Proof
No capture: a focus routing fix with no visual change; the proof is the test runs and the reopen journey.