SPB Git

spb/zyquo-atlas

Public License

The AI-native macOS web browser — every surface, intelligent.

fix: content area observes the active tab so it switches start-page → web reactively on load/navigate (post-Phase-4 regression)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
simon-pierre boucher committed (Jul 31, 2026) parent 16f9769 Browse files

1 changed file +20 −13

Unified Split
modified Sources/ZyquoAtlas/Views/Browser/BrowserWindowView.swift +20 −13
@@ -94,7 +94,11 @@ struct BrowserWindowView: View {
94 FindBarView(tab: tab, onClose: { windowState.showFindBar = false }) 94 FindBarView(tab: tab, onClose: { windowState.showFindBar = false })
95 } 95 }
96 HStack(spacing: 0) { 96 HStack(spacing: 0) {
97− contentArea(for: tab) 97+ TabContentView(
98+ tab: tab,
99+ onNavigate: { tabManager.loadInActiveTab($0) },
100+ onAsk: { windowState.showAISidebar = true }
101+ )
98 if windowState.showAISidebar { 102 if windowState.showAISidebar {
99 AISidebarView(tab: tab, ai: tab.ai, tabManager: tabManager) 103 AISidebarView(tab: tab, ai: tab.ai, tabManager: tabManager)
100 .transition(.move(edge: .trailing)) 104 .transition(.move(edge: .trailing))
@@ -113,22 +117,25 @@ struct BrowserWindowView: View {
113 } 117 }
114 } 118 }
115 119
116− /// Shows the start page on a blank tab, reader mode when toggled, else web. 120+}
117− @ViewBuilder 121+
118− private func contentArea(for tab: Tab) -> some View { 122+/// The active tab's content region. Observes the tab so it switches reactively
123+/// between the start page (blank/home), reader mode, and live web content as the
124+/// URL changes — and overlays the selection toolbar on web pages.
125+private struct TabContentView: View {
126+ @ObservedObject var tab: Tab
127+ let onNavigate: (String) -> Void
128+ let onAsk: () -> Void
129+ @EnvironmentObject private var windowState: WindowState
130+
131+ var body: some View {
119 if tab.url == nil || tab.url == TabManager.homeURL { 132 if tab.url == nil || tab.url == TabManager.homeURL {
120− StartPageView( 133+ StartPageView(onNavigate: onNavigate, onAsk: onAsk)
121− onNavigate: { tabManager.loadInActiveTab($0) },
122− onAsk: { windowState.showAISidebar = true }
123− )
124 } else if windowState.showReader { 134 } else if windowState.showReader {
125− ReaderView(tab: tab).environmentObject(env).environmentObject(themeEngine) 135+ ReaderView(tab: tab)
126 } else { 136 } else {
127 WebContentArea(tab: tab) 137 WebContentArea(tab: tab)
128− .overlay { 138+ .overlay { SelectionToolbar(tab: tab) }
129− SelectionToolbar(tab: tab)
130− .environmentObject(windowState).environmentObject(themeEngine)
131− }
132 } 139 }
133 } 140 }
134 } 141 }
135 142
Menu

Theme