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

Games, Infrastructure and the other areas are in the navigation, for everyone who may use them #17633

opened this in answer to

Merged 9h 50m ago, live in production

Every page now has an Areas menu in the topbar, a phone's too, so Games and Infrastructure are one click from home for whoever may use them. A person sees only the areas they may use.

Notes

opened this

Every page now has an Areas menu in the topbar, a phone's too, so Games and Infrastructure are one click from home for whoever may use them. A person sees only the areas they may use. I ran the areas tests, the palette roster and the games, infra, cost and unused-exports tests, plus tsc, the design lint and the gate; all pass. I did not run the full suite or press the menu in a browser. The sandbox had no chromium, so the keys test skipped. The forge's check runs the rest.

What changed

  • One list. src/core/areas.ts names each area once, with its address, what it is for, what to do first, and who may use it. The areas are Work, Apps, Explore, Games, Infrastructure, Boards and System.
  • Who sees what. src/actions/areas.ts narrows the list to the viewer.
    • Anyone sees Apps and Explore, and anyone signed in sees Work.
    • Games shows for an admin or anyone a game box is shared with, and for no agent. A new seesAnyBox in src/games/store.ts checks the grant.
    • Infrastructure, Boards and System are admins' only.
  • Web. areasMenu in src/web/layout.ts draws the list, marks the page you are on, and shows it to signed-out visitors too. The Games and Apps first screens take their one-line purpose from the same list. A non-admin with an empty Games page gets "Open a server, then start it or read its console." instead of the admin's "Make one" link.
  • Terminal. A new Areas screen (src/tui/screens/areas.ts, palette entry rank 5) shows each area's purpose and "First: …". enter opens Apps, Games, Infrastructure and Boards natively. Work, Explore and System hand over their web address instead; the terminal has no matching screen, and I did not build them.
  • Links between areas.
    • A game box's machine row opens the machine on Infrastructure, for an admin.
    • A machine row gets a Game box or App button for what runs on it.
    • An app's More menu gains Cost, shown only to whoever may see its spend. /<owner>/<app>/cost existed but nothing linked to it. The terminal already reads that spend in Usage.
  • Tests and docs. test/areas.test.ts covers the list, the menu for an admin, an unshared person and a person with a box, the Cost step, and the terminal screen. I added the new entry to the three roster expectations in test/palette-roster.test.ts, since the entry is deliberate. The how-to is docs/features/areas.md; the generated src/generated/screens.ts re-indexed, which is why its diff is large.

What I chose not to do

  • No change to the Infrastructure page's own opening line; the area's wording matches it.
  • Nothing yet to measure the timed, persona-driven clicks-before-and-after test.
  • No Home page tile beyond the topbar menu.

To try it

  • Open / signed in and press Areas; an admin sees Games and Infrastructure, a plain member does not see either.
  • On an app, open More and choose Cost.
  • In the terminal, open Areas from the palette.
[
  {"go":"/","look":"Areas menu in the topbar, signed in as an admin","expect":"Lists Work, Apps, Explore, Games, Infrastructure, Boards and System; the current page is ticked","ask":"Is one word, Areas, clear enough for someone who does not know the forge?"},
  {"go":"/","look":"Areas menu signed in as a member with no game box","expect":"Work, Apps and Explore only; no Games, no Infrastructure"},
  {"go":"/games","look":"The first screen","expect":"One line saying what Games is for; with no boxes, an empty state that says what to do next"},
  {"go":"/infra","look":"A machine row","expect":"A Game box or App button that opens what runs on it"},
  {"go":"/apps","look":"Open an app, then More","expect":"A Cost step that opens its last 30 days"}
]

Closes #17627

Show 13 earlier items

7 earlier comments
commented

I merged main into the branch again and pushed it (c7d846395). main had moved a second time since the last merge.

The conflict: src/web/pages/games.ts, in the empty-state block of /games. main now shows admins a "Start a game box" button, which asks Talk for the plan. My branch had replaced that with a "Make one" link to /infra/build. I kept main's button for admins and kept my hint line for everyone else: "Open a server, then start it or read its console." The "Make one" link is gone, because the button already does that job.

Checks:

  • Type check: bun x tsc --noEmit was clean.
  • Tests: I ran the game, infra, palette and empty-state test files. 344 passed, 5 skipped (the palette tell browser tests, which need chromium) and 0 failed. I did not run the full suite; the forge's check runs it on the push.
  • Gate: bun scripts/gate.ts --fix changed nothing. It repeats its question from last time about boxesLine in src/web/game_strip.ts and wideSays in src/crew/hot_files.ts possibly being one implementation. I didn't look into it.
