Skip to content

feat(remote): show only subtitle languages in the phone remote - #860

Merged
Quick104 merged 12 commits into
mainfrom
feat/remote-subtitles-language-only
Oct 21, 2026
Merged

Quick104 merged 12 commits into
mainfrom
feat/remote-subtitles-language-only

Conversation

@Quick104

@Quick104 Quick104 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

The phone remote's Subtitles menu listed the tracks, eleven delay offsets and three positions. iOS also showed it in reverse, because the menu opens upward from the bottom of the screen, so the subtitle languages sat at the very bottom. Android listed the same items top-down, so the two phone apps disagreed.

The Subtitles menu now lists Off and the subtitle tracks, the same as silo-android.

Approach

  • Subtitles shows Off and the tracks. Delay and position stay in the TV's own player menu, where they're adjusted while watching. The TV still accepts both commands, so other controllers can keep sending them.
  • The remote's Quality, Audio, Subtitles and Speed menus keep a fixed order (.menuOrder(.fixed)), so they read top-down like Android's.
  • The menu model drops the delay and position fields, so delay changes no longer redraw the menus.

The matching Android change is Silo-Server/silo-android#654. Stacked on #858.

Validation

  • iOS SiloTests, SiloControl suites: 42 tests pass.
  • iPhone simulator on an Android TV emulator: the old build lists nine delays above Track, English and Off. The new build lists Off and English, top-down, and selecting a track still works.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-apple/pr-860/

Surface and build: iPhone simulator, before on #858 (1c5523eb), after on this branch. The iPad remote uses the same view. The Apple TV and Mac don't have this remote.

Risks

None identified. Subtitle delay and position remain available on the TV.

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 in T3 Code
  • Tool(s): Claude Code, GitHub CLI, xcodebuild, Android emulator and adb
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated; human verification of the diff is pending
  • Adversarial review: n/a, a menu reduction requested by the maintainer

🤖 Generated with Claude Code

Note

Support multiple phone controllers on tvOS and simplify remote subtitle menu to language tracks only

  • Rewrites TVControlReceiver to accept up to 8 concurrent controllers, each with independent authorization, heartbeat, handoff, and command-budget state (40-command burst, 20/sec refill) in TVControlReceiver.swift. At the cap it evicts silent, then idle, then passive controllers before refusing.
  • Adds a replacement-consent flow: a handoff that would replace another profile's on-screen title is refused with a now-playing summary, and the phone shows a Replace alert and relaunches with explicit consent for that content ID.
  • Adds resume tokens (64-char hex, constant-time comparison) so a different connection can reuse a handoff identity, and reason-bearing close frames with feature negotiation during hello.
  • Updates the phone remote menu to drop subtitle delay and position controls and show only subtitle tracks plus Off, per the stated intent.
  • Broad wire compatibility: unknown message types decode as unsupported, and older peers decode without the new optional fields; covered by new test suites.
  • Risk: togglePlayPauseOptimistic in SiloControlClient.swift now sends explicit play or pause commands instead of a toggle; legacy TVs always forget the target on close per SiloControlPhonePolicy.swift.

Macroscope summarized 4602153.

Quick104 and others added 11 commits October 20, 2026 12:51
The Apple TV kept one SiloControl session and evicted it whenever another
device connected. Two people with the app open kept kicking each other off
(a phone's silent auto-resume was enough), and an integration such as Home
Assistant couldn't stay connected without taking over the remote.

The receiver now keeps up to 8 controllers, each with its own connection,
heartbeat and authorization. The player, the temporary phone identity, the
one in-flight handoff and the standby screen are shared:

- State goes to every authorized controller; errors only to the sender.
- A new connection from the same device replaces its older socket. At the
  cap, a connection that never said hello goes first, then the oldest
  passive one; otherwise the newcomer is refused.
- Launch readiness belongs to one controller and one identity generation,
  so an earlier phone can never launch under a later phone's profile. A
  newer handoff supersedes a pending one.
- Reusing an identity without approval needs the connection that set it up
  or a resume token, not a matching self-reported device ID.
- A handoff that would replace a title another profile started is refused
  with `replace_confirmation_required` and what is playing, so the phone can
  ask and resend with `replaceConfirmed`.
- Passive controllers never show the standby screen, and the TV's
  Disconnect leaves them connected.
- Per-controller command rate limit, per-controller reauthorization after
  the identity changes, and an unused identity is handed back even if its
  phone already left.

Every wire addition is optional and gated on hello `features`. Phones that
don't list them keep today's behavior, including newest-launch-wins, and
never receive a close reason or other new payload.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Apple TV can now keep several controllers connected, but the phone
still behaved as the only one: it toggled play/pause, treated every close
as a takeover, could not answer the TV's request to confirm a replace, and
its silent auto-resume looked like an active remote to the TV.

The phone now:

- Lists `close_reason`, `resume_token` and `replace_confirmation` in its
  hello, and marks a silent auto-resume `passive` so it never puts up the
  TV's standby screen. Once the user engages, it sends `presence` (new,
  only to TVs that list it) so the TV treats it as an active remote again.
- Follows the TV's close reason when the TV keeps several controllers: a
  timeout reconnects, Disconnect forgets the TV, the rest end the session
  but keep the TV for a later foreground. Older TVs keep today's handling.
- Keeps the resume token from `handoff_ready` in memory and offers it on a
  later connection to the same TV, server and profile.
- Asks "Replace What's Playing?" when the TV reports another profile's
  title, naming who is watching what, and resends with `replaceConfirmed`.
- Sends `play` or `pause` for what the remote shows instead of
  `play_pause`, so two people pressing at once don't cancel out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The phone already asks "Replace what's playing?" before sending a different
title to an engaged TV. Confirming it didn't tell the TV, so the TV's new
replace check refused the launch and the phone asked a second time.

The router's remote playback interceptor now carries whether the user
confirmed, and confirming the existing dialog launches with
replaceConfirmed set. The TV still asks when the phone didn't: resuming the
same title another profile is watching, or a controller that isn't a Silo
phone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sent to a title

Fixes from an independent review of the multi-controller receiver.

- A phone whose handoff another device's play superseded keeps its session
  and shows the TV's message, instead of disconnecting.
- A replace confirmation now names the title the user agreed to replace
  (`replacingContentId`). If a different title started while they decided,
  the TV asks again.
- Sending a title from a silently resumed session marks it active through
  `presence`.
- The capacity refusal's `close` carries `too_many_controllers`, so the
  refused phone doesn't forget the TV. Shipped decoders ignore the payload.
- At the cap, an idle cross-server controller goes before passive ones;
  nothing else timed it out.
- A same-device hello replaces older sockets only once the TV keeps it, so a
  refused hello can't close a working connection.
- A cross-server phone whose own profile ended no longer gets a misleading
  server-mismatch error.
- The 500 ms state timer runs only while an authorized controller is
  connected, as before this branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…pping the connection

SiloControlMessage decoded `type` through a closed enum, so a frame with a
type this build doesn't know threw, and FramedJSONSession tore the whole
connection down on that decode error. Any message a newer peer adds would
end the session on older Apple builds. Android already drops unknown types.

Unknown types now decode to `.unsupported(type:)`, which TVControlReceiver
and SiloControlClient log and ignore. A known type with a malformed payload,
or a frame with no `type`, is still a decode error. The v2-only checks in
TVControlReceiver and SiloControlClient.prepareRemoteIdentity now accept any
negotiated version from 2 up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aces it

On Apple TV, Play on a detail page (also how Continue Watching starts)
pushes the player as a navigation route. The remote receiver stopped
playback by clearing `router.presentedPlayer`, which only closes the cover,
so a pushed player kept playing. Its cleanup never ran: a phone's Stop left
it on screen while the receiver reported Ready, and a handoff waited about a
second for that cleanup, swapped the profile under the live player, and then
showed the phone's title on top of it. The hidden player kept failing its
progress reports with `authority_changed`, and Menu brought it back.

The receiver now calls `PlayerViewModel.stopAndClose()`, which runs
`cleanup()` at once and asks the view to close itself, as the server's
realtime stop already does. That works for a cover and a pushed route, and
the handoff's wait now covers the real server-session teardown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fs at the cap

From review on #856.

- A handoff checked for another profile's title only when the offer
  arrived. While the server approved it, another controller could start a
  title, and the swap then stopped that title without asking. The check now
  runs again just before playback stops; if consent is now needed, the
  controller gets `replace_confirmation_required` with the current title.
- At the controller cap, a passive controller in the middle of a handoff
  is no longer evicted, which cancelled its handoff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… away

