Skip to content

fix(web): show an administrator's stop reason and keep notices visible - #4554

Merged
Quick104 merged 6 commits into
mainfrom
fix/web-player-admin-notices
Nov 19, 2026
Merged

Quick104 merged 6 commits into
mainfrom
fix/web-player-admin-notices

Conversation

@Quick104

@Quick104 Quick104 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: changes #1207 C1 (what the viewer sees after an administrator stop, terminate or message); reaches #1206 C1 (message payload without an empty title)

Other clients: Apple Silo-Server/silo-apple#1225; Android Silo-Server/silo-android#1001; Roku N/A (the Roku app has no playback control socket and receives no administrator commands)

When an administrator stops or terminates someone's playback with a reason, the viewer never sees the reason. The web player closes to the title page with no notice at all. A message sent while the web player is minimized is accepted by the server and never shown. A developer integrating a third-party monitor reported all three after a first live test.

The web player now shows the reason, keeps the notice on screen after the player closes, and shows messages while minimized. Stacked on #4553, which shares its documentation.

Approach

The server sends an administrator's reason in the command frame's top-level reason. The web player read only the frame's payload, which a stop or terminate does not have, so the reason was dropped.

  • Stop and terminate. The player closes at once, so a notice inside it cannot be read. The notice is now a page toast that stays for 8 seconds on the screen the viewer lands on, with the administrator's reason as its description. It shows once: the later "session ended" answer from the server does not add a second toast.
  • Minimized player. Server messages render inside the player only in the foreground. A minimized or detached player now shows them as a page toast at the top centre, clear of the minimized player along the bottom edge.
  • Untitled messages. The server sent "title":"" for a message with no title. It now omits the key, so a client's own default title applies.

The playback protocol doc now describes the command frame in one place, including where reason travels. No new interface text: the toast reuses the existing "An administrator ended this playback session." string.

Not changed: when the player misses the command and learns of the end from a refused progress write, no reason is shown, because that answer carries none. And a message sent to a player whose connection died without closing is still answered 202 for up to 30 seconds, until the server's ping times out. The API documents 202 as "written to the socket".

jellycompat clients do not use this command channel. The user manual does not describe these notices.

Validation

  • Go tests for the handlers and apiv2 packages pass, including a new check of the untitled message payload. Web typecheck and the player test files pass on this branch.
  • OpenAPI and web types regenerate with no diff. Changed-line lint passed on the implementer's branch before I split it; it was not rerun on this branch.
  • In a browser against an isolated sandbox, with commands sent by a key holding admin:monitor:read and admin:sessions:control: stop with a reason, terminate with a reason, and a message to a minimized player, each captured before and after at desktop width (1280x720) and phone width (390x844). The "before" captures use the base branch's web app against the same server.
  • The first version put the minimized-player toast in the usual bottom corner, where it covered that player's controls at both widths. It now shows at the top centre. Measured on the page, it clears the minimized player at both widths; at phone width it covers the page header for its 8 seconds.
  • Not checked in a browser: the untitled message payload. The Go test covers it.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-4554/

Risks

None identified.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code, GitHub CLI
  • Model(s): claude-opus-5-5 (implementation and sandbox testing), claude-fable-5-2 (triage, review of the full diff, split into single-concern branches, this description)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: none yet beyond the second model's read of the full diff; no independent adversarial pass has run

🤖 Generated with Claude Code

Note

Fix admin stop reasons and notice visibility in VideoPlayer, converge repeat terminates

  • Shows the administrator's stop reason as a warning toast when a stop or terminate command arrives with no payload message, and keeps notices visible with a fixed SESSION_ENDED_TOAST_ID so it can replace or suppress the generic session-ended toast. Detached players now route server notices to page-level toasts at top-center.
  • Makes repeated terminate requests converge: terminateLocal recognizes ErrSessionEndedByAdmin (a new sentinel wrapping playback.ErrSessionNotFound), returns the already-revoked receipt, drops the command ledger, and does not notify the player again. Player-ended attempts stay not-found.
  • claimNativeEnd now distinguishes an earlier winning stop from one established by the current call, so the admin-end handler can detect prior administrator stops. Untitled display-message commands emit a payload without a title field.
  • Behavioral Change: repeated terminates now return a converged receipt instead of an error; check terminateLocal in admin_playback_terminate.go and endSessionAsAdmin in playback_end_claim.go if consumers relied on the old not-found outcome.

Macroscope summarized 33fa3a2.

Quick104 and others added 2 commits November 19, 2026 03:09
A terminate of a session the server already ended for an administrator
answered 404, although the receipt schema promises already_revoked. The
end claim read the stopped attempt row and discarded it. It now reports
the earlier stop, and a terminate that finds an earlier administrator
stop answers 200 with already_revoked, delivery none, and dispatches
nothing, locally and through the cross-replica relay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The server sends an administrator's reason in the command frame's
top-level reason, and the web player read only the payload, so the
reason never showed. A stop or terminate now shows it in a page toast
that stays on the screen the viewer lands on. A server message that
arrives while the player is minimized shows as a toast too, and an
untitled message no longer carries an empty title.

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 Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 31c65e76-6a75-4e45-92f2-34435e0a64b2
Commits

Reviewing files that changed from the base of the PR and between 53154a1 and 33fa3a2.

