native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #42 from onevcat/fix/canvas-exit-blank-surface

Fix blank surface when exiting canvas via toggle shortcut

authored by

Wei Wang and committed by
GitHub
09316b8a ea6bb98d

+10 -8
+5 -8
supacode/Features/Canvas/Views/CanvasView.swift
··· 467 467 468 468 private func deactivateCanvas() { 469 469 focusedTabID = nil 470 - for state in terminalManager.activeWorktreeStates { 471 - for tab in state.tabManager.tabs { 472 - for surface in state.splitTree(for: tab.id).leaves() { 473 - surface.setOcclusion(false) 474 - surface.focusDidChange(false) 475 - } 476 - } 477 - } 470 + // Don't occlude surfaces here. In SwiftUI's if/else view swap, 471 + // onAppear fires before onDisappear, so occluding here would undo 472 + // WorktreeTerminalTabsView.onAppear's syncFocus() and cause blank 473 + // surfaces. Cleanup of non-selected worktrees is handled by 474 + // setSelectedWorktreeID in the async exit flow. 478 475 } 479 476 } 480 477
+5
supacode/Features/Terminal/BusinessLogic/WorktreeTerminalManager.swift
··· 115 115 guard id != selectedWorktreeID else { return } 116 116 if let previousID = selectedWorktreeID, let previousState = states[previousID] { 117 117 previousState.setAllSurfacesOccluded() 118 + } else if selectedWorktreeID == nil { 119 + // Leaving canvas mode: occlude all worktrees except the newly selected one. 120 + for (wid, state) in states where wid != id { 121 + state.setAllSurfacesOccluded() 122 + } 118 123 } 119 124 selectedWorktreeID = id 120 125 terminalLogger.info("Selected worktree \(id ?? "nil")")