Skip to content

fix(webview): defer WebView insertion on Mac to prevent animation crash#295

Merged
cassio-rossi merged 2 commits intorelease/v5from
fix/instagram-mac-crash
May 2, 2026
Merged

fix(webview): defer WebView insertion on Mac to prevent animation crash#295
cassio-rossi merged 2 commits intorelease/v5from
fix/instagram-mac-crash

Conversation

@cassio-rossi
Copy link
Copy Markdown
Collaborator

@cassio-rossi cassio-rossi commented May 2, 2026

Summary

  • Defer WebView(page) insertion by 100ms on Mac (Designed for iPad) to escape NavigationSplitView's implicit animation context that crashes WebKit's makeUIView
  • Uses ProcessInfo.processInfo.isiOSAppOnMac — iOS/iPadOS completely unaffected (zero delay)
  • Removes redundant .transition(.opacity) from ManagedWebView

Closes #276

Test plan

  • Mac → sidebar → Instagram → no crash
  • iPhone → Social tab → segment switch → works normally, no delay
  • Other webview pages (Live, article detail) still work on Mac

🤖 Generated with Claude Code

cassiorossi1010 and others added 2 commits May 2, 2026 20:11
…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>
@cassio-rossi cassio-rossi merged commit 7081eb1 into release/v5 May 2, 2026
@cassio-rossi cassio-rossi deleted the fix/instagram-mac-crash branch May 2, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash do Instagram no macOS

2 participants