Skip to content

tvOS UI fixes + long-press favorite/watchlist card actions - #69

Merged
Quick104 merged 23 commits into
mainfrom
feature/tvos-ui-fixes
Jul 6, 2026
Merged

Quick104 merged 23 commits into
mainfrom
feature/tvos-ui-fixes

Conversation

@zZebrahz

@zZebrahz zZebrahz commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A batch of tvOS navigation/player UI fixes, plus a new cross-platform feature: long-press context-menu actions on media cards to add/remove items from Favorites and Watchlist.

New: card context-menu favorite/watchlist actions (iOS + tvOS)

  • Long-pressing a poster card now offers Add/Remove from Favorites and Add/Remove from Watchlist on Home rows, Library grids, and the Favorites/Watchlist screens.
  • The menu appears only on cards with a catalog identity (contentId + server userState), so people/collection/discover thumbnails are unaffected.
  • Toggles are optimistic with revert-on-failure, write back the cached per-item user state (detail screens render the new state immediately), and invalidate the Favorites/Watchlist/Home caches.
  • Removing an item from within the Favorites or Watchlist grid animates the card out in place.
  • New shared PersonalListActions.swift (menu items + PersonalListSync); wired into MediaCard (iOS + tvOS), TVMediaCard/TVCatalogGrid (tvOS library).

tvOS navigation & detail fixes

  • Calendar: d-pad Up no longer sticks when navigating past empty days.
  • Home re-click: rides focus back to the first card with an animation.
  • Player: Down from the scrubber lands directly on play/pause; scrubber trackpad drag slowed 5x and made modal against Down; HUD pinned while paused with trackpad drag scrubbing.
  • Detail pages: season switching in place, episode-section centering on chip focus, full-width action-row focus section, tightened hero spacing, selector fixes (single-option selectors focusable, auto-resolved track annotations, stale Auto-preview echo fixed, post-menu default focus retired correctly).
  • Top menu bar: tabs/icons scaled up ~12%.
  • Subtitles: CC/SDH-titled tracks missing the hearing-impaired flag are demoted in auto-selection.
  • Debug: d-pad focus target overlay behind a server-settings toggle (compiled out of Release).

Things to test / verify

Favorite/watchlist menu (the new feature)

  • iOS Home: long-press a poster in any row → menu shows both actions with labels matching the item's current state; toggling updates the heart/bookmark state on the item's detail page.
  • iOS Library: same via the browse grid.
  • tvOS Home rows: long-press select on a card → favorite/watchlist actions appear alongside the existing "Mark as Watched" / "Remove from Continue Watching" items.
  • tvOS Library grid: long-press select on a poster → menu appears and toggles work.
  • Favorites screen (iOS + tvOS): "Remove from Favorites" animates the card out of the grid immediately.
  • Watchlist screen (iOS + tvOS): "Remove from Watchlist" animates the card out immediately.
  • Add an item to the watchlist from Home, then open the Watchlist screen → the item is there (cache invalidation).
  • Toggle favorite on a card, then open that item's detail page → the heart button reflects the new state without a refresh.
  • Cards without user state (people, collection thumbnails, request/discover results) show no context menu.
  • Kill the server / go offline and toggle → the menu label reverts (optimistic state rolls back on failure).
  • iOS Continue Watching: long-press an episode still → menu shows Mark as Watched/Unwatched + Remove from Continue Watching; remove refreshes the row.
  • iOS movie posters in Continue Watching / home rows: long-press → watched toggle, favorite/watchlist, and (on CW rows) remove, all in one menu.
  • Calendar "Following" picks up newly favorited/watchlisted items (following = favorites ∪ watchlist ∪ watch progress).

iOS player HUD + menus

  • Open Audio & Subtitles (also Quality / Chapters) and idle 10+ seconds → HUD and menu stay up, no snap-to-top fade.
  • Dismiss a menu without selecting → HUD auto-hides ~5s after the menu closes (no longer stuck on-screen).
  • Select a track/quality/chapter → menu closes, HUD auto-hides ~5s later.
  • HUD with no menu opened still auto-hides after 5s; tvOS HUD behavior unchanged.

tvOS navigation fixes

  • Calendar week strip: d-pad Up from a day shelf past empty days doesn't get stuck.
  • Pressing Home while on Home scrolls back and lands focus on the first card.
  • Player: Down from the scrubber lands on play/pause; trackpad drag scrubbing feels controllable while paused; HUD stays pinned while paused.
  • Detail page: switching seasons keeps you in place; Up from the selector row can't skip the action row; audio/subtitle selector shows "(Auto)" annotations and single-option selectors are focusable.
  • Release build does not contain the focus debug overlay (Debug-only, behind the server-settings toggle).

Known (pre-existing, not addressed here)

  • Immediately after dismissing a card's long-press menu on tvOS, a d-pad press within ~0.5s can be misrouted (e.g. Down goes right) — this is system dismissal-transition behavior that also affects the pre-existing menus; waiting for the transition to settle avoids it.

Summary by CodeRabbit

  • New Features

    • Added long-press actions to mark titles as favorites or add/remove them from the watchlist.
    • Improved tvOS navigation with smoother focus, scrolling, and scrubber interaction across lists and detail screens.
    • Added clearer “Auto” labels in playback settings when subtitles or audio are automatically selected.
  • Bug Fixes

    • Fixed subtitle auto-selection so CC/SDH tracks are less likely to be chosen over standard dialogue tracks.
    • Updated personal lists to refresh immediately after changes, including removing items from Favorites or Watchlist when appropriate.

zZebrahz added 19 commits July 5, 2026 15:43
The Version/Audio/Subtitles boxes rendered as non-focusable static
values when there was only one choice, so a single-variant item's
selector row had no focusable target — a Down press from the action
buttons hit the full-width focus section, found nothing to focus, and
trapped navigation.

Render single-option boxes as focusable pills sharing the interactive
selectors' style and focus treatment, so every box can be highlighted
regardless of option count and focus flows through to the content rails
below.
Audio: when no explicit track is chosen, prefix the resolved track with
"Auto -" so the row shows the pick was automatic.

Subtitles: instead of a bare "Auto", preview what the player's
subtitle auto-resolver would land on and show "Auto - <track>" or
"Auto - None". Resolution mirrors SubtitleAutoResolver over the detail
payload's tracks, using the item's effective subtitle mode/signature,
the profile's preferred language, and the resolved audio language (Auto
hides subs when audio already matches the preferred sub language).

Phone/downloads callers keep their existing labels via defaulted params.
The hero's bottom-anchored content column carried a 120pt bottom inset
on top of the detail pages' own 48pt section spacing, leaving a ~168pt
dead band under the Version/Audio/Subtitles row. Drop the inset to 48pt
so the next rail sits closer below the selectors.
…ming on back-up

Multi-season detail pages misframed when the short season chip row took
focus: the focus engine's minimal reveal left the episode rail below the
fold, unlike single-season pages where the tall episode card natively
produces the deep centered framing. Any manual scroll races the engine's
own reveal, which is deferred while d-pad input streams in.

Shared TVDetailFocusScroll modifier (movie/episode, series, season pages):
- Season chip row focused -> scroll episode section to center, re-asserted
  across a ~1.1s window so the write outlasts the engine's deferred reveal
  even under rapid d-pad input; each assert re-checks the row still owns
  focus so a stale assert never yanks the page.
- Action row (Play / Start Over / circle buttons) focused -> restore the
  page-entry framing (hero at top) with the same window.
- 0.45s easeInOut to match the engine's own reveal pace.
Season chips on the episode page now swap the rail's episodes in place
(matching the series page) instead of pushing the season's detail page,
and the rail's eyebrow tracks the selected season. Episode taps from an
episode page replace the current route rather than pushing, so Back
exits to wherever the chain started instead of unwinding every
previously viewed episode; tapping the current episode is a no-op.
Resetting the subtitle selector to Auto clears the server override, but
the already-fetched detail still carries the old effectiveSubtitle
mode/signature, so the Auto - ... preview re-matched the manual track.
Track the explicit reset per visit and withhold the stale override from
the preview until the detail is refetched.
…he row

The defaultFocus set to restore focus after a selector menu dismisses
never expired, so re-entering the row (Down from Play) jumped to the
last-modified pill. Repoint the default at the leading pill whenever
focus leaves the row; swap instead of clearing so the row subtree keeps
its identity while a menu is open.
Pause from any source now surfaces the transport overlay and cancels
the auto-hide so it stays up until the user acts; resuming re-arms it.
Selecting the playhead puck now supports continuous trackpad drags
via a window-level pan recognizer, with discrete move-command steps
suppressed while a drag is in flight.
…e selector row can't skip it

The subtitle pill can extend past the last circle button; an Up press
from that overhang found no action-row bounds above it and jumped
straight to the synopsis. Mirror of the selector row's existing
full-width focus section, in the opposite direction.
…red flag

The auto resolver already ranked SDH tracks below plain same-language
tracks, but only via the ffmpeg hearing_impaired disposition. Tracks
titled "English (CC)" / "English SDH" without the flag counted as
full dialogue and won by list order. Detect CC/SDH from title tokens
(whole-token match so words like "soccer" don't hit) in both the
player resolver and the detail-screen Auto preview mirror; such tracks
are still picked when they're the only option in the language.

Filed Silo-Server/silo-android#35 for the matching Android gap.
…ainst Down

Full-swipe travel drops from ~40% to ~8% of the timeline (2400pt ->
12000pt for the full bar) — light drags land within seconds instead of
jumping minutes.

Down during an active timeline scrub used to fall out to the transport
row: the focus engine moved focus to the buttons below natively, so the
scrubber's onMoveCommand(.down) never fired. Lift isTimelineScrubbing
to the shell and render the transport cluster with .focusable(false)
while it's active — no downward focus target exists, so the puck keeps
focus with no reclaim bounce. Select commits and Menu cancels as before.
…ts block reachable

Move the "More Like This" section header inside the similar rail (phone and
tvOS) so the title vanishes with the cards when recommendations are disabled
or empty, instead of leaving an orphaned header.

Make the tvOS Details facts block a passive focus target so the scroll view
can bring it on-screen — it is pure text with no focusable child, so pressing
Down from the Cast rail previously found no target and the section stayed
unreachable.
Clicking the already-selected root in the top menu now returns focus to the
top-left card of the media rows. Three fixes stack up to make that work:

- Re-selecting the current tab keeps the content view alive, so the focus
  hand-down fired in the same transaction as the bar's teardown and the
  engine's repair won; defer the bump one turn so the bar resigns first.
- The row band clips off-screen rows and tvOS drops @focusstate writes to
  clipped views; scroll the band (and the row strip) home before claiming,
  and re-assert the claim until the animated scroll settles so mid-flight
  focus repairs can't override it.
- Make the row strip's leading gutter a content margin instead of inner
  padding so scrollTo/focus-scroll align to the true rest position, killing
  the overshoot-then-drift-back artifact (and the launch jiggle).
A Down press moved focus natively to whichever transport button sat under
the playhead (usually fast-forward) before the scrubber's onMoveCommand
could seed play/pause, reading as a visible hop off the wrong button.

Trap the transport row out of the focus graph while the scrubber owns
focus — the same mechanism the modal timeline scrub uses — so Down has no
native target and the hand-off goes through onMoveToTransport with focus
still on the scrubber; restore the row and seed play/pause one turn later.
Both hand-offs also now write only the destination focus instead of
resigning the source first, which left a targetless frame for the engine
to repair geometrically.
…oggle

New DEBUGGING section in Settings > Server with a device-local "Show
Focus Targets" toggle (SharedDefaults, not profile-scoped; -debugFocusTargets
launch arg forces it on). When enabled, a passthrough always-on-top window
marks the current focus and where each d-pad direction will land.

Targets come from the real focus engine: the overlay rebuilds the private
_UIFocusMovementRequest a d-pad press produces and runs it through the
focus system's movement performer via runtime lookup, so markers honor
guides, occlusion, and group rules without linking private symbols.
Fallbacks keep the markers honest where the engine can't answer:
scroll placeholders render as dashed "SCROLLS" edge strips, SwiftUI's
content-to-menu section hop (invisible to UIKit) is drawn from a hint the
selected tab publishes, and anything else degrades to a geometric guess
badged with "?".
Fence the whole feature behind DEBUG — the settings toggle, the overlay
window, the top-menu hint publisher, and the private-API engine query —
so Release/TestFlight binaries carry none of it and App Store private
selector scanning has nothing to find. Both configurations build.
Up-moves out of a day shelf died when the days above were empty
"Nothing scheduled" stubs and the week strip had scrolled off-screen:
the focus engine found no reachable target and silently dropped the
press, stranding focus on the first day with events.