When a multi-controller TV closed a session without forgetting it, for
example because it was full, it sent the reason as an error and then a
close, and the phone hid the remote cover while clearing the session. The
user tapped Play and saw nothing. The phone now keeps an open cover up
with the TV's error, as it does when a reconnect gives up. A TV Disconnect
still forgets the TV and closes the cover.

From review on #856.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The replace prompt names who is watching. Under a borrowed identity with no
profile name, which is every handoff from today's Android phones, the TV fell
back to its own signed-in profile and named the wrong person. Under a
borrowed identity the TV now uses only that identity's name, and the prompt
says "Someone" when it has none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An Android TV shows "Starting <title>" while a phone's profile handoff
runs, from the offer's display-only `title`. Android phones send it;
iPhones and iPads didn't, so the TV said "Starting playback".

The phone now sends the same wording silo-android does: an episode as
"Series · S1 · E2", anything else by its title. It reads the cached item
detail, or fetches it alongside the endpoints lookup and drops it after
300 ms, as Android does, so the offer is never held up. The field is
optional; the Apple TV ignores it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The remote's Subtitles menu listed tracks, eleven delay offsets and three
positions, and iOS reversed it because the menu opens upward from the
bottom of the screen. Android showed the same items top-down.

The menu now lists Off and the subtitle tracks only, the same as
silo-android. Delay and position stay in the TV's own player menu, which
is where they are adjusted while watching. The remote's menus keep a
fixed order so they read top-down like Android's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2954d917-7c32-4544-a36d-847d8b01ee5c
📥 Commits

Reviewing files that changed from the base of the PR and between fffcc1e and fbabd1d.

📒 Files selected for processing: 1
  • iosApp/iosApp/Control/iOS/SiloControlRemoteView.swift
  • Autofix · 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.

@macroscopeapp

macroscopeapp Bot commented Oct 21, 2026

Copy link
Copy Markdown

The Subtitles menu now shows only Off and subtitle tracks, removing the delay and position choices — evidence is missing for iPhone Duo folded, iPhone Duo open, and iPad; add before-and-after captures of the same remote screen with the same playback data for each.

The Quality, Audio, Subtitles, and Speed menus now use fixed top-down item ordering — evidence is missing for iPhone Duo folded, iPhone Duo open, and iPad; add before-and-after captures of the same menus with the same data for each.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@silo-triage silo-triage Bot added enhancement New feature or request evidence-required Needs before-and-after evidence before the Evidence check passes impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish stacked Stacked on another open PR or branch labels Oct 21, 2026
@Quick104
Quick104 changed the base branch from feat/silocontrol-offer-title to main October 21, 2026 01:23
@silo-triage silo-triage Bot added size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. and removed size/M 50–199 added + deleted lines (all files); change volume, not priority. labels Oct 21, 2026
…-language-only

# Conflicts:
#	iosApp/Tests/SiloControlTests.swift
#	iosApp/iosApp/Control/iOS/SiloControlClient.swift
#	iosApp/iosApp/Control/iOS/SiloControlPhonePolicy.swift
@silo-triage silo-triage Bot added size/M 50–199 added + deleted lines (all files); change volume, not priority. and removed size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. labels Oct 21, 2026
@silo-kody

silo-kody Bot commented Oct 21, 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 ❌

@macroscopeapp

macroscopeapp Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Two additional visible changes also need evidence:

  • SiloControlRemoteView.swift adds a “Replace What's Playing?” prompt and confirmation flow. The Evidence section identifies iPhone simulator captures but does not identify a recording of this flow; add recordings for iPhone, iPhone Duo folded and open, and iPad.
  • TVControlStandbyState.swift and TVControlReceiver.swift change the Apple TV standby label to count other waiting controllers. Although the Evidence section says Apple TV has no remote, this change reaches the tvOS standby screen; add before-and-after captures of that screen with multiple waiting controllers.
  • SiloControlClient.swift changes Play/Pause to send an explicit play or pause command rather than a toggle, changing playback when controllers act concurrently. The Evidence section does not identify this interaction; add a recording with multiple controllers on iPhone, iPhone Duo folded and open, and iPad, showing the Apple TV playback response.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@Quick104
Quick104 merged commit edbd0cf into main Oct 21, 2026
9 checks passed
@Quick104
Quick104 deleted the feat/remote-subtitles-language-only branch October 21, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request evidence-required Needs before-and-after evidence before the Evidence check passes impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority. stacked Stacked on another open PR or branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant