fix(cmux-next): move focus after closing a tab group

Merged
TE
20d ago
+16-0

Problem

Closing a selected tab group waits for the daemon tree delta before changing selection. During that interval the pane still presents a tab that is already closing, unlike browser-style close behavior.

Change

Before issuing close-tab-group, select the next surviving tab using the existing FocusAfterClose.tab policy when the selected tab belongs to the group. The daemon remains authoritative for the eventual tree update.

Validation

  • swiftc -parse Packages/macOS/CmuxNext/Sources/CmuxNextApp/Handlers/TabGroupHandlers.swift — passed.
  • git diff --check — passed.
  • Full Swift package test build was started but canceled during dependency compilation before test execution; no failure observed.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Moves focus immediately when closing a tab group so the pane no longer lingers on a tab that is already closing.

Previously, closing a selected tab group waited for the daemon tree delta before changing selection. Now the next surviving tab is selected using the existing FocusAfterClose.tab policy before the close request is sent, when the selected tab belongs to the group, skipping tabs in collapsed groups. The daemon remains authoritative for the eventual tree update.