···467467468468 private func deactivateCanvas() {
469469 focusedTabID = nil
470470- for state in terminalManager.activeWorktreeStates {
471471- for tab in state.tabManager.tabs {
472472- for surface in state.splitTree(for: tab.id).leaves() {
473473- surface.setOcclusion(false)
474474- surface.focusDidChange(false)
475475- }
476476- }
477477- }
470470+ // Don't occlude surfaces here. In SwiftUI's if/else view swap,
471471+ // onAppear fires before onDisappear, so occluding here would undo
472472+ // WorktreeTerminalTabsView.onAppear's syncFocus() and cause blank
473473+ // surfaces. Cleanup of non-selected worktrees is handled by
474474+ // setSelectedWorktreeID in the async exit flow.
478475 }
479476}
480477