Files selected for processing: 13

  • contracts/api/v2/openapi.json
  • docs/admin-api.md
  • docs/architecture/playback-protocol-v3.md
  • internal/api/handlers/admin_playback_commands.go
  • internal/api/handlers/admin_playback_commands_test.go
  • internal/api/handlers/admin_playback_relay_test.go
  • internal/api/handlers/admin_playback_terminate.go
  • internal/api/handlers/admin_playback_terminate_test.go
  • internal/api/handlers/playback_end_claim.go
  • internal/apiv2/admin_playback_commands.go
  • internal/apiv2/admin_playback_terminate.go
  • web/src/api/v2/schema.ts
  • web/src/player/components/VideoPlayer.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T16:22:19.955425Z 33fa3a2 New commits
🔒 Security Review ✅ Completed 2026-11-19T16:24:32.021583Z 33fa3a2 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.

@silo-triage silo-triage Bot added bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes go Pull requests that update go code impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish stacked Base is another open PR; merge in stack order named in the body labels Nov 19, 2026
@silo-triage

silo-triage Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Resolved: the requested phone-width before-and-after captures for stop/terminate reasons and minimized-player messages have been added and checked.

Original request

Please add phone-width before-and-after captures for stop/terminate reasons and messages to the minimized player, or show why those changes do not affect mobile web. The Validation section says the captures are desktop-only; CONTRIBUTING.md treats desktop and mobile web as separate surfaces for visible changes.

The minimized player sits along the bottom edge, where page toasts
appear, so the notice covered its time labels and its Pause, Watch and
Close buttons for eight seconds at desktop and phone width.

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

Copy link
Copy Markdown
Contributor Author

Phone-width captures are on the evidence page now: before and after at 390x844 for a stop with a reason, a terminate with a reason, and a message to a minimized player.

They showed a layout problem in the first version: the minimized-player toast sat in the usual bottom corner and covered that player's controls, at desktop width too. 643370c moves that one toast to the top centre. The recaptures on that commit, with measurements, show it clear of the minimized player at both widths. At phone width it covers the page header for its 8 seconds.

Evidence: https://evidence.siloserver.org/r/silo-server/pr-4554/

@silo-triage silo-triage Bot removed the evidence-required Needs before-and-after evidence before the Evidence check passes label Nov 19, 2026
Quick104 and others added 2 commits November 19, 2026 16:08
…attempt row records

A player that confirms an administrator's stop over the control socket can
win the attempt row under the administrator stop id, so a later terminate
converges instead of answering 404. Describe the answer by which stop the
row records, and cover the converged repeat in client_notified.

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

@Quick104 Quick104 left a comment

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.

🤖 Claude Code (claude-opus-5-5)

Four findings: one player regression, one double toast, and two docs corrections. The server change is safe for the other apps. Apple reads the message title as optional and falls back to its own default, Android ignores it, and the new Go check fails on the base with "title":"".

Comment thread docs/admin-api.md Resolved
The command marked the session's end as handled, so a stop that arrived
while Minimize was flushing (when handleExit returns early) also skipped
the exit the later 410 would have made, leaving the mini player open.
Track the shown notice in its own ref so only the toast is deduplicated,
and give both notices one toast id so a command after a 410 replaces the
generic notice with the reason.

Docs: a stop or terminate frame carries an empty payload, an
administrator's restart reason defaults to a machine code, and the reason
is shown by players that support it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104

Copy link
Copy Markdown
Contributor Author

🤖 Claude Code (claude-opus-5-5)

Review summary

Reviewed head: 33fa3a26a (the author's 643370c2e, a merge of #4553's current head 28ec69b21, and one fix commit from this review).

The web player now shows an administrator's stop or terminate reason as a page toast that outlasts the player, shows server messages while it's minimized, and the server drops an empty title from message payloads. The approach is right: the reason already travels in the command frame's top-level reason, and the player simply never read it.

Addressed (33fa3a2)

  • An administrator's stop that arrived while Minimize was flushing progress left the mini player open. The stop's handleExit() returned early, and the new flag then stopped the later 410 from exiting. The stop now records only that its notice was shown, so the 410 path still exits.
  • A 410 that arrived just before the command showed two toasts. Both now share one toast id, so the reason replaces the generic notice.
  • playback-protocol-v3.md now says a stop or terminate frame carries an empty payload object, and that an administrator's restart reason defaults to a machine code.
  • docs/admin-api.md and the reason OpenAPI text now say players that support it show the reason. The beta audiobook player doesn't yet.
  • Merged fix(playback): answer a repeat terminate with the converged receipt #4553's new head into this branch. The contract artifacts regenerate with no diff.

Left for the maintainers

  • A server notice already on screen in the foreground player is hidden when the viewer minimizes, until they restore it. This happens the same way on main. Only messages that arrive while the player is minimized get the page toast.

Validation

User manual: unaffected. The active-playback page doesn't say where the viewer sees a reason or a message.
Other clients: Apple Silo-Server/silo-apple#1225 and Android Silo-Server/silo-android#1001 are linked. Roku has no command channel. Apple reads the message title as optional and Android ignores it, so omitting the empty key is safe for both. No new interface text.

Fit: 9/10 · Readiness: 8/10 — conditional (assuming CI is green)

Fit: it closes a gap in a core 1.0 feature using text and fields that already exist, without adding a setting. Readiness: the main behaviour is shown live and by a test that fails on the base. The condition is the minimize-race fix, which has been checked against the source and the existing tests but not in a browser.

Base automatically changed from fix/admin-terminate-repeat to main November 19, 2026 17:13
@Quick104
Quick104 merged commit 9a180df into main Nov 19, 2026
24 of 25 checks passed
@Quick104
Quick104 deleted the fix/web-player-admin-notices branch November 19, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority. stacked Base is another open PR; merge in stack order named in the body

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant