fix(#315): inject AnalyticsManager into full-player sheets (Mac crash)#314
Merged
Conversation
The podcast full player crashed on Mac (Designed for iPad) when opened from the mini player: FullPlayerView and ChaptersView read analytics via @EnvironmentObject, but they are presented in .sheet contexts that do not inherit the root .environmentObject(analytics) on the iOS-app-on-Mac runtime, so the first access trapped with "No ObservableObject of type AnalyticsManager found". iPhone and iPad inherit it, so it only crashed on Mac. Re-inject analytics into both presented sheets, mirroring the existing DeepLinkNewsDetailView pattern: - PodcastMiniPlayerModifier forwards analytics into the FullPlayerView sheet. - FullPlayerView forwards analytics into the nested ChaptersView sheet. Co-Authored-By: Claude <noreply@anthropic.com>
cassio-rossi
force-pushed
the
fix/mac-fullplayer-crash
branch
from
July 21, 2026 20:06
889ad69 to
5103399
Compare
cassio-rossi
added a commit
that referenced
this pull request
Jul 21, 2026
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.
Problem
The podcast full player crashed on Mac only ("My Mac — Designed for iPad") when opened by tapping the mini player.
Root cause
FullPlayerViewandChaptersVieweach read analytics via@EnvironmentObject var analytics: AnalyticsManager. Both are presented through.sheet. On the iOS-app-on-Mac runtime the sheet is hosted in a separate presentation context that does not inherit the root.environmentObject(viewModel.analytics), so the first access traps:iPhone/iPad inherit the environment object across the sheet boundary, so the crash was Mac-only.
Fix
Re-inject
analyticsinto the presented sheets, mirroring the existingDeepLinkNewsDetailViewpattern (which already re-injects.environmentObject(viewModel.analytics)into its sheet):PodcastMiniPlayerModifierreads@EnvironmentObject analytics(present in the main hierarchy) and forwards it into theFullPlayerViewsheet.FullPlayerViewforwards it into the nestedChaptersViewsheet (same latent crash when opening the chapter list).The speed popover captures
analyticsdirectly in its closures rather than doing its own environment lookup, so it needs no change.Verification
--stricton both changed files — 0 violations.Note / potential follow-up (not fixed)
SystemVolumeViewwrapsMPVolumeView, which may misbehave on the iOS-app-on-Mac runtime. Because the analytics crash fired first, that path was never reached, so it's unverified. If the volume row misbehaves once the full player opens on Mac, that's a clean separate ticket.Notes
developbranch exists — branch is based onrelease/v5; PR targetsrelease/v5.fix(podcast)scope; CI's title check may expectfix(#NNN)— rename if it enforces that.🤖 Generated with Claude Code