SPB Git

spb/zyquo-atlas Public License

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

Swift 75.2% JavaScript 22% Shell 2% Makefile 0.9%

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 11 days ago (Jul 31, 2026) parent 16f9769

Showing 1 changed file with +20 and −13

modified Sources/ZyquoAtlas/Views/Browser/BrowserWindowView.swift +20 −13
@@ -94,7 +94,11 @@ struct BrowserWindowView: View {
94 94 FindBarView(tab: tab, onClose: { windowState.showFindBar = false })
95 95 }
96 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 102 if windowState.showAISidebar {
99 103 AISidebarView(tab: tab, ai: tab.ai, tabManager: tabManager)
100 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.
117 @ViewBuilder
118 private func contentArea(for tab: Tab) -> some View {
120 +}
121 +
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 132 if tab.url == nil || tab.url == TabManager.homeURL {
120 StartPageView(
121 onNavigate: { tabManager.loadInActiveTab($0) },
122 onAsk: { windowState.showAISidebar = true }
123 )
133 + StartPageView(onNavigate: onNavigate, onAsk: onAsk)
124 134 } else if windowState.showReader {
125 ReaderView(tab: tab).environmentObject(env).environmentObject(themeEngine)
135 + ReaderView(tab: tab)
126 136 } else {
127 137 WebContentArea(tab: tab)
128 .overlay {
129 SelectionToolbar(tab: tab)
130 .environmentObject(windowState).environmentObject(themeEngine)
131 }
138 + .overlay { SelectionToolbar(tab: tab) }
132 139 }
133 140 }
134 141 }
135 142