Public: anyone can read this; the crew can change it.

A table has a URL: GET /tables/:id, linkable and watchable before the game can be played #40

shipped production is serving it opened this has it
opened this

Intent. I played the merged app through its API: a table opens, seats fill, the redaction holds — and then GET /tables/1 answers 404, because a table has no page of its own. / is the whole app and a table is not a thing you can send to anybody. Give a table its address now, showing what exists today, and let #12 grow the game into the same page rather than inventing it at the end of the chain.

Done looks like

  • [ ] GET /tables/:id renders a table with the layout from #21: the title, the host, the status, the seats in order with who holds them, the clock settings (turn_seconds, deadline_seconds in words), quorum, and — when the viewer holds a seat — nothing more than tableState gives them. An unknown or malformed id is a 404 with the floor intact, not a crash.
  • [ ] Join and Leave move here from / and post to the routes that already exist, coming back to the table. canJoin/canLeave from src/actions.ts decide whether the button is drawn, so the page and the action cannot disagree.
  • [ ] The lobby links every table to it, and the table page shows its own absolute URL as something a person can copy — that is the invite #33 builds on.
  • [ ] A guest may read it: the page says in one line that watching needs no account and that signing in is how you sit down.
  • [ ] The region carries data-live="seat.joined seat.left table.started" so the seats fill without a reload, and the page is complete HTML at first paint.
  • [ ] Nothing about the turn, the charter, the offer or the reveal is here: those are #12, on this same page. Say in the pull which parts of tableState you deliberately left unrendered so the next run knows what is free.
  • [ ] Tests: 200 for a guest, a player and the host; 404 for an unknown id and for /tables/abc; a guest's HTML contains no aim and no charge; the page answers in under 50ms.

Files src/routes.ts, src/pages/*.ts, src/server.test.ts, README.md.

Risks #21 is in flight and owns the layout; this waits on it deliberately so there is one page shell, not two. Keep every value on the page from tableState — a query of your own here is how a charge leaks the day #8 stores one.

Brief that fits @quill — a page with intent, server-rendered, that the game grows into. (A person assigns.)

commented

Amended by the planner. One more thing belongs on this run, because it is the same files and the same taste: not found is a page. Today every miss answers text("not found", 404) — a person who follows a stale link to a table gets four plain words on a white screen with no way back. Any route that a browser asks for HTML on answers with the app's own layout, a sentence, and a link to the lobby; the JSON API keeps its plain body and its status. A test asserts both shapes, and that the security floor is on each.

The rest of the body stands. src/when.ts is merged (#20), so the clocks on this page are rendered with timeTag and not formatted by hand.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs