-
-
Notifications
You must be signed in to change notification settings - Fork 452
Open
Labels
tvOSImpacts tvOSImpacts tvOS
Milestone
Description
Describe the bug
Issue summary
When navigating down from season buttons to episodes on the tvOS series details page, focus gets lost instead of moving to the first episode thumbnail. This creates a poor user experience where users have to manually search for focus or repeatedly attempt navigation.
Devices
Apple Tv 4k A1842
tvOS 18.5[22L572]
Apple TV (just before the 4k one)
tvOS 18.5[22L572]
Note: It seems not to happen on the simulator Apple Tv 4k 3rd generation (18.4)
Root cause investigation
Initial Symptoms
- Focus disappears when navigating from season selector to episodes section
- Sometimes focus navigation works, sometimes it doesn't
- User gets "stuck" around season buttons unable to proceed smoothly
- Issue does NOT occur in the old Swiftfin project
Technical details
The race condition
- User navigates down from seasons to episodes
- Focus guide
onContentFocusfires → callsgetContentFocus()→ setsfocusedEpisodeID - Season selection change fires → calls
getContentFocus()again → overwritesfocusedEpisodeID - Multiple rapid assignments cause SwiftUI focus system to fail
- Result:
focusedEpisodeIDends up asnildespite valid assignments
Debug logs showing the issue
🎯 EpisodeHStack: Focus guide onContentFocus triggered
🎯 EpisodeHStack: getContentFocus() called, state: content
🎯 EpisodeHStack: Setting focus to lastFocused: 78d37e0779f1a4671f6ac0c26a04f36a
🎯 EpisodeHStack: About to set focusedEpisodeID = 78d37e0779f1a4671f6ac0c26a04f36a
🎯 EpisodeHStack: After assignment, focusedEpisodeID = nil ← BUG HERE
🎯 SeasonHStack: Focus guide onContentFocus triggered
🎯 SeasonHStack: focusedSeason changed
🎯 EpisodeHStack: Focus guide onContentFocus triggered ← SECOND CALL CONFLICTS
My current solution
Simplified Natural Focus (Current Solution)
.focusGuide(focusGuide, tag: "episodes", onContentFocus: {
if focusedEpisodeID == nil {
focusedEpisodeID = viewModel.elements.first?.id
}
})Application version
latest on master branch
Where did you install the app from?
None
Device information
Apple Tv 4k A1842
OS version
18.5[22L572]
Jellyfin server version
10.10.7
Let me know if you want a PR
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
tvOSImpacts tvOSImpacts tvOS
Type
Projects
Status
In-Progress