Skip to content

iOS player controls & menus redesign - #46

Merged
Quick104 merged 3 commits into
mainfrom
claude/great-herschel-c54546
Jul 2, 2026
Merged

Quick104 merged 3 commits into
mainfrom
claude/great-herschel-c54546

Conversation

@Quick104

@Quick104 Quick104 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Rebuilds the iOS player UI around native idioms (labeled controls, expanding scrubber, gestures, real settings hierarchy) while keeping the Liquid Glass material language. tvOS and macOS are behaviorally unchanged — the shared sheets keep their existing layouts behind platform guards.

Overlay (MobilePlayerControls)

  • Top strip reduced to Close + AirPlay (new AVRoutePickerView wrapper), with a two-line title block (series · S:E eyebrow over episode title) anchored top-leading — replaces the row of six identical unlabeled glass circles with a center-truncating title.
  • Thumbless capsule scrubber: 8pt at rest → 14pt under the finger, buffered range (from the VM's existing bufferedAheadSeconds), intro-segment tint, chapter ticks, and a floating time + chapter preview bubble while scrubbing; the other controls recede during a scrub.
  • Labeled action row — Speed 1× / Audio & Subtitles / Chapters / Lock / ⋯ — with a three-tier ViewThatFits fallback (full → compact → icon circles) so portrait never overflows, even with chapters present.
  • Speed quick menu anchored on its pill (prominent glass when ≠ 1×); the speed picker is removed from the iOS settings sheet.
  • Sleep timer shows as a status chip above the scrubber; the trailing time label taps between remaining and duration; the intro auto-skip stack merges into one pill with an inline countdown plus a cancel circle.

Gestures (new MobilePlayerGestureLayer, mounted between surface and overlay)

  • Double-tap edges = ±10s with a ripple flash; center double-tap = play/pause.
  • Touch-and-hold = 2× while held (new non-persisting beginHoldFastForward on the VM — releasing restores the configured speed; no-op while paused).
  • Edge drags adjust brightness (left) and player volume (right) with slim gauges; center swipe-down dismisses the player; the pinch-for-aspect gesture moves here from the surface.

Sheets

  • Track rows gain metadata pills (PlayerTrack.attributePillLabels, refactored out of attributesLabel with identical joined output) plus a nav header and Done button; the chapter sheet gets the same header treatment.
  • iOS settings become a hierarchy: Video (Quality sub-page, Aspect, HDR) / Audio / Subtitles (Appearance sub-page with a live style preview, delay) / Session (sleep timer, auto-play) — and the route diagnostics that used to open the sheet are demoted to an Advanced sub-page.

Reviewer notes

  • The center skip buttons now pass an explicit 10 to skipForward — the VM default is 30s, but the button glyph has always been goforward.10; this makes behavior match the icon. Happy to flip to 30s + a new glyph instead if the asymmetric Apple-TV-style skip was intentional.
  • The gesture layer only receives touches while the controls overlay is hidden (the overlay scrim intercepts otherwise) — deliberate for v1.
  • UIScreen.main is deprecated on iOS 26; brightness resolves through the foreground UIWindowScene instead.
  • The design spec / mockups this implements live at docs/ios-player-redesign/mockups.html locally (untracked — docs/* is gitignored).

Verification

  • Silo (iOS sim), SiloTV (tvOS sim), and SiloMac schemes all build with CODE_SIGNING_ALLOWED=NO.
  • All 250 unit tests pass; changed files are warning-clean.
  • Not yet visually validated against a live server — gestures and scrubber feel need a sim/device pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a dedicated iOS gesture layer for the player: tap-to-toggle controls, double-tap skip/play-pause, press-and-hold fast-forward, pinch to change video fit, and edge swipes for brightness and volume.
    • Redesigned iOS player controls (time display, scrubber with preview, speed and intro-skip pills).
    • Improved iOS chapters, track selection, and settings with navigation titles and “Done” actions.
  • Bug Fixes
    • Improved audio/subtitle metadata presentation with clearer attribute “pills.”
    • Skip actions now better respect whether controls should stay visible vs auto-hide.

Rebuild the touch player UI around native iOS idioms while keeping the
Liquid Glass material language. tvOS and macOS behavior is unchanged
(shared sheets keep their legacy layouts behind platform guards).

Overlay (MobilePlayerControls):
- Top strip reduced to Close + AirPlay (new AVRoutePickerView wrapper),
  with a two-line title block (series · S:E eyebrow over episode title)
  anchored top-leading instead of a truncating center title
- Thumbless capsule scrubber: 8pt at rest, 14pt while scrubbing, buffered
  range (from bufferedAheadSeconds), intro tint, chapter ticks, and a
  floating time + chapter preview bubble; other controls recede during a
  scrub
- Labeled action row (Speed / Audio & Subtitles / Chapters / Lock / More)
  with a three-tier ViewThatFits fallback so portrait never overflows
- Speed quick menu on the pill itself (prominent glass when not 1x);
  the speed picker leaves the iOS settings sheet
- Sleep timer surfaces as a status chip; trailing time label toggles
  remaining vs duration; intro auto-skip merges into one pill with an
  inline countdown and a cancel circle

Gestures (new MobilePlayerGestureLayer between surface and overlay):
- Double-tap edges ±10s with ripple flash, center double-tap play/pause
- Touch-and-hold for 2x while held (new non-persisting
  beginHoldFastForward on the view model)
- Edge drags adjust brightness (left) and player volume (right) with
  slim gauges; center swipe-down dismisses; pinch-for-aspect moves in
  from the surface

Sheets:
- Track rows gain metadata pills (PlayerTrack.attributePillLabels) plus
  a nav header and Done button; chapters get the same header treatment
- iOS settings become a hierarchy: Video (Quality sub-page, Aspect, HDR),
  Audio, Subtitles (Appearance sub-page with live preview, delay),
  Session; route diagnostics demoted to an Advanced sub-page

Design spec with mockups lives at docs/ios-player-redesign/mockups.html
(untracked; docs/* is gitignored).

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5dfb7ca3-9788-4cdd-b0b8-d511b29a8f59

📥 Commits

Reviewing files that changed from the base of the PR and between c992dd8 and 89377ba.

📒 Files selected for processing (2)
  • iosApp/iosApp/Screens/Player/PlayerViewModel.swift
  • iosApp/iosApp/Screens/Player/Sheets/TrackSelectionSheet.swift

📝 Walkthrough

Walkthrough

This PR moves iOS player gestures into a dedicated overlay layer, redesigns the mobile controls UI, updates playback state handling, refactors track metadata labels, and wraps player sheets in navigation stacks with shared settings helpers.

Changes

iOS Player UI and Gesture Rework

Layer / File(s) Summary
PlayerViewModel playback state
iosApp/iosApp/Screens/Player/PlayerViewModel.swift
Adds hold-fast-forward state and methods, exposes current user volume, and updates skip methods with an option that affects controls auto-hide behavior.
MobilePlayerGestureLayer introduction
iosApp/iosApp/Screens/Player/iOS/MobilePlayerGestureLayer.swift
Adds the iOS gesture layer for tap, double-tap skip, hold fast-forward, edge drag brightness/volume, pinch video-gravity cycling, center dismiss, and transient feedback overlays.
PlayerView surface and gesture wiring
iosApp/iosApp/Screens/Player/PlayerView.swift
Mounts the gesture layer in the player stack and removes iOS gesture handlers from the player surface.
MobilePlayerControls overlay redesign
iosApp/iosApp/Screens/Player/iOS/MobilePlayerControls.swift
Rebuilds the overlay layout, scrubber, time row, action row, intro skip control, and button styling for the iOS player controls.
Track attribute pill labels
iosApp/iosApp/Screens/Player/PlayerTrack.swift, iosApp/iosApp/Screens/Player/Sheets/TrackSelectionSheet.swift
Refactors track attribute parts into pill labels and uses them in track selection rows for audio and subtitle tracks.
Sheet navigation restructuring
iosApp/iosApp/Screens/Player/Sheets/ChapterSheet.swift, iosApp/iosApp/Screens/Player/Sheets/TrackSelectionSheet.swift, iosApp/iosApp/Screens/Player/Sheets/PlayerSettingsSheet.swift
Wraps chapter and track sheets in navigation stacks, adds iOS settings navigation sections, and consolidates the sleep timer picker into a shared helper.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MobilePlayerGestureLayer
  participant PlayerViewModel
  participant UIScreen

  User->>MobilePlayerGestureLayer: single tap
  MobilePlayerGestureLayer->>MobilePlayerGestureLayer: toggle controls
  User->>MobilePlayerGestureLayer: double tap left/right
  MobilePlayerGestureLayer->>PlayerViewModel: skip ±10s
  MobilePlayerGestureLayer->>MobilePlayerGestureLayer: showSkipFlash
  User->>MobilePlayerGestureLayer: long press
  MobilePlayerGestureLayer->>PlayerViewModel: beginHoldFastForward(rate)
  User->>MobilePlayerGestureLayer: release
  MobilePlayerGestureLayer->>PlayerViewModel: endHoldFastForward()
  User->>MobilePlayerGestureLayer: edge drag (left)
  MobilePlayerGestureLayer->>UIScreen: adjust brightness
  User->>MobilePlayerGestureLayer: edge drag (right)
  MobilePlayerGestureLayer->>PlayerViewModel: adjust userVolume
  User->>MobilePlayerGestureLayer: pinch
  MobilePlayerGestureLayer->>MobilePlayerGestureLayer: cycle videoGravity
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main focus on redesigning iOS player controls and menus.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/great-herschel-c54546

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

@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: e2a190bc8b

ℹ️ 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".

Comment on lines +97 to +100
viewModel.skipBackward(10)
showSkipFlash(forward: false)
} else if x > size.width * (1 - Self.skipZoneFraction) {
viewModel.skipForward(10)

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 Keep double-tap skips from revealing controls

When the clean video view is double-tapped at either edge, these calls go through skipBackward/skipForward, and those methods call scheduleHideControls(), setting showControls = true. Because PlayerView places MobilePlayerControls above this gesture layer, the full-screen scrim is shown after the first skip, so subsequent double-taps hit the scrim instead of this handler and the new repeated double-tap skip gesture stops working; the flash is also rendered under the overlay. Use a skip path that does not reveal controls for this gesture, or keep the gesture active over the scrim.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c992dd8 — confirmed real: skipForward/skipBackward unconditionally called scheduleHideControls(), which force-shows the overlay. Both methods now take revealingControls (default true, so tvOS and the overlay buttons are unchanged) and the double-tap gesture passes false, keeping the scrim down, the flash visible, and repeated double-taps landing on the gesture layer.

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
iosApp/iosApp/Screens/Player/iOS/MobilePlayerControls.swift (1)

277-336: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make the custom scrubber VoiceOver-adjustable.

The capsule scrubber is drag-only right now, so VoiceOver users cannot seek. Add an accessibility label/value and an adjustable action that calls the same scrub path.

🤖 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/Screens/Player/iOS/MobilePlayerControls.swift` around lines 277
- 336, The custom scrubber in progressSlider is drag-only and lacks VoiceOver
seek support. Add accessibility metadata to the scrubber container in
MobilePlayerControls.progressSlider, including a clear label and value based on
the current playback position, and attach an adjustable action so VoiceOver can
increment/decrement seeking. Reuse the existing scrub path by routing the
accessibility action through the same beginScrub/updateScrub/endScrub flow
already used by the DragGesture and viewModel.
🧹 Nitpick comments (1)
iosApp/iosApp/Screens/Player/PlayerTrack.swift (1)

61-106: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Good extraction; consider reusing it in displayLabel too.

attributeParts()/attributesLabel/attributePillLabels are correct — join/empty-check behavior is preserved and the array export is a clean addition. However, displayLabel (lines 108-147) rebuilds almost the identical list (title, language, channel layout, codec, isDefault/isForced/isHearingImpaired/isExternal) by hand. Since this PR just introduced the shared builder, it's a good moment to have displayLabel prepend normalizedTitle to attributeParts() (only casing of "default"/"forced" differs) instead of duplicating the branches.

🤖 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/Screens/Player/PlayerTrack.swift` around lines 61 - 106,
`displayLabel` is still duplicating the same title/language/channel/codec/flag
assembly logic that `attributeParts()` now centralizes. Update `displayLabel` in
`PlayerTrack` to build on `attributeParts()` instead of manually repeating the
branches, prepending `normalizedTitle` and only handling the small casing
difference for default/forced as needed. Keep `attributesLabel` and
`attributePillLabels` as-is, and reuse the shared helper so the label logic
stays consistent in one place.
🤖 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/Screens/Player/iOS/MobilePlayerControls.swift`:
- Around line 168-203: The center transport buttons in
MobilePlayerControls.centerCluster are image-only and need explicit
accessibility labels. Add labels to the three Button elements for skip backward,
play/pause, and skip forward so they don’t rely on SF Symbol names; use clear
text like “Skip Back 10 Seconds”, a dynamic play/pause label based on
viewModel.isPlaying, and “Skip Forward 10 Seconds”. Keep the labels attached to
the existing Button actions and buttonStyle modifiers.

In `@iosApp/iosApp/Screens/Player/iOS/MobilePlayerGestureLayer.swift`:
- Around line 70-84: The long-press cleanup in MobilePlayerGestureLayer is only
handled via onPressingChanged, so if the view disappears while hold-fast-forward
is active the temporary rate can remain stuck. Update the gesture layer itself
by adding onDisappear alongside the existing onLongPressGesture in
MobilePlayerGestureLayer so it always calls viewModel.endHoldFastForward() when
the layer is removed, and make sure any transient hold-related task/state is
canceled there as well.

In `@iosApp/iosApp/Screens/Player/PlayerViewModel.swift`:
- Around line 2373-2377: The endHoldFastForward flow in PlayerViewModel is
restoring the playback speed unconditionally, which can resume a paused
AVPlayer. Update endHoldFastForward so it always clears isHoldFastForwarding,
but only calls activePlayer.setSpeed(settings.playbackSpeed) when the player is
still playing; otherwise leave playback paused and do not restore the rate.

---

Outside diff comments:
In `@iosApp/iosApp/Screens/Player/iOS/MobilePlayerControls.swift`:
- Around line 277-336: The custom scrubber in progressSlider is drag-only and
lacks VoiceOver seek support. Add accessibility metadata to the scrubber
container in MobilePlayerControls.progressSlider, including a clear label and
value based on the current playback position, and attach an adjustable action so
VoiceOver can increment/decrement seeking. Reuse the existing scrub path by
routing the accessibility action through the same
beginScrub/updateScrub/endScrub flow already used by the DragGesture and
viewModel.

---

Nitpick comments:
In `@iosApp/iosApp/Screens/Player/PlayerTrack.swift`:
- Around line 61-106: `displayLabel` is still duplicating the same
title/language/channel/codec/flag assembly logic that `attributeParts()` now
centralizes. Update `displayLabel` in `PlayerTrack` to build on
`attributeParts()` instead of manually repeating the branches, prepending
`normalizedTitle` and only handling the small casing difference for
default/forced as needed. Keep `attributesLabel` and `attributePillLabels`
as-is, and reuse the shared helper so the label logic stays consistent in one
place.
🪄 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: c17c2f1a-b517-41da-85fc-e27e572ec9c9

📥 Commits

Reviewing files that changed from the base of the PR and between 19f864f and e2a190b.

📒 Files selected for processing (9)
  • iosApp/iosApp/Screens/Player/PlayerTrack.swift
  • iosApp/iosApp/Screens/Player/PlayerView.swift
  • iosApp/iosApp/Screens/Player/PlayerViewModel.swift
  • iosApp/iosApp/Screens/Player/Sheets/ChapterSheet.swift
  • iosApp/iosApp/Screens/Player/Sheets/PlayerSettingsSheet.swift
  • iosApp/iosApp/Screens/Player/Sheets/TrackSelectionSheet.swift
  • iosApp/iosApp/Screens/Player/iOS/AirPlayRoutePicker.swift
  • iosApp/iosApp/Screens/Player/iOS/MobilePlayerControls.swift
  • iosApp/iosApp/Screens/Player/iOS/MobilePlayerGestureLayer.swift

Sim-driven visual polish:
- Shrink the overlay a step: smaller title block, 40pt top circles,
  34pt action pills, caption2 time labels, 6pt scrubber (12pt scrubbing)
- Center cluster: fixed-size circles (50pt skips, 64pt play/pause) so the
  family stays proportioned; play/pause is white prominent glass with a
  dark glyph instead of accent blue
- Tighten bottom padding so the scrubber and action row hug the screen edge
- Remove the AirPlay button: external playback is deliberately disabled on
  every route (keepsExternalPlaybackDisabledUntilValidated) and the
  CoreMedia pipeline can't AirPlay video, so the affordance was a lie
- Skip Intro pill matches the white-glass family and drops to 24pt above
  the bottom edge when the controls are hidden
- Track sheet: rows use .plain button style so names render label-colored
  (borderless List buttons tinted every row blue), middle-truncate long
  sidecar names
- Subtitle rows lead with the language; junk embedded titles (format
  names, codec/language repeats) are dropped and meaningful ones
  ("Dub (SDH)") demote to secondary text; language pill removed as
  redundant. Shared row builder, so tvOS gets the same treatment.

PR review fixes (Codex + CodeRabbit):
- Double-tap skip no longer summons the controls overlay: skipForward/
  skipBackward gain revealingControls (default true, tvOS unchanged); the
  gesture layer passes false so its flash stays visible and repeated
  double-taps keep landing on the gesture layer instead of the scrim
- Gesture layer ends hold-fast-forward and cancels transient tasks in
  onDisappear (layer can be torn out mid-press)
- Accessibility labels on the center transport buttons; the custom
  scrubber is now a VoiceOver-adjustable element seeking ±10s
- Correct the stale beginHoldFastForward comment: backends never start a
  paused clock on setSpeed, and endHoldFastForward intentionally restores
  the rate unconditionally so defaultRate can't stick at 2×

Co-Authored-By: Claude Fable 5 <[email protected]>
@Quick104

Quick104 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in c992dd8:

  • Codex (double-tap reveals controls) — fixed via a revealingControls parameter on the skip methods; the gesture layer opts out so the scrim never lands on top of it.
  • Center-button accessibility labels — added.
  • Gesture-layer onDisappear cleanup — added (ends hold-2×, cancels transient tasks).
  • endHoldFastForward resuming paused playback — not applied; both backends already no-op rate changes on a paused clock, and the unconditional restore is what keeps defaultRate from sticking at 2×. Details in the thread reply.
  • VoiceOver scrubber (outside-diff) — done: the scrubber is now an accessibility element with a position value and an adjustable action seeking ±10s through the same skip path.
  • Nitpick: reuse attributeParts() in displayLabel — skipped deliberately: displayLabel includes the language even when the track has no title (attributeParts requires one) and uses lowercase flag casing, so "deduplicating" would silently change Now Playing/diagnostic labels. Worth a follow-up if we want to unify the rules first.

Also includes a sim-driven visual polish pass (smaller control sizing, white-glass play/pause + Skip Intro, tighter bottom padding, AirPlay button removed since external playback is deliberately disabled on all routes, track sheet de-tinted, subtitle rows now language-first). All three schemes build; 250 tests pass.

Resolves the TrackSelectionSheet conflict: keep the redesigned iOS sheet
(NavigationStack, language-first subtitle rows, metadata pills) and fold
in main's provider "Search Subtitles…" entry beside "AI Subtitles…" in
the actions section, both availability-gated.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Quick104
Quick104 merged commit 79ef7ff into main Jul 2, 2026
1 check was pending
@Quick104
Quick104 deleted the claude/great-herschel-c54546 branch July 2, 2026 17:52
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.

1 participant