Resync terminal portals after sidebar changes (#1253)

* Add regression test for portal ancestor shifts

* Resync terminal portals after sidebar changes

* Restore safeHelp view helper

* Fix portal geometry regression test harness
This commit is contained in:
Lawrence Chen 2026-03-12 02:46:30 -07:00 committed by GitHub
parent 292359f600
commit 8d5a1f611d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 100 additions and 1 deletions

View file

@ -2591,10 +2591,14 @@ struct ContentView: View {
if abs(sidebarState.persistedWidth - sanitized) > 0.5 {
sidebarState.persistedWidth = sanitized
}
// Sidebar width changes are pure SwiftUI layout updates, so portal-hosted
// terminals need an explicit post-layout geometry resync.
TerminalWindowPortalRegistry.scheduleExternalGeometrySynchronizeForAllWindows()
updateSidebarResizerBandState()
})
view = AnyView(view.onChange(of: sidebarState.isVisible) { _ in
TerminalWindowPortalRegistry.scheduleExternalGeometrySynchronizeForAllWindows()
updateSidebarResizerBandState()
})