Repository navigation
Person-detail metadata auto-refresh + tvOS cascade freeze fix - #35
Conversation
TVCascadeSelector's two-level panel animated the flyout alignment padding on `flyoutTopPadding`, a value derived from live GeometryReader -> preference measurements. Animating on a measured value let sub-pixel re-measure jitter re-arm the animation every layout pass, so AnimatorState.combine accumulated animations without bound, the CoreAnimation transaction never committed, and the app hard-froze (the next screen never painted, so it looked stuck on the previous page). Repro: item detail -> cast member -> back -> back; Home never appears. Only bites a library type with >=2 libraries (the two-level panel). Diagnosed by sampling the hung simulator process: the main thread was pegged in AnimatableFrameAttribute.updateValue -> AnimatorState.combine. Animate the flyout follow on the discrete `flyoutAnchorId` instead, so the padding eases only when focus moves to a new library row, never on geometry re-measure. Co-Authored-By: Claude Opus 4.8 <[email protected]>
When a person page opens with incomplete metadata (missing bio, photo, or
birth date), queue a server-side refresh (POST /api/v1/people/{id}/refresh)
and poll GET /api/v1/people/{id} every 3s for up to 120s, swapping in the
enriched record when it lands. A "Loading metadata" indicator shows while
the refresh is in flight; the poll task is cancelled on disappear so it
never outlives the route.
Also included:
- tvOS episode rail highlights/scrolls to the next-up episode via
currentContentId on series/season detail.
- TVFocus debug logging across a few detail/navigation components.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughAdds a person metadata background auto-refresh feature: a new ChangesPerson Metadata Auto-Refresh
tvOS Focus Tracing and Navigation Tweaks
Sequence Diagram(s)sequenceDiagram
participant PersonDetailView
participant PersonDetailViewModel
participant ContinuumAPI
participant PersonMetadataRefreshIndicator
PersonDetailView->>PersonDetailViewModel: onAppear resumeMetadataRefreshIfNeeded()
PersonDetailViewModel->>PersonDetailViewModel: scheduleMetadataRefreshIfNeeded(for: person)
alt metadata incomplete and not already scheduled
PersonDetailViewModel->>ContinuumAPI: refreshPerson(id:)
ContinuumAPI-->>PersonDetailViewModel: PersonRefreshQueuedResponse
PersonDetailViewModel->>PersonMetadataRefreshIndicator: isRefreshingMetadata = true
loop poll until complete or deadline
PersonDetailViewModel->>PersonDetailViewModel: check person.isMetadataIncomplete
end
PersonDetailViewModel->>PersonMetadataRefreshIndicator: isRefreshingMetadata = false
end
PersonDetailView->>PersonDetailViewModel: onDisappear stopMetadataRefresh()
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c72d77ca7b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| defer { | ||
| let wasCancelled = Task.isCancelled | ||
| metadataRefreshTask = nil | ||
| isRefreshingMetadata = false |
There was a problem hiding this comment.
Guard against stale refresh tasks clearing new state
When a person page disappears and quickly appears again, stopMetadataRefresh() cancels the old poll and clears the handle, allowing scheduleMetadataRefreshIfNeeded to start a replacement before the canceled task's defer runs. This defer then unconditionally sets metadataRefreshTask = nil and isRefreshingMetadata = false, orphaning the replacement poll so later onDisappear won't cancel it and the UI hides the in-flight refresh while it can still mutate the view model. Use a generation/task identity check before clearing shared refresh state.
Useful? React with 👍 / 👎.
Summary
POST /api/v1/people/{id}/refresh) and pollGET /api/v1/people/{id}every 3s for up to 120s, swapping in the enriched record when it lands. A "Loading metadata" indicator shows while in flight; the poll task is cancelled on disappear so it can't outlive the route.currentContentIdon series/season detail.GeometryReader→preference value (flyoutTopPadding), which re-armed a SwiftUI animation every layout pass —AnimatorState.combineaccumulated without bound, the CoreAnimation transaction never committed, and the app hard-froze on the way back to Home (repro: item detail → cast member → back → back; Home never paints). Now animates on the discreteflyoutAnchorId. Root-caused by sampling the hung simulator process (main thread pegged inAnimatorState.combine).TVFocusdebug logging across a few detail/navigation components.Server dependency
The metadata refresh assumes the server exposes
POST /api/v1/people/{id}/refreshreturningPersonRefreshQueuedResponse. Confirm it's implemented/deployed before relying on the feature.Testing
SiloTV(tvOS sim) andSilo(iOS sim) both succeed.🤖 Generated with Claude Code
Summary by CodeRabbit