Show guests the set live: plays, history, charts at /live #38

Merged
forgejo-admin merged 1 commit from feature/live-guest-view into main 2026-09-28 06:28:07 +00:00

Problem

The app server can admit guests (#36), but it has nothing to show them. The console has no way to report plays, and there's no guest site.

Solution

App server

  • reportPlay (DJ only) records a play. It is idempotent on a clientId the console generates, and it still accepts plays for a closed session, so an outbox that replays late still lands.
  • view (guest only) returns now playing, history (newest first) and the charts of played tracks only. Unrated plays show as gaps.
  • onInvalidate is a WebSocket subscription that tells each guest's screen which data to refetch, scoped to that guest's own session.

Guest site (app/web)

  • Built with Bun HTML imports, React, atom.io and lasertag, following ADR 0002.
  • One sign-in screen takes the handle and passcode together.
  • Tabs: Now playing, History, Charts. The charts reuse app/shared/SetCharts.
  • A dropped connection shows "Reconnecting…" and keeps the last data on screen.
  • bun run live serves the site at /live. bun run build:live builds a static bundle for Caddy, used in Slice 8.

This is Slice 3 of projects/2026-09-27-dj-online-companion/plan.md.

Testing

  • bun test: 151 pass. That includes the play/view router tests and a real WebSocket test in which a guest hears a play land and refetches.
  • bun run check: clean.
  • Smoke run: bun run live in test mode. A self-signed DJ opens a session and reports a play; a guest's view returns it, and /live serves the page.
  • Not yet checked: a screenshot at phone width. The e2e slice will cover it.

🤖 Generated with Claude Code

## Problem The app server can admit guests (#36), but it has nothing to show them. The console has no way to report plays, and there's no guest site. ## Solution **App server** - `reportPlay` (DJ only) records a play. It is idempotent on a `clientId` the console generates, and it still accepts plays for a closed session, so an outbox that replays late still lands. - `view` (guest only) returns now playing, history (newest first) and the charts of played tracks only. Unrated plays show as gaps. - `onInvalidate` is a WebSocket subscription that tells each guest's screen which data to refetch, scoped to that guest's own session. **Guest site (`app/web`)** - Built with Bun HTML imports, React, atom.io and lasertag, following ADR 0002. - One sign-in screen takes the handle and passcode together. - Tabs: Now playing, History, Charts. The charts reuse `app/shared/SetCharts`. - A dropped connection shows "Reconnecting…" and keeps the last data on screen. - `bun run live` serves the site at `/live`. `bun run build:live` builds a static bundle for Caddy, used in Slice 8. This is Slice 3 of `projects/2026-09-27-dj-online-companion/plan.md`. ## Testing - `bun test`: 151 pass. That includes the play/view router tests and a real WebSocket test in which a guest hears a play land and refetches. - `bun run check`: clean. - Smoke run: `bun run live` in test mode. A self-signed DJ opens a session and reports a play; a guest's `view` returns it, and `/live` serves the page. - Not yet checked: a screenshot at phone width. The e2e slice will cover it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The console reports plays (idempotent on the client id); guests see now
playing, history and the set charts, refetching when the session's
WebSocket subscription says something changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
forgejo-admin deleted branch feature/live-guest-view 2026-09-28 06:28:07 +00: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
celilo/tango-dj!38
No description provided.