commented

I merged main into the branch and pushed it. It now merges cleanly, and the tests that cover the three conflicted files pass. I did not run the full suite: scripts/fast.ts named 3414 test files and estimated 281 minutes. I ran test/own-machine.test.ts and test/infra-page.test.ts before the commit. After it I ran tui-machines, crew-machines-wiring, tui-games, tui-deploys and machines-disks, and those pass too. tsc --noEmit is clean, and gate.ts --fix changed nothing. The forge's own check will run the whole suite on this push.

Conflicts. main had built the "Run it on its own machine" flow for an app on its own machine (?app= on /infra/build, and runOnItsOwnMachine in the terminal Infrastructure screen). My branch had a parallel version of the same thing. I kept main's version of all three conflicted files: src/http/infra_routes.ts, src/tui/screens/infra.ts and src/web/pages/machines.ts. Two things from my side are gone as a result:

  • The preset argument to infraScreen. Nothing else used it once the terminal entry was switched.
  • The "an admin opens Infrastructure" note on the machines page. main had dropped it from that page in the same area.

What I changed outside the conflicts. The "Run an app on its own machine" entry in src/tui/forge_parts.ts called infraScreen with the removed argument. It now calls runOnItsOwnMachine and returns nothing. Non-admins are still sent to the app's page on the web, as before.

Gate note. gate.ts reports that src/web/game_strip.ts boxesLine is similar to src/crew/hot_files.ts wideSays. It is advisory, and I left it.

commented

I merged main into the branch and pushed it. It now merges cleanly, and tsc --noEmit is clean. I ran test/games.test.ts, test/tui-games.test.ts, test/game-box.test.ts, test/game-lend-box.test.ts, test/game-desk.test.ts and test/game-second-box.test.ts, and they pass. I did not run the full suite or scripts/gate.ts this time. The forge's check runs the full suite on this push.

The only conflict was src/web/pages/games.ts, in gameBoxPage around the "Its machine" row. I kept both sides:

  • My side: for an admin the row links to /infra#machine-<name>, where the machine's cost and end are.
  • main's side: the heldNotice line that follows the row.
commented

I merged main into the branch again and pushed it, so it merges cleanly now. tsc --noEmit is clean. test/games.test.ts, test/game-box.test.ts and test/tui-games.test.ts pass. I did not run the full suite or scripts/gate.ts; the forge's check runs the full suite on this push.

The conflict was in src/web/pages/games.ts, in gameBoxPage around the "Its machine" row. main now loads the held notice once into a held variable at the top of the page, so the page now places ${held} below the row. The "Its machine" row keeps the link for admins, which goes to /infra#machine-<name>.

commented

The red on 64e15d7 is one test, and it is this pull's own change, not a flake: run 01m8wp55rcaq6wpqcwp0yx8d85 fails test/tui-money.test.ts:113 ("an app's rows: its month, where it was awake, its share of the server"). The pull's new terminal sentence beside the Awake split (your 21:03 comment: "on the page and in the terminal's Money") adds a row to appMoneyRows, and the test still expects three rows. The received output matches the intended change exactly, so update the expectation, nothing else:

--- a/test/tui-money.test.ts
+++ b/test/tui-money.test.ts
@@ -113,5 +113,6 @@
     expect(appMoneyRows(m.value)).toEqual([
       { title: "This month (2026-11)", meta: "cost $95.00 · revenue $1.00 · gap -$94.00" },
       { title: "Awake", meta: "10.0 h · 100% on the forge's own server · 0% on cloud" },
+      { title: "What that split means", meta: "Time on the forge's own server adds no cloud charge: its monthly cost is shared by use. Time on cloud is billed by the hour." },
       { title: "Share of the forge's own server", meta: "100%" },
     ]);

Run bun test test/tui-money.test.ts and push; that should be the whole fix for this check. 24,009 of 24,010 passed otherwise.

commented

The failing check is fixed and pushed. test/tui-money.test.ts now expects the "What that split means" row, and the file passes (5 tests). I put the row after "Awake", not before it as in your diff. That is the order appMoneyRows returns, and the first run with the row before "Awake" failed on the order.

I also ran these checks, and all are clean:

  • Types and gate: tsc --noEmit is clean, and gate.ts shows only the same two notes as before.
  • Dead exports: test/unused-exports.test.ts passes. It lists four exports that are no longer dead (pinCrawlLag, setCrawlClock, useWatchProbeByDefault, useReachByDefault). Those are not in this pull's files, so I left them.

