Admin: Swap and Play show what they are doing, step by step, and nothing on the page jumps #163

Closed
opened 2026-11-14 12:25:01 -05:00 by cmoriarty · 1 comment
Owner

What happens

The owner pressed Swap and Play on a live game (Miami vs. Duke, 2026-11-14, web player and Emby) right after #161 shipped. Every action worked on the server, but the page did not show it well:

  • Swap: "You click it, the button gets disabled, and nothing happens for a few seconds, and then a banner appears and jerks the button down (the banner should not jerk the button positions), and you have to look at the Log to know what happened."
  • Play: the row says Reading, "which is useful, but it seems like the current playing stream should be in the top summary somewhere."
  • Overall: "the user experience should be improved for the user to see the operation happening, perhaps a progress bar or some other indicator showing ACCURATE information about what is happening (not just an infinite spinner)."

Why an action takes seconds

The server does real work in steps, and the page sees none of them until the answer comes back:

  • Swap to a ready standby: the standby is taken at once, then its playlist and first segments are loaded (the seconds of nothing), and the new stream is listed to players only after the segments already buffered ahead of it.
  • Play on a link that is not a standby: the link's page is read, the stream is checked, and only then is it loaded and spliced in the same way.
  • Swap with no standby: the link is dropped at once and the channel finds another the way a recovery does.

The idea

  • The server keeps the action as it runs: which action, from which link to which, its steps in order with each step's seconds, the step it is on, and how it ended. For the buffer step it says how many buffered segments are still ahead of the new stream.
  • The page shows it beside the buttons, as a field: the action and its target as the label, the step it is on with its seconds as the value, and a bar with one segment per step. A step with a known length (the buffer playing out) fills as it goes; a step without one shows only its elapsed seconds. No spinner.
  • The result stays in the same place for half a minute: when the new stream was listed to players, or in red why the action failed.
  • Nothing on the page moves when an action starts, reports or ends. The banner above the page goes, on every Admin page; each page's line goes in its own header.
  • The summary names the link playing: a Link field with the site and its stream letter, which marks itself briefly when it changes.
  • The row pressed in Links shows the step the server is on, in place of "Reading".

Data it needs

  • GET /api/channels/{game_id}/operation: the action in flight or just ended, small enough to read twice a second while one runs.
  • The same object on the channel in the admin view, so a page opened in the middle of an action shows it.
  • The first sequence number of a newly adopted stream, to tell when its first segment is listed to players.

Done when

  • Pressing Swap or Play shows the first step at once and each later step as the server reaches it, with seconds that match the server's.
  • The last step says when the new stream was listed to players, and a failed action says why, in the same place.
  • No element of the page changes position during or after an action, at desktop and phone widths.
  • The summary shows the link playing and its stream letter.
  • A page opened while an action runs shows that action.
## What happens The owner pressed Swap and Play on a live game (Miami vs. Duke, 2026-11-14, web player and Emby) right after #161 shipped. Every action worked on the server, but the page did not show it well: - **Swap:** "You click it, the button gets disabled, and nothing happens for a few seconds, and then a banner appears and jerks the button down (the banner should not jerk the button positions), and you have to look at the Log to know what happened." - **Play:** the row says Reading, "which is useful, but it seems like the current playing stream should be in the top summary somewhere." - **Overall:** "the user experience should be improved for the user to see the operation happening, perhaps a progress bar or some other indicator showing ACCURATE information about what is happening (not just an infinite spinner)." ## Why an action takes seconds The server does real work in steps, and the page sees none of them until the answer comes back: - **Swap to a ready standby:** the standby is taken at once, then its playlist and first segments are loaded (the seconds of nothing), and the new stream is listed to players only after the segments already buffered ahead of it. - **Play on a link that is not a standby:** the link's page is read, the stream is checked, and only then is it loaded and spliced in the same way. - **Swap with no standby:** the link is dropped at once and the channel finds another the way a recovery does. ## The idea - **The server keeps the action as it runs:** which action, from which link to which, its steps in order with each step's seconds, the step it is on, and how it ended. For the buffer step it says how many buffered segments are still ahead of the new stream. - **The page shows it beside the buttons, as a field:** the action and its target as the label, the step it is on with its seconds as the value, and a bar with one segment per step. A step with a known length (the buffer playing out) fills as it goes; a step without one shows only its elapsed seconds. No spinner. - **The result stays in the same place** for half a minute: when the new stream was listed to players, or in red why the action failed. - **Nothing on the page moves** when an action starts, reports or ends. The banner above the page goes, on every Admin page; each page's line goes in its own header. - **The summary names the link playing:** a Link field with the site and its stream letter, which marks itself briefly when it changes. - **The row pressed in Links shows the step** the server is on, in place of "Reading". ## Data it needs - `GET /api/channels/{game_id}/operation`: the action in flight or just ended, small enough to read twice a second while one runs. - The same object on the channel in the admin view, so a page opened in the middle of an action shows it. - The first sequence number of a newly adopted stream, to tell when its first segment is listed to players. ## Done when - Pressing Swap or Play shows the first step at once and each later step as the server reaches it, with seconds that match the server's. - The last step says when the new stream was listed to players, and a failed action says why, in the same place. - No element of the page changes position during or after an action, at desktop and phone widths. - The summary shows the link playing and its stream letter. - A page opened while an action runs shows that action.
Author
Owner

Merged in #164 (merge commit d718d72) and deployed from main at 3a94153 on 2026-11-14: the app was up on it at 18:06Z. The OpenSpec change admin-action-progress is archived in 3a94153.

Checked on the live app right after the deploy:

  • A game's page shows the Link field (thetvapp.plus, stream A), the activity box in its head, empty and in its place, and Swap and Wrong game as the head's only actions. No console errors.
  • GET /api/channels/{id}/operation answers none for both open channels and 404 for an unknown game, and the admin view carries the record on each channel.
  • The app's log has no warnings, errors or tracebacks since the restart.

Not seen live yet: an action's steps on a real channel. Nobody had pressed Swap or Play since the deploy when this was written.

Seen and not fixed: at page widths around 1,000 px the Links table is 12 px wider than its column, so the Play column is cut at its right edge. That is from #161, not from this change.

Merged in #164 (merge commit d718d72) and deployed from `main` at 3a94153 on 2026-11-14: the app was up on it at 18:06Z. The OpenSpec change `admin-action-progress` is archived in 3a94153. Checked on the live app right after the deploy: - A game's page shows the Link field (thetvapp.plus, stream A), the activity box in its head, empty and in its place, and Swap and Wrong game as the head's only actions. No console errors. - `GET /api/channels/{id}/operation` answers none for both open channels and 404 for an unknown game, and the admin view carries the record on each channel. - The app's log has no warnings, errors or tracebacks since the restart. Not seen live yet: an action's steps on a real channel. Nobody had pressed Swap or Play since the deploy when this was written. Seen and not fixed: at page widths around 1,000 px the Links table is 12 px wider than its column, so the Play column is cut at its right edge. That is from #161, not from this change.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker#163
No description provided.