Reuse MediaRow's boundary pattern: unresolved up-presses bubble to an
onMoveCommand on event-bearing shelves, and the host hops focus to the
previous day with events (existing shelfFocusRequest hand-off) or rides
home to the week strip, which claims focus on the selected day's button
with a claim-verify-retry loop while the scroll settles.
…rsonal lists

Adds Add/Remove from Favorites and Add/Remove from Watchlist to the
card context menus on iOS and tvOS. Menu items appear whenever a card
has a catalog identity (contentId + server userState); toggles are
optimistic with revert-on-failure, mirror the detail screen's cache
write-back/invalidation, and the Favorites/Watchlist grids animate a
removed item out in place.
@coderabbitai

coderabbitai Bot commented Jul 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@zZebrahz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a8026edb-603b-42f7-888a-fa28239a78aa

📥 Commits

Reviewing files that changed from the base of the PR and between 89cba37 and f1dae40.

📒 Files selected for processing (14)
  • iosApp/iosApp/Components/EpisodeThumbCard.swift
  • iosApp/iosApp/Components/MediaCard.swift
  • iosApp/iosApp/Components/PersonalListActions.swift
  • iosApp/iosApp/Networking/Models.swift
  • iosApp/iosApp/Screens/Detail/DetailPlaybackFormatting.swift
  • iosApp/iosApp/Screens/Detail/ItemDetailViewModel.swift
  • iosApp/iosApp/Screens/Player/PlayerViewModel.swift
  • iosApp/iosApp/Screens/Player/iOS/MobilePlayerControls.swift
  • iosApp/iosApp/Screens/Player/tvOS/TVPressCaptureView.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVItemDetailView.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVMovieDetailView.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVPlaybackSelectorRow.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVSeasonDetailView.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVSeriesDetailView.swift
📝 Walkthrough

Walkthrough

This PR adds favorite/watchlist sync to MediaCard/TVMediaCard, refines subtitle Auto-mode preview logic with CC/SDH title detection, reworks tvOS focus/scroll coordination across calendar, skyline, and detail screens, adds trackpad-scrub support and pause overlay behavior to the tvOS player, and introduces a tvOS focus-debug overlay with a settings toggle.

Changes

Personal Lists (Favorite/Watchlist Sync)

Layer / File(s) Summary
PersonalListSync and menu contract
iosApp/iosApp/Components/PersonalListActions.swift
New PersonalListMenuItems view, conditional context-menu extension, and PersonalListSync async server toggle helpers with cache invalidation.
MediaCard wiring
iosApp/iosApp/Components/MediaCard.swift
onUserStateChanged callback, favorite/watchlist override state, personal context menu wiring for both platforms.
TVMediaCard wiring
iosApp/iosApp/tvOS/Screens/Components/TVMediaCard.swift, iosApp/iosApp/tvOS/Screens/Components/TVCatalogGrid.swift
contentId, override state, and toggle handlers for personal actions menu.
Screen state updates
iosApp/iosApp/Screens/Personal/FavoritesView.swift, iosApp/iosApp/Screens/Personal/WatchlistView.swift
Remove items locally when onUserStateChanged reports removal from favorites/watchlist.

Subtitle Auto-Resolution and CC/SDH Handling

Layer / File(s) Summary
CC/SDH title detection
iosApp/iosApp/Screens/Player/PlaybackPrefsResolver.swift, iosApp/Tests/SubtitleAutoResolverTests.swift
New titleIndicatesHearingImpaired helper used in language matching, plus new tests.
Auto label formatting
iosApp/iosApp/Screens/Detail/DetailPlaybackFormatting.swift
annotateAuto audio labeling, resolvedAudioLanguage change, and new subtitle Auto-preview helpers with SubtitleAutoContext.
TVPlaybackSelectorRow wiring
iosApp/iosApp/tvOS/Screens/Detail/TVPlaybackSelectorRow.swift
Server subtitle policy inputs, computed auto context, and TVSelectorValue rewritten as a focusable button.
Override-cleared state
iosApp/iosApp/tvOS/Screens/Detail/TVItemDetailView.swift
Tracks subtitle override clears and updates movie-mode season/episode navigation.
Detail screens wiring
iosApp/iosApp/tvOS/Screens/Detail/TVMovieDetailView.swift, TVSeasonDetailView.swift, TVSeriesDetailView.swift
Override-cleared state suppresses stale subtitle mode/signature values passed to the selector row.

tvOS Focus Navigation and Detail Layout

Layer / File(s) Summary
AppRouter replaceCurrent
iosApp/iosApp/Navigation/AppRouter.swift
New action to swap the current top route.
MediaRow scroll-then-focus
iosApp/iosApp/Components/MediaRow.swift
Scroll-to-first-item before claiming focus, with retries and content margin adjustments.
Calendar focus escape
iosApp/iosApp/Screens/Calendar/CalendarDayShelf.swift, CalendarView.swift, CalendarWeekStrip.swift
Up-move handling to escape shelves back to prior days or the top strip.
TVSkylineSectionFeed entry scroll
iosApp/iosApp/tvOS/Components/TVSkylineSectionFeed.swift
Scroll-to-top before focus claim on entry.
TVMainTabView reselect timing
iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift
Defers focus-request increment on same-root reselection.
Detail focus scroll and facts section
iosApp/iosApp/tvOS/Screens/Detail/TVDetailFocusScroll.swift, TVDetailFactsSection.swift
New scroll-coordination modifier and focusable facts container.
Detail screens focus wiring
TVMovieDetailView.swift, TVSeasonDetailView.swift, TVSeriesDetailView.swift, TVItemDetailView.swift
Focus bindings/scroll anchors wired into detailFocusScroll; navigation changed to replace-current for episodes.
Similar rail header ownership
MovieDetailContent.swift, SeriesDetailContent.swift, Phone/PhoneSimilarRail.swift, TVMovieDetailView.swift, TVSeriesDetailView.swift, TVSimilarRail.swift
Rails own their "More Like This" header instead of outer wrappers.
Visual metric tweaks
Theme/ContinuumTheme.swift, tvOS/Navigation/TVTopMenuBar.swift
Increased tab/icon sizing and search icon font size.

tvOS Player Controls and Trackpad Scrubbing

Layer / File(s) Summary
Pause/resume overlay behavior
Screens/Player/PlayerViewModel.swift
Pins controls on pause, schedules auto-hide on resume.
Scrubber-transport focus trapping
tvOS/TVPlayerControls.swift, tvOS/TVPlayerTransportCluster.swift
New trapsTransportFocus and allowsFocus gating for transport buttons.
Trackpad pan scrubbing
tvOS/TVPlayerScrubber.swift, tvOS/TVPressCaptureView.swift
Continuous pan-based scrubbing via new TVPanCaptureView/PanCaptureUIView.

tvOS Focus Debug Overlay and Settings

Layer / File(s) Summary
Debug settings and activation
tvOS/Debug/TVDebugSettings.swift, ContentView.swift
Persisted showFocusTargets flag and activation modifier.
Focus debug overlay
tvOS/Debug/TVFocusDebugOverlay.swift
Overlay window visualizing predicted focus targets via engine query and heuristic fallback.
Settings toggle
tvOS/Screens/Settings/TVSettingsView.swift
Debug-only "Show Focus Targets" toggle row.

Estimated code review effort: 4 (Complex) | ~75 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MediaCard
  participant PersonalListSync
  participant ContinuumAPI
  participant ResponseCache
  participant FavoritesView

  MediaCard->>PersonalListSync: setFavorite(contentId, value)
  PersonalListSync->>ContinuumAPI: toggle favorite request
  ContinuumAPI-->>PersonalListSync: success/failure
  PersonalListSync->>ResponseCache: invalidate cached lists
  PersonalListSync-->>MediaCard: result
  MediaCard->>FavoritesView: onUserStateChanged(state)
  FavoritesView->>FavoritesView: remove item if !isFavorite
Loading
sequenceDiagram
  participant TVPlaybackSelectorRow
  participant DetailPlaybackFormatting
  participant SubtitleAutoResolver

  TVPlaybackSelectorRow->>DetailPlaybackFormatting: subtitleValueLabel(autoContext)
  DetailPlaybackFormatting->>DetailPlaybackFormatting: autoResolvedSubtitle(context)
  DetailPlaybackFormatting->>SubtitleAutoResolver: bestLanguageMatch(preferForced)
  SubtitleAutoResolver-->>DetailPlaybackFormatting: chosen track or none
  DetailPlaybackFormatting-->>TVPlaybackSelectorRow: "Auto - <track>" label