I didn't need to touch the other four items you listed. The one test change adds no as never and no new export. The terminal side of the page change is the sentence this test now covers, and the commit message names the issue (#17627).

commented

This round addresses all four review points on #17633. The area-link, own-machine, confirm-app-stop and home tests pass, tsc --noEmit is clean, design-lint is clean, and unused-exports passes. I did not run the full suite. The home phone-fit tests were skipped because there is no Chromium in the sandbox.

What changed

  • One sentence, once. "Open a server, then start it or read its console." now appears only on the home strip. I dropped the literal interpolation from /games, so a non-admin with no boxes there sees just the empty line.
  • Its own machine is a row. It is now a row in a rowList in the aside. The title is "Run it on its own machine", the price sentence is its meta, and the href goes to the compose page. The card is gone. The duplicate "Run it on its own machine" link in the app page's "more" paragraph is gone too, so there is one entry point. No new component, so nothing is added to docs/design/areas/.
  • Neutral module. boxesLine, givenBoxes and SHOWN now live in src/games/boxes_line.ts. Both src/web/game_strip.ts and src/tui/screens/dashboard.ts import from there.
  • Tests.
    • confirm-app-stop.test.ts asserts both button labels, "Stop production" and "Stop preview".
    • The Settings > Machines test in own-machine.test.ts asserts the plain string, and its money record is now a typed AppMoney.
    • area-links.test.ts creates the shared box in beforeAll.
    • A new area-links.test.ts test covers the "All 6 game servers" link at SHOWN = 5. It checks that the strip has exactly five box links.

Not done

  • The gate still prints "boxesLine is 0.63 like wideSays" (see the second bullet under "Where to look"). The two functions share only the shape "empty gives empty, else a prefix plus a list", and their data is unrelated. Merging them would add an abstraction with no benefit, so I did not.
  • The gate also notes nine files with comment lines over 100 columns, which it says the nightly rewrap handles. I committed the one file --fix rewrapped and left the rest.

Where to look

  • unused-exports.test.ts passes. It lists four exports that are no longer dead (pinCrawlLag, setCrawlClock, useWatchProbeByDefault, useReachByDefault). None of them are in files this branch touches.
  • The gate prints the boxesLine similarity note at src/games/boxes_line.ts:14.

Try it Sign in as an admin and open an app's page. The aside has a "Run it on its own machine" row with the price. As a non-admin given a game box, home shows "Your game servers" once, and /games does not repeat the sentence.

[
  {"go": "/alice/notes", "look": "the aside, below This month", "expect": "one row, 'Run it on its own machine', with the price sentence beside it; no card"},
  {"go": "/", "look": "Your game servers strip, signed in as someone given a box", "expect": "'Open a server, then start it or read its console.' appears once"},
  {"go": "/games", "look": "the page head and list", "expect": "the sentence is not repeated"}
]
commented

The fix is pushed. I could not reproduce the second failing test locally. bun x tsc --noEmit and bun scripts/gate.ts --fix showed no errors, and I did not run the page review or bun scripts/design-lint.ts.

What was wrong

  • App page: the own-machine row ("Run it on its own machine") was only drawn in the full app-page layout, not in the fresh-app layout, so some app pages never showed it. It now appears in both, just above "Operator detail" in the fresh layout. This is the change in src/web/studio/app.ts.
  • Stale test: infra-page.test.ts matched the old link markup (…">Run it on its own machine</a>). The earlier review turned the offer into a row, which changed that markup. The test now checks the href="/infra/build?app=ada%2Fshop" link and the text separately. The test was wrong here, not the code.
  • Template test: "choosing a template for a new forge > plan carries the template only when it is not blank" passes locally, with or without my change. Nothing in this pull touches that code. I made no change for it and suspect a shard flake, so it is the one to watch on the next check.

Checks run: test/infra-page.test.ts, test/own-machine.test.ts and test/spawn-template-api.test.ts all pass locally. The gate flags boxesLine (src/games/boxes_line.ts) as possibly the same as wideSays (src/crew/hot_files.ts), plus long comment lines in 10 files that the nightly rewrap will fix. Neither is acted on here.

[{"go":"/<owner>/<app> as an admin, for an app that has not started yet","look":"the 'Run it on its own machine' row above Operator detail","expect":"it links to /infra/build?app=<owner>%2F<app> and states the monthly price"}]
Sign in to join this conversation.

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

Keyboard shortcuts

Docs