Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions App/CompactViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,15 @@ private struct CompactViewWrapper: View {
@EnvironmentObject private var navigation: NavigationViewModel

var body: some View {
if case .loading = navigation.currentItem {
LoadingDataView()
} else if case let .tab(tabID) = navigation.currentItem {
CompactView(tabID: tabID)
Group {
if case .loading = navigation.currentItem {
LoadingDataView()
} else if case let .tab(tabID) = navigation.currentItem {
CompactView(tabID: tabID)
.transition(.opacity)
}
}
.animation(.easeInOut(duration: 0.2), value: navigation.currentItem)
Comment on lines +143 to +147
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .transition(.opacity) is unlikely to apply when switching between different .tab(tabID) values because this branch stays active and CompactView is updated rather than inserted/removed. To actually crossfade between tabs, give CompactView a changing identity at this level (e.g., .id(tabID)) or apply the transition to the view whose identity changes so SwiftUI performs a removal/insertion animation.

Copilot uses AI. Check for mistakes.
}
}

Expand Down
2 changes: 1 addition & 1 deletion Views/BrowserTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ struct BrowserTab: View {
.overlay {
if case .webPage(let isLoading) = model.state, isLoading {
LoadingProgressView()
.background(Color.background)
.allowsHitTesting(false)
}
}
#if os(macOS)
Expand Down
6 changes: 4 additions & 2 deletions Views/BuildingBlocks/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ final class WebViewController: UIViewController {
topSafeAreaConstraint = view.safeAreaLayoutGuide.topAnchor.constraint(equalTo: webView.topAnchor)
topSafeAreaConstraint?.isActive = true
layoutCancellable = layoutSubject
.debounce(for: .seconds(0.15), scheduler: RunLoop.main)
.debounce(for: .seconds(0.05), scheduler: RunLoop.main)
.sink { [weak self] _ in
guard let view = self?.view,
let webView = self?.webView,
view.subviews.contains(webView) else { return }
webView.alpha = 1
UIView.animate(withDuration: 0.2) {
webView.alpha = 1
}
Comment on lines 123 to +127
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layoutSubject is triggered on every viewDidLayoutSubviews, but the sink now runs an unconditional UIView.animate each time it fires. This can cause repeated/needless animations on later layout passes (rotation, safe-area changes, etc.). Consider guarding so the fade-in runs only once (e.g., check webView.alpha == 0 / a hasFadedIn flag).

Copilot uses AI. Check for mistakes.
guard self?.topSafeAreaConstraint?.isActive == true else { return }
self?.topSafeAreaConstraint?.isActive = false
self?.view.topAnchor.constraint(equalTo: webView.topAnchor).isActive = true
Expand Down