Loading
sequenceDiagram
  participant PanCaptureUIView
  participant TVPanCaptureView
  participant TVPlayerScrubber
  participant TVPlayerControls

  PanCaptureUIView->>TVPanCaptureView: onPanChanged(deltaX)
  TVPanCaptureView->>TVPlayerScrubber: handlePanChanged(delta)
  TVPlayerScrubber->>TVPlayerScrubber: update scrub preview position
  PanCaptureUIView->>TVPanCaptureView: onPanEnded
  TVPanCaptureView->>TVPlayerScrubber: clear panEngaged
  TVPlayerScrubber->>TVPlayerControls: onMoveToTransport / seed focus
Loading

Possibly related PRs

  • Silo-Server/silo-apple#4: Both PRs modify CalendarDayShelf/CalendarView/CalendarWeekStrip tvOS focus navigation and scroll-to-focus proxy flows.
  • Silo-Server/silo-apple#6: Both PRs iterate on TVSkylineSectionFeed, TVMainTabView, and TVTopMenuBar focus/scroll mechanics.
  • Silo-Server/silo-apple#30: Both PRs modify DetailPlaybackFormatting.swift subtitle selection/label logic.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is clear, concise, and matches the main changes: tvOS UI fixes plus long-press favorite/watchlist actions.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/tvos-ui-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…es, continue watching)

The watched-toggle and remove-from-continue-watching actions were
compiled only into the tvOS card wrappers, so long-pressing a Continue
Watching card on iOS did nothing. Hoist the shared menu content out of
the tvOS-only blocks and attach it on the iOS branches of MediaCard and
EpisodeThumbCard, merged with the favorite/watchlist items in the same
order as the tvOS menu.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89cba37428

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
iosApp/iosApp/Components/MediaRow.swift (1)

115-125: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Explicit onItemFocus may double-fire and can report focus that never landed.

claimFirstItemFocus writes focusedItemId and then calls onItemFocus?(firstItem) directly, but the tvOS .onChange(of: focusedItemId) handler (Lines 80–85) already invokes onItemFocus whenever the write actually lands. On a successful claim the callback fires twice; on a rejected write (the exact case the retry loop exists for) the direct call still reports the item as focused even though @FocusState never accepted it. Consider relying on the onChange handler alone so the callback tracks actual focus.

