fix(webview): defer WebView insertion on Mac to prevent animation crash#295
Merged
cassio-rossi merged 2 commits intorelease/v5from May 2, 2026
Merged
fix(webview): defer WebView insertion on Mac to prevent animation crash#295cassio-rossi merged 2 commits intorelease/v5from
cassio-rossi merged 2 commits intorelease/v5from
Conversation
…sertion
On Mac (Designed for iPad), WebKit's SwiftUI bridge crashes with brk 1
when WebView(page) is created during an animated transaction. This occurs
when navigating to Instagram from the sidebar because NavigationSplitView
implicitly animates detail content changes.
Add .transaction { $0.disablesAnimations = true } to WebView(page) to
explicitly opt out of inherited animation contexts. Remove redundant
.transition(.opacity) that was also a potential animation source.
Also add temporary debug alert to show removeAds value on device for
investigation of cookie/ads issue on physical device.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On Mac (Designed for iPad), WebKit's SwiftUI bridge crashes with brk 1 when WebView(page) is created during an animated transaction. This occurs when NavigationSplitView implicitly animates detail content transitions. Use ProcessInfo.processInfo.isiOSAppOnMac to detect Mac and defer the WebView insertion by 100ms, allowing the animation context to settle before makeUIView is called. iOS/iPadOS are unaffected — webViewReadyToRender starts as true and no delay occurs. Also removes redundant .transition(.opacity) from ManagedWebView that was a secondary source of animation context during view insertion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WebView(page)insertion by 100ms on Mac (Designed for iPad) to escape NavigationSplitView's implicit animation context that crashes WebKit'smakeUIViewProcessInfo.processInfo.isiOSAppOnMac— iOS/iPadOS completely unaffected (zero delay).transition(.opacity)from ManagedWebViewCloses #276
Test plan
🤖 Generated with Claude Code