Skip to content

feat(player): show the server quality menu on phone and align the TV picker - #495

Merged
Quick104 merged 2 commits into
mainfrom
feat/player-quality-menu
Oct 7, 2026
Merged

Quick104 merged 2 commits into
mainfrom
feat/player-quality-menu

Conversation

@Quick104

@Quick104 Quick104 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: changes #330 C2 and #331 C2 (the quality list a TV sends to a phone remote now starts with Auto and names the source entry "Original")

Phone viewers cannot choose a streaming quality. The player's "Quality" button and the gear sheet's Quality row open a list of the title's files, so the server's quality menu (Original, 1080p High, 720p Medium and so on) is not reachable on phone at all. On Android TV the Quality picker shows the server's entries, but the source entry reads as the raw label "original", there is no Auto row to hand the choice back to the server, no bitrates, and no clear mark on the active entry.

This change gives the phone a real Quality menu, renames the file list to Version, and brings the TV picker in line with the web player's menu.

Approach

Both apps build the menu from the playback plan's available_qualities: Auto first, then every server entry in server order. Each row shows the server's display name (or "Original" for the source entry, else the label) and its bitrate, such as "40.5 Mbps" or "1.5 Mbps", with a check on the active entry. A pick sends the entry's label verbatim through the existing quality_change replan; Auto sends auto. The naming, bitrate formatting, and active-entry rules are in shared, so phone and TV agree. The active-entry rules follow the web player, including how a stored preference such as 1080p maps onto the plan's entries, judged against what the plan actually delivers when a bitrate cap holds it lower. Unlike the web player, the control is shown whenever a plan is active: a plan with a single entry lists Auto and Original, as the Apple clients do, and that entry is marked whenever the preference is anything but Auto. Only playback without a plan, such as a download playing offline, has no Quality control.

Phone:

  • The toolbar's Quality button and a new gear-sheet Quality row open the new menu. Both show whenever a plan is active, including in a Watch Party, where the menu says that Watch Party keeps everyone on the same version.
  • The file list is now a Version sheet, reached from a separate gear-sheet Version row and the compact toolbar overflow. As before, it shows only for a title with more than one file and never in a Watch Party. The wide toolbar no longer has a version button.
  • A quality picked during playback now carries through later replans, seek recoveries, and reloads of the same title (recovery restarts, retries, the next shuffle part); in a Watch Party it carries through restarts within the same room selection, which also applies to the lower-quality offer. Before this, only that offer could change quality on phone. Picking a different version, moving to another title, or a route that names its own quality drops the pick.
  • A failed quality change now says "Couldn't change quality. Try again." instead of the subtitle failure message. The Watch Party lower-quality offer uses the same path and gets the same wording.

TV: the Quality picker gains the Auto row, "Original", bitrates, and the check. The row is now enabled for a single-entry plan too, where it used to be disabled.

This pairs with the server change "feat(playback): offer lower qualities from a lower-resolution version when 4K transcoding is off" (Silo-Server/silo-server#2030) but does not depend on it. Any plan's entries render the same way, including that change's plain-resolution entry such as "1080p".

Validation

  • ./scripts/test-check-build-supply-chain.sh and ./scripts/check-build-supply-chain.sh: pass.
  • ./gradlew testDebugUnitTest: pass. New shared tests cover menu order, naming, bitrate formatting, and active-entry resolution, including stored resolution preferences and bitrate-capped plans; the TV option tests were updated for the Auto row and the single-entry menu, a transaction test checks that a failed quality change is told apart from a subtitle failure, a view-model test checks that a same-title retry starts with the picked quality and another title does not, and a phone test checks that a bitrate-capped plan marks the delivered entry.
  • Android lint (:android-shared:lintDebug :androidApp:lintDebug :androidTvApp:lintDebug :androidApp:lintVitalRelease :androidTvApp:lintVitalRelease): pass, no findings in the changed files.
  • :androidApp:assembleDebug and :androidTvApp:assembleDebug: pass.
  • Phone emulator against a test server with 4K transcoding off, playing Hidden Figures: picking 720p High moved playback from the 1080p file played directly to a 1720x720 HLS stream at the same position, and picking Auto returned to the 1080p file.
  • Android TV emulator, same server and title: picking 720p Medium switched to a 1720x720 stream, and Auto switched back.
  • Not exercised: a single-entry plan (the test title always offers several entries), a failed quality change, Watch Party on phone, a seek past the buffer after a quality pick, the Silo Cast remote's quality list, the compact phone toolbar overflow, and offline playback.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-android/player-quality-menu/

Surface and build: Android phone emulator and Android TV emulator; before from main at 9343dde, after from this branch before its rebase. The later commits (single-entry menus, the failure message, the review fixes) do not alter the screens shown.

Not shown, on purpose: the single-entry menu (Auto and Original, with the TV row enabled), the "Couldn't change quality. Try again." message, and the Watch Party note in the phone menu. The test title always offers several qualities, the message needs a failed replan, and the note needs a Watch Party room. Unit tests cover the single-entry menu and the failure message.

Risks

  • The TV now includes an Auto row in the quality list it reports to Silo Cast remotes, and selects it when the preference is Auto. Remotes that send the old -1 Auto id still work.
  • On phone, a quality pick now persists for the rest of the title.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: n/a

🤖 Generated with Claude Code

…picker

The phone player had no way to pick the server's playback qualities: its
"Quality" sheet listed file versions instead. It now has a Quality menu
built from the plan's available_qualities (Auto first, then each entry in
server order with its bitrate and a check on the active one), shown
whenever a plan is active, and the file list becomes a separate Version
sheet. A failed quality change now says so instead of reporting a
subtitle failure.

