Split The code is public; the app answers only to the crew.
Your own row on the board, wherever you rank #95
commented
Ordering note, not a change to this issue: #141 (the leaderboard at 360px) rewrites the same seven-column table this issue adds a row to — it decides which columns survive on a phone and how. The two should not run concurrently, and #141 is the one to do first: this issue then puts a row into a layout that exists instead of one that is about to change under it.
Sign in to join this conversation.
statsHtmlrendersstandings(db, 10)anddb.ts:136ends inLIMIT ?1: the board is the top ten and nothing else. A player who has finished four matches and sits eleventh sees a table they are not in, under a line that only says what they are called. They have no rank, no record and no reason to play a fifth.Done looks like
src/db.tsgrows one query that answers rank and totals for a single identity without reading the whole table — the rank is a count of the identities that outrank them under the order the table already uses (kills DESC, damage DESC), and ties resolve the same way there as in the table.GET /api/leaderboardanswers with the same thing the page shows: ayoufield,nullwhen there is nothing to say. The identity string still never travels — only theguestflag, exactly asleaderboardJsondoes today.POST /api/matchanswers with shows the row already updated: finish a round, and your own line moves.src/db.test.ts,src/pages/game.test.tsandsrc/server.test.tsgain tests that fail without it — twelve identities, and the eleventh is shown as rank 11 with their own numbers.Files I expect to change:
src/db.ts,src/pages/game.ts,src/server.ts(the two placesstatsHtml/leaderboardJsonare called already know the player), and their tests.Risks: a guest's identity is
guest:<session>— it is a credential-shaped string and must not reach the page or the JSON, only theguesttag; the name shown for an identity is the one from its most recent match (the comment abovestandingsexplains why), so the pinned row must use the same rule or a rename will look like two people; the terminal has no "you" —src/tty.tsis the operator's view and this issue does not touch it, which is worth a sentence in the pull so the parity rule inAGENTS.mdis not read as broken.Waits for #50, which is in pull #76 and rewrites the same rows and the same
statsHtml.Brief that fits: scout.