A new Admin: a page per playing game with its timeline, and system pages (#161) #162

Merged
cmoriarty merged 1 commit from feature/admin-one-game-page into main 2026-11-14 11:38:09 -05:00
Owner

Closes #161.

Why

The Admin page had grown into a stack of cards, chips and gauges, and it did not answer the question it is opened for: the game on the TV skips or freezes, why? The redesign was settled on a canvas of mockups over three rounds, then filed as one ticket.

What changes

The pages

  • Admin is a sidebar and one page at a time, each with its own address: /admin/game/{id}, /admin/system, /admin/sites, /admin/log, /admin/settings. /admin opens the game being watched, or the Overview when none is.
  • A game's page, top to bottom:
    • the name with its state as a tag, and Swap and Wrong game side by side;
    • a row of fields: Problem, Sport, On since, Picture, Player, Playback;
    • five timeline rows on one time axis (Link, Source, Download, Buffer, Player), over 10 minutes, an hour or the whole game;
    • every link of the game, each with Play;
    • the game's log, with each freeze and each stretch of filler.
  • Overview: the system's fields, the tasks as one table, what is not working with its actions, and five history rows (Games, Stream checks, Sites, Channels, App) over 3 hours, 24 hours or 3 days.
  • Sites, Log, Settings are pages of their own.
  • Every value is a labelled field or a tag. The old sections (top bar, Playing cards, Your games, Now, Stream checks, Sites, History, settings pane) are deleted, with about 1,500 lines of their styles.

The server

  • A channel keeps its history while it is open (backend/app/lanes.py): playlist waits, downloads, the buffer every 2 s, releases and errors, for up to 6 hours. GET /api/channels/{game_id}/lanes?window=&bins= serves it in bins with its counts.
  • POST /api/channels/{game_id}/swap works without a ready standby: the link is dropped and cooled, not rejected, and the channel recovers, with filler meanwhile.
  • POST /api/channels/{game_id}/play plays any link of the game. A standby goes in as it is. Any other link is read and verified first, and one that does not play changes nothing (409 with the reason).
  • The admin view carries each channel's summary: its state, tone and Problem, decided in admin._summary.
  • GET /api/events takes ?game=.
  • Every site's reads are totalled per half hour and kept 3 days, at GET /api/sites/totals. A sites.json written before this change starts its totals from the per-site half hours it already holds.
  • Specs: OpenSpec change admin-one-game-page, with deltas for admin-page, stream-supervision and event-log.

Things to know

  • Sites, Log and Settings had no mockup. Their layout is mine, in the same fields and tags, and the owner has not seen them.
  • A channel's history lasts only while the channel is open. A page left open when its channel closes keeps what it last showed, marked Closed. A page opened afterwards has nothing.
  • Swap on a background channel nobody watches, with no standby ready, closes that channel, as any recovery there does: no read is spent on it, and the checks find the game a stream again.
  • On a phone the sidebar becomes one strip across the top, so a game's page starts on the first screen.
  • The Watchlist page still sits on .admin, so a few of those rules stay.
  • A merge deploys: the publish job restarts the app a few minutes later, whether or not a game is on.

Testing

Lanes run locally, since CI runs by hand only:

  • make test: 1283 passed, 1 skipped.
  • Frontend: 251 passed, build clean.
  • make e2e: passed.
  • openspec validate admin-one-game-page --strict: valid.

One make test run during the work failed with its output cut off, so the failing test is unknown. The 15 full runs after it were green.

Every page was looked at in a browser, wide and at phone width, against a stand-in server replaying saved answers. The state, the Problem and the timeline came from the real server code fed a simulated night. The Watchlist and Games pages were compared with production and look the same.

Not yet run against a live game: Swap and Play have not been pressed on a real channel. The check after deploy is to open Admin during a game, compare the timeline with what the TV shows, and press Swap and Play once each.

🤖 Generated with Claude Code

Closes #161. ## Why The Admin page had grown into a stack of cards, chips and gauges, and it did not answer the question it is opened for: the game on the TV skips or freezes, why? The redesign was settled on a canvas of mockups over three rounds, then filed as one ticket. ## What changes **The pages** - Admin is a sidebar and one page at a time, each with its own address: `/admin/game/{id}`, `/admin/system`, `/admin/sites`, `/admin/log`, `/admin/settings`. `/admin` opens the game being watched, or the Overview when none is. - **A game's page**, top to bottom: - the name with its state as a tag, and Swap and Wrong game side by side; - a row of fields: Problem, Sport, On since, Picture, Player, Playback; - five timeline rows on one time axis (Link, Source, Download, Buffer, Player), over 10 minutes, an hour or the whole game; - every link of the game, each with **Play**; - the game's log, with each freeze and each stretch of filler. - **Overview:** the system's fields, the tasks as one table, what is not working with its actions, and five history rows (Games, Stream checks, Sites, Channels, App) over 3 hours, 24 hours or 3 days. - **Sites, Log, Settings** are pages of their own. - Every value is a labelled field or a tag. The old sections (top bar, Playing cards, Your games, Now, Stream checks, Sites, History, settings pane) are deleted, with about 1,500 lines of their styles. **The server** - A channel keeps its history while it is open (`backend/app/lanes.py`): playlist waits, downloads, the buffer every 2 s, releases and errors, for up to 6 hours. `GET /api/channels/{game_id}/lanes?window=&bins=` serves it in bins with its counts. - `POST /api/channels/{game_id}/swap` works without a ready standby: the link is dropped and cooled, not rejected, and the channel recovers, with filler meanwhile. - `POST /api/channels/{game_id}/play` plays any link of the game. A standby goes in as it is. Any other link is read and verified first, and one that does not play changes nothing (409 with the reason). - The admin view carries each channel's `summary`: its state, tone and Problem, decided in `admin._summary`. - `GET /api/events` takes `?game=`. - Every site's reads are totalled per half hour and kept 3 days, at `GET /api/sites/totals`. A `sites.json` written before this change starts its totals from the per-site half hours it already holds. - Specs: OpenSpec change `admin-one-game-page`, with deltas for `admin-page`, `stream-supervision` and `event-log`. ## Things to know - **Sites, Log and Settings had no mockup.** Their layout is mine, in the same fields and tags, and the owner has not seen them. - **A channel's history lasts only while the channel is open.** A page left open when its channel closes keeps what it last showed, marked Closed. A page opened afterwards has nothing. - **Swap on a background channel nobody watches, with no standby ready, closes that channel**, as any recovery there does: no read is spent on it, and the checks find the game a stream again. - On a phone the sidebar becomes one strip across the top, so a game's page starts on the first screen. - The Watchlist page still sits on `.admin`, so a few of those rules stay. - A merge deploys: the publish job restarts the app a few minutes later, whether or not a game is on. ## Testing Lanes run locally, since CI runs by hand only: - `make test`: 1283 passed, 1 skipped. - Frontend: 251 passed, build clean. - `make e2e`: passed. - `openspec validate admin-one-game-page --strict`: valid. One `make test` run during the work failed with its output cut off, so the failing test is unknown. The 15 full runs after it were green. Every page was looked at in a browser, wide and at phone width, against a stand-in server replaying saved answers. The state, the Problem and the timeline came from the real server code fed a simulated night. The Watchlist and Games pages were compared with production and look the same. Not yet run against a live game: Swap and Play have not been pressed on a real channel. The check after deploy is to open Admin during a game, compare the timeline with what the TV shows, and press Swap and Play once each. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The Admin page had grown into a stack of cards, chips and gauges, and
it did not answer the question it is opened for: the game on the TV
skips or freezes, why? The owner asked for a complete redesign and
settled it on a canvas of mockups.

Admin is now a sidebar and one page at a time, each with an address of
its own. /admin opens the game being watched, or the Overview when
none is.

A game's page leads with the game's name, its state as a tag and a
Problem field; the server decides the state and the Problem. Under
them are a row of fields and five timeline rows on one time axis
(Link, Source, Download, Buffer, Player) over 10 minutes, an hour or
the whole game. Then come every link of the game with a Play action,
and the game's log with each freeze and each stretch of filler. A page
left open when its channel closes keeps what it last showed, marked
Closed.

The Overview holds the system's fields, the tasks as one table, what
is not working with its actions, and five history rows (Games, Stream
checks, Sites, Channels, App) over 3 hours, 24 hours or 3 days. Sites,
Log and Settings are pages of their own. Every value on these pages is
a labelled field or a tag. The old sections are deleted, with their
styles.

The server gains what the pages need:

- A channel keeps its history while it is open (lanes.py): playlist
  waits, downloads, the buffer every 2 s, releases and errors, for up
  to 6 hours, served in bins by GET /api/channels/{game_id}/lanes.
- Swap works without a ready standby: the link is dropped and the
  channel recovers, with filler meanwhile. A background channel nobody
  watches closes instead, as on any recovery with no standby.
- POST /api/channels/{game_id}/play plays any link of the game. A
  standby goes in as it is; any other link is read and verified first,
  and one that does not play changes nothing.
- The admin view carries each channel's state, tone and Problem.
- GET /api/events takes a game filter.
- Every site's reads are totalled per half hour and kept 3 days, at
  GET /api/sites/totals.

The pages were looked at in a browser, wide and at phone width,
against saved answers. They have not yet run against a live game.

OpenSpec change: admin-one-game-page.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
cmoriarty deleted branch feature/admin-one-game-page 2026-11-14 11:38:09 -05:00
Sign in to join this conversation.
No reviewers
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!162
No description provided.