The TV Quality picker gets the same Auto row, "Original" name, bitrates
and check. On both, a single-entry plan lists Auto and Original, as the
Apple clients do.

Naming, bitrate formatting and active-entry resolution live in shared so
both apps render the menu the same way.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T12:47:15.772011Z 85773fe New commits
🔒 Security Review ✅ Completed 2026-10-07T12:54:23.774836Z 85773fe New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a5b7781d-0014-4b7b-b46b-58728de12126
📥 Commits

Reviewing files that changed from the base of the PR and between db9ec43 and 85773fe.

📒 Files selected for processing (7)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackQualitySheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileQualityMenuTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelLoadOwnershipIntegrationTest.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackModels.kt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds shared playback-quality menu construction and selection logic. Phone playback separates streaming-quality selection from file-version selection and tracks quality transactions. The TV player builds quality options from the shared menu and displays bitrate labels.

Changes

Playback quality selection

Layer / File(s) Summary
Build and resolve playback quality options
shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackQualityMenu.kt, shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackModels.kt, shared/src/commonTest/kotlin/org/siloserver/silo/model/playback/PlaybackQualityMenuTest.kt, android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.kt
The shared model builds an Auto option and server-provided quality options, formats names and bitrates, and resolves the active option from preferences and the delivered recipe. Playback plans expose the effective recipe. Tests cover the menu and selection rules.
Apply and track phone quality selections
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapter.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt, androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapterTest.kt, androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileQualityMenuTest.kt, androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelLoadOwnershipIntegrationTest.kt
The phone view model submits valid quality selections and retains the committed preference under title and room conditions. The transaction adapter identifies quality-change failures, and the view model displays a quality-specific message. Tests cover selection retention, reloads, and failure classification.
Separate phone quality and version controls
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackQualitySheet.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerControls.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/VersionSelector.kt, docs/watch-party-implementation-plan.md
Phone controls open a quality sheet when options exist, including during room playback. A separate version sheet appears when multiple files are available outside rooms. The settings and toolbar controls show the corresponding actions and labels.
Display quality options in the TV player
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerHud.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt, androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlaybackQualityOptionsTest.kt
The TV player builds HUD options from the shared quality menu and uses the delivered recipe to mark the active option. The HUD shows bitrate labels and displays Quality for any nonempty option list. Tests cover menu entries and selection.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant PlaybackQualitySheet
  participant PlayerOverlay
  participant PlayerViewModel
  participant MobileSubtitleTransactionAdapter
  PlaybackQualitySheet->>PlayerOverlay: selected quality ID
  PlayerOverlay->>PlayerViewModel: onSelectQuality
  PlayerViewModel->>MobileSubtitleTransactionAdapter: submit quality selection
Loading

Suggested reviewers: rxwatcher

Merge Risk: ⚪ Minimal · up to 85773

The supplied evidence identifies no actionable issue blocking the phone and TV quality-menu changes after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.83% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 72 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main changes: adding the server quality menu on phone and aligning the TV picker.
Description check ✅ Passed The description explains the phone and TV quality-menu changes, implementation approach, validation, and known gaps. It is directly related to the changeset.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Quick104 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Evidence: SOFT FAIL

The diff touches both phone (androidApp) and Android TV (androidTvApp), and the Evidence says both emulators were captured before and after, so the main quality menu is covered on both surfaces. What's missing is a few user-visible changes the PR itself says weren't captured:

  • The new failure message, "Couldn't change quality. Try again." (phone, and the Watch Party lower-quality offer).
  • The single-entry menu (Auto plus Original), including the TV Quality row that used to be disabled and is now enabled.
  • The phone menu's Watch Party note saying everyone stays on the same version.

The captures also come from a pre-rebase build rather than head db9ec43. The checklist says Evidence shows every change a user can see, so please either add captures of these states from the current head or say plainly in the Evidence section that they're intentionally not shown.

Grok commenting on Quick's behalf.

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

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

… delivered entry

Reloads of the same title (recovery restarts, retries, the next shuffle
part) now start with the quality picked from the menu instead of the
route's quality. The phone's Quality check, gear label and same-entry
guard now read the plan's delivered recipe, so a stored resolution
preference held lower by a bitrate cap marks the entry that plays, as the
TV already does.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Quick104 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

The Evidence section now says which states are not shown and why: the single-entry menu, the failure message, and the Watch Party note. The test title always offers several qualities, the message needs a failed replan, and the note needs a Watch Party room. Unit tests cover the single-entry menu and the failure message. The later commits, including 85773fe, do not change the captured screens.

Claude Code (claude-opus-5-5) commenting on Quick's behalf.

@Quick104
Quick104 merged commit 95d20a9 into main Oct 7, 2026
7 checks passed
@Quick104
Quick104 deleted the feat/player-quality-menu branch October 7, 2026 13:42
Quick104 added a commit that referenced this pull request Oct 7, 2026
Brings in #487, #492, #493, #495 and #496. Only #495 (server quality
menu) overlapped the restyle:

- Phone: the Quality pill opens the plan's quality menu whenever a plan
  exists. The file picker becomes the Version menu, reached from the
  settings menu, which gains a Version row. Both use the new player menu
  chrome, so the Quality menu docks on the right in landscape like the
  other player menus.
- TV: the options panel keeps the restyled layout and takes #495's
  Quality row (Auto first, bitrates as the row's trailing value).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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