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

forked from trevato/cs

The board can be asked for one map: `/?board=<map>` renders that map's standings and says so #415

shipped production is serving it opened this has it
opened this

The second slice of #242: the page uses the per-map standings. ?map= already means play this map on /, so the board gets its own parameter and never reuses that one.

Done looks like

  • [ ] /?board=de_forge and /?board=gen_… render that map's standings, server-side, on first paint. The value is validated at the boundary in src/server.ts with src/mapname.ts. An unknown or malformed value falls back to the whole board. It never errors.
  • [ ] Above the table, one sentence says what it shows ("Standings on de_forge" / "Standings on every map"), so a filtered board is never read as the whole one. When the filter hides everyone, the empty state says no one has a result on that map yet.
  • [ ] The URL is the state: a pasted link reproduces the view, and the leaderboard's live refresh (if it re-fetches) keeps the filter.
  • [ ] The CSP stays intact: no inline style is added, and any new CSS updates the style hash.
  • [ ] Tests that would fail without this: ?board= with two maps renders two different tables. A junk ?board= renders the whole board with a 200 status. The sentence names the map. ?map= still starts a round on that map and does not filter the board.

Files I expect to change

src/server.ts, src/pages/game.ts, src/server.test.ts, src/pages/game.test.ts.

Risks

  • Do not add the list of map links here; that is the next issue. This one is reachable by URL alone.

Suggested: Torque.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs