native macOS codings agent orchestrator
6
fork

Configure Feed

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

Merge pull request #203 from onevcat/fix/canvas-split-occlusion-freeze

Fix canvas split pane rendering freeze

authored by

Wei Wang and committed by
GitHub
f350ac30 8e4b4cfa

+21 -1
+12 -1
supacode/Features/Canvas/Views/CanvasView.swift
··· 644 644 645 645 let activeStates = terminalManager.activeWorktreeStates 646 646 647 + // Mark all states as canvas-managed so that tree updates (e.g. split 648 + // creation) don't trigger applySurfaceActivity with stale normal-mode 649 + // window visibility, which would occlude every surface. 650 + for state in activeStates { 651 + state.isCanvasManaged = true 652 + } 653 + 647 654 // Auto-focus the card that was active before entering canvas. 648 655 if let selectedID = terminalManager.selectedWorktreeID, 649 656 let state = activeStates.first(where: { $0.worktreeID == selectedID }), ··· 670 677 } 671 678 672 679 private func deactivateCanvas() { 673 - clearBroadcastCallbacks(states: terminalManager.activeWorktreeStates) 680 + let activeStates = terminalManager.activeWorktreeStates 681 + for state in activeStates { 682 + state.isCanvasManaged = false 683 + } 684 + clearBroadcastCallbacks(states: activeStates) 674 685 selectionState.clear() 675 686 // Don't occlude surfaces here. In SwiftUI's if/else view swap, 676 687 // onAppear fires before onDisappear, so occluding here would undo
+9
supacode/Features/Terminal/Models/WorktreeTerminalState.swift
··· 32 32 private var lastEmittedFocusSurfaceId: UUID? 33 33 private var lastWindowIsKey: Bool? 34 34 private var lastWindowIsVisible: Bool? 35 + /// When `true`, Canvas owns occlusion management for this state's surfaces. 36 + /// `syncFocusIfNeeded` skips `applySurfaceActivity` to avoid overriding 37 + /// Canvas-set occlusion with stale normal-mode window activity values. 38 + var isCanvasManaged = false 35 39 var notifications: [WorktreeTerminalNotification] = [] 36 40 var notificationsEnabled = true 37 41 private var commandFinishedNotificationEnabled = true ··· 497 501 direction: mapSplitDirection(direction) 498 502 ) 499 503 updateTree(newTree, for: tabId) 504 + // Canvas manages occlusion directly; ensure the new pane renders. 505 + if isCanvasManaged { 506 + newSurface.setOcclusion(true) 507 + } 500 508 focusSurface(newSurface, in: tabId) 501 509 return true 502 510 } catch { ··· 1320 1328 } 1321 1329 1322 1330 private func syncFocusIfNeeded() { 1331 + guard !isCanvasManaged else { return } 1323 1332 guard lastWindowIsKey != nil, lastWindowIsVisible != nil else { return } 1324 1333 applySurfaceActivity() 1325 1334 }