♻️ Proposed change
     private func claimFirstItemFocus(_ firstItem: SectionItem, attempt: Int = 0) {
         focusedItemId = firstItem.contentId
-        onItemFocus?(firstItem)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/Components/MediaRow.swift` around lines 115 - 125, The focus
callback is being triggered both in `claimFirstItemFocus` and again from the
`.onChange(of: focusedItemId)` handler, which can double-fire and report focus
that never actually landed. Update `claimFirstItemFocus` in `MediaRow` so it
only requests the focus change by setting `focusedItemId`, and let the existing
`onChange` path be the sole place that calls `onItemFocus`. Keep the retry logic
and `attempt` handling intact, but remove the direct callback from the focus
claim path so `onItemFocus` reflects actual accepted focus only.
iosApp/iosApp/tvOS/Screens/Components/TVMediaCard.swift (1)

79-126: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated favorite/watchlist toggle logic vs. MediaCard.swift.

hasPersonalActions, isFavorite, isInWatchlist, personalMenuItems, togglePersonalFavorite, and togglePersonalWatchlist are near-identical to the versions in iosApp/iosApp/Components/MediaCard.swift (lines 141-197), down to variable names. The duplication has already drifted stylistically (if await ... == false { } here vs. if await ... { } else { } there), which is exactly the kind of divergence duplication invites. Consider extracting a shared helper (e.g., a small PersonalListToggleController/view-model struct backed by @State favorite/watchlist overrides, parameterized by an optional onUserStateChanged) that both MediaCard and TVMediaCard compose.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iosApp/iosApp/tvOS/Screens/Components/TVMediaCard.swift` around lines 79 -
126, The favorite/watchlist state and toggle flow in TVMediaCard duplicates the
same logic already present in MediaCard, so update TVMediaCard to use a shared
helper instead of maintaining a separate copy. Extract the common behavior
around hasPersonalActions, isFavorite, isInWatchlist, personalMenuItems,
togglePersonalFavorite, and togglePersonalWatchlist into a reusable
controller/view-model or helper that both MediaCard and TVMediaCard can compose,
keeping the existing PersonalListSync calls and override rollback behavior
centralized.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@iosApp/iosApp/Components/PersonalListActions.swift`:
- Around line 54-83: `setFavorite` and `setWatchlist` in `PersonalListActions`
are overwriting sibling state with the caller’s full snapshot, which can revert
a concurrent successful toggle. Update the `writeBack` flow to merge the new
field into the existing `CacheKey.itemUserState(contentId)` value before calling
`ResponseCache.shared.set`, and keep the cache invalidations after that. Apply
the same merge pattern at the matching call sites in `MediaCard` and
`TVMediaCard` so both favorite and watchlist updates preserve each other.

In `@iosApp/iosApp/Screens/Player/tvOS/TVPressCaptureView.swift`:
- Around line 125-152: The TVPressCaptureView gesture lifecycle only re-attaches
in didMoveToWindow(), so when the view leaves its window the existing
UIPanGestureRecognizer remains attached until deinit. Update
attachRecognizerIfNeeded() (or didMoveToWindow()) to explicitly call
detachRecognizer() when window is nil before returning, ensuring the old
recognizer is removed from the previous window immediately and teardown is
deterministic.

---

Nitpick comments:
In `@iosApp/iosApp/Components/MediaRow.swift`:
- Around line 115-125: The focus callback is being triggered both in
`claimFirstItemFocus` and again from the `.onChange(of: focusedItemId)` handler,
which can double-fire and report focus that never actually landed. Update
`claimFirstItemFocus` in `MediaRow` so it only requests the focus change by
setting `focusedItemId`, and let the existing `onChange` path be the sole place
that calls `onItemFocus`. Keep the retry logic and `attempt` handling intact,
but remove the direct callback from the focus claim path so `onItemFocus`
reflects actual accepted focus only.

In `@iosApp/iosApp/tvOS/Screens/Components/TVMediaCard.swift`:
- Around line 79-126: The favorite/watchlist state and toggle flow in
TVMediaCard duplicates the same logic already present in MediaCard, so update
TVMediaCard to use a shared helper instead of maintaining a separate copy.
Extract the common behavior around hasPersonalActions, isFavorite,
isInWatchlist, personalMenuItems, togglePersonalFavorite, and
togglePersonalWatchlist into a reusable controller/view-model or helper that
both MediaCard and TVMediaCard can compose, keeping the existing
PersonalListSync calls and override rollback behavior centralized.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 42df43d1-139e-48cb-aab3-ac81da98dc17

📥 Commits

Reviewing files that changed from the base of the PR and between c991166 and 89cba37.

📒 Files selected for processing (39)
  • iosApp/Tests/SubtitleAutoResolverTests.swift
  • iosApp/iosApp/Components/MediaCard.swift
  • iosApp/iosApp/Components/MediaRow.swift
  • iosApp/iosApp/Components/PersonalListActions.swift
  • iosApp/iosApp/ContentView.swift
  • iosApp/iosApp/Navigation/AppRouter.swift
  • iosApp/iosApp/Screens/Calendar/CalendarDayShelf.swift
  • iosApp/iosApp/Screens/Calendar/CalendarView.swift
  • iosApp/iosApp/Screens/Calendar/CalendarWeekStrip.swift
  • iosApp/iosApp/Screens/Detail/DetailPlaybackFormatting.swift
  • iosApp/iosApp/Screens/Detail/MovieDetailContent.swift
  • iosApp/iosApp/Screens/Detail/Phone/PhoneSimilarRail.swift
  • iosApp/iosApp/Screens/Detail/SeriesDetailContent.swift
  • iosApp/iosApp/Screens/Personal/FavoritesView.swift
  • iosApp/iosApp/Screens/Personal/WatchlistView.swift
  • iosApp/iosApp/Screens/Player/PlaybackPrefsResolver.swift
  • iosApp/iosApp/Screens/Player/PlayerViewModel.swift
  • iosApp/iosApp/Screens/Player/tvOS/TVPlayerControls.swift
  • iosApp/iosApp/Screens/Player/tvOS/TVPlayerScrubber.swift
  • iosApp/iosApp/Screens/Player/tvOS/TVPlayerTransportCluster.swift
  • iosApp/iosApp/Screens/Player/tvOS/TVPressCaptureView.swift
  • iosApp/iosApp/Theme/ContinuumTheme.swift
  • iosApp/iosApp/tvOS/Components/TVSkylineSectionFeed.swift
  • iosApp/iosApp/tvOS/Debug/TVDebugSettings.swift
  • iosApp/iosApp/tvOS/Debug/TVFocusDebugOverlay.swift
  • iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift
  • iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift
  • iosApp/iosApp/tvOS/Screens/Components/TVCatalogGrid.swift
  • iosApp/iosApp/tvOS/Screens/Components/TVMediaCard.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVDetailFactsSection.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVDetailFocusScroll.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVDetailHero.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVItemDetailView.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVMovieDetailView.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVPlaybackSelectorRow.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVSeasonDetailView.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVSeriesDetailView.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVSimilarRail.swift
  • iosApp/iosApp/tvOS/Screens/Settings/TVSettingsView.swift

zZebrahz added 2 commits July 5, 2026 16:16
The 5s auto-hide fired regardless of an open Quality / Audio &
Subtitles / Chapters menu: the tap-gesture pin on the menu labels never
fired because the menu steals the touch, so the HUD hid mid-selection,
tearing the menu's anchor out from under it (it snapped to the top and
faded). Native Menus expose no isPresented hook, so instead of pinning,
the hide deadline now checks for a live menu platter (SwiftUI menus are
UIContextMenuInteraction-backed), waits out any open menu, and restarts
a fresh full window once no menus are visible. Menu label tap pins are
removed — a cancelled menu no longer leaves the HUD stuck on-screen.
tvOS is untouched (its options HUD pins explicitly via openHUD).
- tvOS detail: plumb effective_show_forced_subtitles through ItemDetail
  and the playback selector row so the Auto subtitle preview honors the
  Show Forced Subtitles preference instead of rendering 'Auto - None'
  when playback would start with a forced track (Codex P2).
- PersonalListSync: merge the toggled flag over the cached user-state
  pair instead of writing the caller's full snapshot, so two quick
  favorite/watchlist toggles can't revert each other in cache
  (CodeRabbit).
- TVPressCaptureView: detach window gesture recognizers when the view
  leaves its window instead of waiting for deinit (CodeRabbit).
@zZebrahz

zZebrahz commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in 9a60420:

  • Codex (P2, forced-subtitle Auto preview): Fixed. effective_show_forced_subtitles now flows through ItemDetail (folded from the watch detail, same as mode/signature) into TVPlaybackSelectorRow's auto context on all three tvOS detail screens, so the preview mirrors the resolver's forced-track branch.
  • CodeRabbit (PersonalListSync stale sibling overwrite): Fixed. writeBack now merges the toggled flag over the currently cached pair; the caller's sibling snapshot is only a fallback when nothing is cached.
  • CodeRabbit (TVPressCaptureView recognizer teardown): Fixed. Both PanCaptureUIView and DirectionalPressGestureUIView detach their window recognizers on the nil-window path in didMoveToWindow().

Skipped (with reasons):

  • MediaRow onItemFocus double-fire nitpick: intentional — the direct call gives the Skyline marquee an immediate preview during the programmatic ride home, when the @FocusState write can be rejected mid-scroll and onChange wouldn't fire; the duplicate report is idempotent for the marquee.
  • MediaCard/TVMediaCard toggle duplication nitpick: valid cleanup, deferring to a follow-up rather than churning both card implementations inside this PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a60420e1a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ches exactly

Follow-up to the Codex review: the preferred-language pick must never
prefer forced tracks (playback always picks the full-dialogue track
there), and the audio-matches-preference branch should surface the
language-matching forced track when Show Forced Subtitles is enabled
instead of previewing 'Auto - None'.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1dae40cb8

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


private var subtitleAutoContext: DetailPlaybackFormatting.SubtitleAutoContext {
DetailPlaybackFormatting.SubtitleAutoContext(
preferredLanguage: preferredSubtitleLanguage,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use server-resolved subtitle language for Auto preview

This feeds the Auto preview with ProfilePrefsStore's profile-level language, but playback resolves subtitles from WatchDetail.effectiveSubtitleLanguage after the per-series/library/profile cascade (see PlayerViewModel where PrefsSnapshot.preferredLanguage is set from prepared.watchDetail.effectiveSubtitleLanguage). When a library or series preference overrides the profile default, or the profile has no language but a library does, the detail row can show Auto - None or the profile-language track while pressing Play selects a different effective-language track. Plumb the watch/detail effectiveSubtitleLanguage into this context instead of using the profile-only approximation.

Useful? React with 👍 / 👎.

@Quick104
Quick104 merged commit c6fdbc4 into main Jul 6, 2026
1 check passed
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.

2 participants