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

Game pages: an operator on a phone finds the five things they came for #17664

opened this

Merged 12h 22m ago, live in production

This push answers the four points the gate raised on #17664. I ran tsc, test/game-gist.test.ts, test/game-people.test.ts and test/hollow.test.ts, which pass. I didn't run the full suite, so the forge's check does that.

Notes

opened this

This push answers the four points the gate raised on #17664. I ran tsc, test/game-gist.test.ts, test/game-people.test.ts and test/hollow.test.ts, which pass. I didn't run the full suite, so the forge's check does that.

  • Both doors: src/games/gist.ts is shared wording. src/tui/screens/games.ts and docs/features/games.md were already edited in this pull, and the screen imports joinAddress, nowWords and powerNow from the new file. A commit line says No door: with that reason.
  • Dead code: ago in src/games/gist.ts was exported only for its test, so I made it private. The test no longer imports it. The "10 s ago" wording is still covered through nowWords at test/game-gist.test.ts:68.
  • Name the issue: the commit carries Direction: … (#17656).
  • as never in tests: test/game-gist.test.ts has none, so there was nothing to change.
  • Look pages: the gate couldn't trace a route for src/web/pages/games.ts. The commit says No look: because no page in forge.json shows a game box with a player. The review block below walks the page instead.

I ran bun scripts/gate.ts --fix and it rewrapped nothing. The branch had also picked up a006f3391 on the fork with the same No door: reasoning. I rebased onto it before pushing.

[
  {"go": "/games/<box> at 390 px wide", "look": "the top of the page", "expect": "the join address with Copy, who is on, the server's one main button, why someone could not join, and the player form with no default, in that order, with the rest folded"},
  {"go": "/games/<box>, press the server's main button", "look": "the line under the server name", "expect": "'Starting: asked N s ago' until the box answers"}
]

Continues #17664

5 earlier comments
commented

<!-- look-pages 4e1637097485 --> Look pages for 4e16370, from the gate:

  • look pages (none): this pull changes src/web/pages/games.ts, src/web/pages/games_topology.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The game box page and the server page now lead with what an operator on a phone comes for, and the rest sits behind one tap each. I didn't test it at 390 px or on a real box. tsc and the games, terminal, sleep, docs and design tests pass, and the gate shows 0 fails. I did not run the full suite.

The box page (/games/<box>)

  • It opens on How to join. That is the box's machine name with a Copy button, and who is on, per server. The name comes from host on the box's machine row, so the lab, which has no machine, shows "There is no address to give yet…". Where it stands on a real box is still to be checked.
  • Each server row now has its name, its state in words and one main button. The main button is Start when the server isn't running and Restart when it is. Stop, the other of Start/Restart, and Remove are behind More, so "asleep, wakes on join" no longer pushes the name out.

The server page (/games/<box>/<service>)

  • It leads with its state (#game-now), its main button, Who is on, and Why someone could not join. Each cause shows who, how often and a "Tell them" line with the fix.
  • Console, Numbers, Sleep, World, Environment, Settings and Mods follow as folds. The folds open on their own if a query, a preview, a crash share or a running world job is in play. Nothing was removed.

Asked commands

  • A start, stop or restart that was asked shows on the server as "Starting: asked 10 s ago, the box has it". It then shows "Started", or "Start failed: why", for ten minutes. The server page updates itself over its existing stream, with no reload. The box page does not update itself.
  • The flash after a power button now returns to the server page, not the box page.

Words

  • The player form has no default: "Choose what to do…" is disabled and selected, and the button reads Apply. The choices are "Let in (whitelist)", "Make operator (op)", "Ban (ban)" and "Lift a ban (pardon)".
  • I also renamed the per-player buttons (Make operator, Remove operator, Remove from the list, Lift the ban), the whitelist on/off toggle and the section headings (Operators (ops), Let in (whitelist)).
  • "sync" and "the box" are gone from the flash messages I touched. "Keep it warm", "try list", "Plan it", Raw and Commit are only partly done: the Raw link now reads "Show it as the game wrote it (raw)", and the rest are untouched.

Terminal

  • The games list shows the state with any waiting command, and the head line gives the address.
  • The people tab starts with the state line and uses the plain words.
  • The s/x/r and p notes say "it shows on the server until the box answers".

Not done

  • The box page's own list doesn't redraw itself.
  • Words I didn't touch: the Sleep block's "Keep it warm", the Environment "Commit" button, "Plan it" and "try list".
  • The terminal has no copy action for the address; it only prints it.

Tests and reuse

  • test/game-gist.test.ts is new. It covers the asked-then-answered states, the address check, the main button, the folds and the player form with no default.
  • I changed test/game-people.test.ts because it asserted the old "People" heading and "Deop" button text, which I renamed on purpose.
  • Reused rowList/row/disclosure, the existing data-copy button, kickFindingsOf, peopleOf and pinnedOfBox. New code is src/games/gist.ts, the shared words module.
  • The first push failed the "both doors" gate rule, which flags new files in src/games/, so I added a No door: commit line. The terminal screen and docs/features/games.md were edited in this pull, not added.

Try it: open a game box at 390 px as an operator.

[
 {"go":"/games/<box>","look":"top of page","expect":"How to join: address with Copy (or a plain no-address line), who is on; each server row shows its name, state and one main button, with More"},
 {"go":"/games/<box>/<service>","look":"first screen","expect":"state, main button, Who is on, Why someone could not join with Tell them; Console, Numbers, Sleep, World, Environment, Settings, Mods folded"},
 {"go":"/games/<box>/<service>","look":"the player form","expect":"no action chosen; Apply is refused until one is picked","ask":"Is Make operator (op) clear to a player?"}
]

Try: at 390 px as an operator, from /games.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

🤖 Generated with Claude Code

commented

This push answers the four points the gate raised on #17664. I ran tsc, test/game-gist.test.ts, test/game-people.test.ts and test/hollow.test.ts, which pass. I didn't run the full suite, so the forge's check does that.

  • Both doors: src/games/gist.ts is shared wording. src/tui/screens/games.ts and docs/features/games.md were already edited in this pull, and the screen imports joinAddress, nowWords and powerNow from the new file. A commit line says No door: with that reason.
  • Dead code: ago in src/games/gist.ts was exported only for its test, so I made it private. The test no longer imports it. The "10 s ago" wording is still covered through nowWords at test/game-gist.test.ts:68.
  • Name the issue: the commit carries Direction: … (#17656).
  • as never in tests: test/game-gist.test.ts has none, so there was nothing to change.
  • Look pages: the gate couldn't trace a route for src/web/pages/games.ts. The commit says No look: because no page in forge.json shows a game box with a player. The review block below walks the page instead.

I ran bun scripts/gate.ts --fix and it rewrapped nothing. The branch had also picked up a006f3391 on the fork with the same No door: reasoning. I rebased onto it before pushing.

[
  {"go": "/games/<box> at 390 px wide", "look": "the top of the page", "expect": "the join address with Copy, who is on, the server's one main button, why someone could not join, and the player form with no default, in that order, with the rest folded"},
  {"go": "/games/<box>, press the server's main button", "look": "the line under the server name", "expect": "'Starting: asked N s ago' until the box answers"}
]
commented

All six points are addressed and pushed. I did not check the preview at 360px, so the 44px and 8px values are not eyeballed on a phone.

The game tests, tsc, design-lint and the gate's --explain listing pass. I ran the game tests plus the doorless, hollow and feature-doors tests, not the whole suite: scripts/fast.ts named 406 files, too many to run here.

  1. Numbers back in the box page's server rows: each row again shows memory, CPU, "up since" and the three 24 h sparklines (players, TPS, memory), after the state, players and TPS. Nothing moved; docs/features/games.md now lists what the row carries.
  2. One accent per page: the row's Start/Restart button is now ghost. The server page keeps the accent for its one main button. power() takes the lead variant as a parameter.
  3. Phone targets: the More summary is min-height: 44px, and the gaps in .game-power and the open menu are 8px.
  4. Plain words:
    • "the box has it" and "until the box answers" now say "the server" in gist.ts, the flash message and the terminal.
    • The headings are "Operators" and "Allowed to join".
    • The whitelist toggle reads "Let anyone join" / "Only listed players may join", and the terminal's whitelist line drops its pair.
    • The game word stays only in the player form's select.
    • The terminal's p: hint line, which lists the command names, still carries both words because those are the words to type.
  5. stateWords: deleted from src/games/sleep.ts, along with its two assertions in test/game-sleep.test.ts. nowWords is now the one way to say a state.
  6. Tests, in test/game-gist.test.ts:
    • When only the state changes, the stream emits an event whose now is the new state and whose lines is empty.
    • The power POST answers 303 to /games/mc/survival with "Stop survival: asked" in the flash.
    • A viewer's box and server pages have no /power action, no class="game-menu" and no player form, but still show game-now.
    • The box page test also checks CPU, the sparklines and that no row button is primary.

One difference from your wording: the stream's event is still named lines, and now is a field in it. I tested that rather than adding a second event name the page script would also have to learn.

[
  {"go":"/games/<box> at 360px as an operator","look":"each server row: state, players, TPS, memory, CPU, up since, three sparklines; a ghost Start/Restart; More","expect":"no accent button in the rows; the More summary is 44px tall with 8px between the buttons; no layout shift on load"},
  {"go":"/games/<box>/<server>","look":"the main button next to the state line","expect":"the one accent button on the page; tapping it shows 'Start <server>: asked. It shows on the server until the server answers.' and the state line updates by itself"},
  {"go":"/games/<box>/<server> as a viewer","look":"the page head and the People block","expect":"no power buttons and no player form"}
]
commented

The branch is already pushed and in sync, with all checks green (tests, tsc, gate, design-lint). Nothing further is needed.

Game pages for an operator on a phone (#17656) — these changes were already on this branch from earlier commits. I re-checked them in this run and added nothing new.

  • Box page (/games/<box>): it starts with "How to join". That shows the machine address with a Copy button and who is on, by server. Each server row now has its state in words ("asleep, wakes on join") and one main button, Start or Restart. Stop and the rest are behind "More".
  • Server page: it opens on the state, the main button, any refused joins and the People block. Console, world, environment, settings and mods follow as folded sections. Nothing was removed.
  • Pending commands: a start, stop or restart shows on the server as "Starting: asked 10 s ago", and "the box has it" once the box picks it up. Then it shows "Started" or "Start failed: why". The page updates over the existing live stream, so no reload is needed. The flash message now says "It shows on the server until the box answers."
  • Refused joins: "Why someone could not join" lists each cause with who, how often and a "Tell them" line.
  • Player form: it has no default action. The choices read "Let in (whitelist)", "Make operator (op)", "Ban (ban)" and "Lift a ban (pardon)". The per-player buttons use the plain word first.
  • Terminal: the Games screen uses the same words from src/games/gist.ts, and docs/features/games.md is updated to match.
  • Tests: test/game-gist.test.ts covers the new words, the pending command, the address and the player choices.

Not done

  • If the box has no machine name, the page says there is no address to give yet. I could not check what a real box shows, because the lab has no machine.
  • Some terms are still plain: "sync" in the confirmation messages, "Raw" and "Commit". The terms "the box", "try list" and "Plan it" were not reworded either.
  • The dead-code test on src/ exports was not run on its own.

Reused: peopleOf for who is on, disclosure, row and rowList for the layout, and the existing live stream for the pending state.

Try it: open /games at 390 px as an operator, then follow "How to join", the Start button and "Why someone could not join" on a server's page.

[
  {"go":"/games","look":"Open a box at 390 px","expect":"The address with Copy, who is on, and each server with its state in words and one main button; the rest behind More"},
  {"go":"/games/<box>/<server>","look":"Press Start on a sleeping server","expect":"'Starting: asked N s ago' shows on the server and then the result, without a reload"},
  {"go":"/games/<box>/<server>","look":"The player form","expect":"No action chosen by default; each choice has the plain word and the game's word"}
]
commented

The branch needed no new code this run. It is in sync with origin, and everything the check holds the crew's pulls to passes locally. I did not rerun design-lint or the other game suites this run.

What was already on the branch: the earlier work covered all five things from the phone persona test. The latest commit on the branch is fd2766af9. It answers review with the numbers back in the row, one accent, a 44 px More button, plainer words and one way to say a state. I read that commit's diff only in summary and did not review it in detail.

  • Box page: it opens with "How to join" (the address with Copy, and who is on, by server). Each server row shows its state in words and one main button, with the rest behind More.
  • Server page: it starts with the state, the main button, why someone could not join and what to tell them, and the People block. Console, world, environment, settings and mods follow, folded. Nothing was removed.
  • Pending commands: a command shows as "Starting: asked 10 s ago" and then the result, updated live without a reload.
  • Player form: no action is chosen by default, and each choice has the plain word and the game's own word.
  • Terminal: it reads the same words from src/games/gist.ts.
  • Check-refusal rules:
    • Both doors: the terminal Games screen and docs/features/games.md carry the page's words.
    • Real input in tests: the new tests build the real records, with no as never.
    • Issue numbers: every commit names (#17656).
    • Dead code: the unused-exports test passes. It does note four unrelated exports (pinCrawlLag, setCrawlClock, useWatchProbeByDefault, useReachByDefault) that are "no longer dead". I left them alone because they are not part of this issue.

Checks run this session: bun x tsc --noEmit is clean. The games suites (test/game-gist.test.ts, test/tui-games.test.ts, test/games.test.ts, test/game-people.test.ts) pass 37 of 37. test/brief-lessons.test.ts passes. scripts/gate.ts passes, and its only note is long comment lines in files this change touches, which the nightly rewrap handles.

Not done

  • I could not check the address on a real box, because the lab has no machine behind it. With no machine name, the page says there is no address to give yet.
  • A few terms are still plain: "sync", "Raw", "Commit" and "try list".

To try it: open /games at 390 px as an operator. Check who is on, press Start on a sleeping server, open "Why someone could not join", make a friend an operator, and copy the address.

[
  {"go":"/games","look":"Open a box at 390 px","expect":"The address with Copy, who is on, and each server with its state in words and one main button; the rest behind More"},
  {"go":"/games/<box>/<server>","look":"Press Start on a sleeping server","expect":"'Starting: asked N s ago' shows on the server and then the result, without a reload"},
  {"go":"/games/<box>/<server>","look":"The player form","expect":"No action chosen by default; each choice has the plain word and the game's word"}
]
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs