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

Empty words: move the admin and system pages onto the shared table #15909

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The admin, system and account pages now draw their empty states from EMPTYWORDS, but the OWNWORDS ratchet in test/empty-words-all.test.ts isn't in this tree, so the "files leave OWNWORDS" item is not done.

Notes

shipped production is serving it deploy 084a6fd

opened this

The admin, system and account pages now draw their empty states from EMPTY_WORDS, but the OWN_WORDS ratchet in test/empty-words-all.test.ts isn't in this tree, so the "files leave OWN_WORDS" item is not done. That test and the reason field didn't exist on main (2d4dc7d31), so I added reason myself and have no ratchet to confirm the files are clear. It still needs doing once the base work lands.

The checks I ran are clean: tsc, scripts/gate.ts --fix and design-lint, plus 18 test files that mention these empty sentences (160 tests, one failure fixed below). The keys suite skipped its ssh-keygen tests here. I did not run the whole suite; the forge's check does that.

What moved

  • src/core/empty_words.ts gains 24 kinds: codes, keys, tokens, changes, auditApps, dirs, processes, heap, samples, stalls, minutes, telemetry, disks, egress, runners, billingCodes, sentForges, agents, trusted, linkedVisitors, returnVisitors, teams, teamAgents, loads and devices.
  • label and href are now optional on a row. Only auditApps keeps a link ("New app", /apps/new, which exists unscoped); the others draw no link.
  • A row may carry a reason, drawn as the note under the sentence. It is set on codes, keys, auditApps and linkedVisitors, where the page didn't already say what the list is.
  • src/web/empty_words.ts draws the reason and leaves out the link when a row has none.
  • The sites converted:
    • account.ts: codes, keys.
    • accounts.ts: tokens.
    • admin-limits.ts, capacity.ts, economics.ts: changes.
    • audit.ts: its own empty({...}) block.
    • system.ts: all seven measurement lists.
    • capacity.ts: egress.
    • runners.ts, billing.ts, grants.ts, trusted.ts, visitors.ts, teams.ts.
    • settings.ts: loads.
    • settings/devices.ts.
  • The sentences are the same as before, with a few gaining a full stop. The /settings/tokens and /settings/keys pages now show a small block with an icon instead of a bare muted line.

Tests

  • I changed test/account-rows.test.ts. It insisted that empty lists are "one muted sentence, not a panel", which is exactly what this issue reverses, so it now expects the shared markup.
  • test/empty-states.test.ts gets one new test: every kind is one sentence, and a link needs both its label and its place.
  • docs/features/empty-words.md has a short note on the new kinds.

Left alone

  • accounts.ts "No active owner" is a heading for a warning, not an empty list.
  • billing.ts "No event yet" is a value in a status row.
  • The "No such token/key/browser" and "No other browser was signed in" messages are flash messages.
  • The "No force-push" line in settings.ts is a sentence about branch protection.

The push hook asked for a Try: line, so the last commit is empty. To try it, open /settings/tokens on an account with no codes, then /system and /settings/capacity as admin.

[
 {"go":"/settings/tokens","look":"the Access codes block with no codes","expect":"a small icon block saying 'No access codes yet.' with the note about scripts and CI, and no link"},
 {"go":"/settings/keys","look":"the Computer keys block with no keys","expect":"'No computer keys yet.' with the note about git over SSH"},
 {"go":"/audit","look":"the page with no audited apps","expect":"'No apps to audit.' with its note and one 'New app' link"}
]

🤖 Generated with Claude Code

Closes #15899

Show 10 earlier items

7 earlier comments · 2 events
commented

That gate note is the same automated look-pages message as before. It names the pages this pull changes, and it asks for nothing more from me. The merge is pushed as 6696b136c, and the forge's check is running against it.

To look at them, open these pages on the preview at https://lab--15909--forge-trevato-apps.open-platform.sh:

  • /system
  • /admin/accounts and the account page, where a list is empty. Each empty list should show one sentence, a reason where the table gives one, and at most one plain link.
[
  {"go": "/system", "look": "any empty list, such as stalls or the heap census", "expect": "one plain sentence ending in a full stop, no second accent colour"},
  {"go": "/admin/accounts", "look": "an empty list", "expect": "the table's sentence, with a reason or a single link where the table gives one"}
]
Changes requested — before the latest push

One thing to fix: /settings/capacity still hand-rolls its two empty states. It reads the sentence from EMPTY_WORDS but draws it as its own <p class="muted small">, so the page does not use emptyList(kind) and does not get the table's markup or any reason the table adds later. Issue box 1 asks that each empty state draw with emptyList(kind). The page went over its 25,000-byte first-view budget when emptyList was used, so the fix is not to hand-roll it. Either add a compact option to emptyList (a one-line variant with no icon) and use it for these two sites and the other small inline lists, or raise the budget in the test with a stated reason. The same small spots should be checked on a 360px phone: teamAgents inside a fieldset, loads inside the visitors block, and the disks <li> on /system each now carry the full icon block. Everything else is fine: the files left OWN_WORDS, the sentences are unchanged, the docs note is in docs/features/empty-words.md and not the README, and the terminal shares src/core. Not run by me: design-lint after the merge.

commented

I merged main again, resolved the conflicts, and fixed the /settings/capacity empty states juniper flagged. Pushed as b139c0dbf. tsc is clean and design-lint passes. 152 tests across 18 files pass; I did not run the whole suite, and I did not check the 360px layout in a browser.

Merge. While this pull waited, main landed #15898, which moves many of the same pages onto a parallel NOTE_WORDS table and an emptyNote helper. At the eight conflicting sites (account, accounts, billing, economics, grants, system and devices pages, plus test/empty-words-all.test.ts) I kept main's emptyNote calls. I deleted the table kinds this pull had added that nothing uses any more: codes, keys, tokens, agents, devices, sentForges, processes, samples, stalls, minutes, telemetry. Their sentences now live only in NOTE_WORDS. The OWN_WORDS list in test/empty-words-all.test.ts is now main's, minus the pages this pull moved onto the table. I updated two assertions in test/account-rows.test.ts, because those two empty states now render as a plain <p class="muted"> instead of the icon block.

Juniper's change request. Capacity's two hand-written paragraphs now go through emptyLine, the compact one-line form in src/web/empty_words.ts. I widened emptyLine to accept any kind and to take an optional id, so #egress-open is kept. I used it instead of a new emptyList option because it was already that variant. I also switched the three spots juniper listed for 360px — teamAgents, loads and the /system disks <li> — from the full icon block to emptyLine. I did not raise the 25,000-byte budget.

To try it: open /settings/capacity, /system, a team page and /settings on the preview with nothing configured. Each empty state should be one muted line, and the egress line keeps the egress-open id.

[
  {"go": "/settings/capacity", "look": "Egress connections and Changes with nothing recorded", "expect": "one muted line each, no picture block, page still renders in one screen"},
  {"go": "/system", "look": "Disks and network with none read, at 360px", "expect": "a single muted line inside the list item"},
  {"go": "/settings/tokens", "look": "Access codes with none minted", "expect": "one muted sentence with its reason, followed by the new-code form"}
]
commented

<!-- look-pages b139c0dbfe5e --> Look pages for b139c0d, from the gate:

  • look pages (named): this pull changes src/web/empty_words.ts, src/web/pages/admin-limits.ts, src/web/pages/audit.ts; a commit names /system
commented

I merged main into the branch and pushed; the merge had one conflict, in test/empty-words-all.test.ts.

What conflicted. The OWN_WORDS list in that test. Both sides had edited it. main still listed admin-limits, audit, billing, system, teams, trusted and visitors as pages with their own empty-state wording. This branch moves those pages onto the shared empty-words table, so I dropped those entries.

Two more entries I dropped. boards-holds.ts and waves.ts also came off the list. Each now has zero own-worded empty states, so keeping them failed the "a page that moved to the table is off the list" check.

Checks.

  • bun scripts/gate.ts --fix changed nothing. It noted one comment over 100 columns, in visitors.ts, which the nightly rewrap handles on main.
  • bun x tsc --noEmit printed nothing; I didn't confirm its exit code.
  • The tests I ran all pass (17 tests in 4 files): the empty-words tests, admin-words, admin-limits-words and admin-lists-paged.
  • I did not run the tests scripts/fast.ts names. It picked 3,486 of 4,182 files, about 293 minutes, so I ran the ones that cover this change by hand. The forge runs the full check on the push.

How to try it. Open the admin and system pages with nothing in them (/admin/limits, the audit page, billing, teams, visitors, /system). Each should show the shared empty-words sentence, and bun test test/empty-words-all.test.ts should pass.

Approved — before the latest push

Earlier asks met: /settings/capacity now draws egress and changes through emptyLine (one muted line, #egress-open kept, under the byte budget), and teamAgents, loads and the /system disks row use the compact line, so nothing costs a picture block at 360px. design-lint is clean; empty-words-all, empty-states and capacity-first-view pass (37 tests); the preview answers 200. Next, two things I would do: (1) Non-blocking: the emptyLine id branch duplicates the paragraph; build the attribute once. (2) Non-blocking: the docs note lists kinds by wording; link the table instead so it does not drift.

commented

<!-- look-pages 486e73d54ab4 --> Look pages for 486e73d, from the gate:

  • look pages (named): this pull changes src/web/empty_words.ts, src/web/pages/admin-limits.ts, src/web/pages/audit.ts; a commit names /system
commented

That comment is the gate listing which pages it will screenshot for commit 486e73d: /system, plus the pages behind src/web/empty_words.ts, admin-limits.ts and audit.ts. It asks nothing of me, so I'm making no change.

Two things to know:

  • That commit is the one with the merge markers. I fixed the markers in b44225126, so the screenshots for 486e73d came from a build that didn't start. The next gate run should use the fixed head.
  • I haven't looked at the rendered pages myself. The preview is at https://lab--15909--forge-trevato-apps.open-platform.sh. Check /system, /admin/limits and the audit page there once it has redeployed.
commented

<!-- look-pages b44225126939 --> Look pages for b442251, from the gate:

  • look pages (named): this pull changes src/web/empty_words.ts, src/web/pages/admin-limits.ts, src/web/pages/audit.ts; a commit names /system
commented

I made no change this turn. The comment on b442251 is the gate listing the pages it will screenshot: /system, plus the pages behind src/web/empty_words.ts, admin-limits.ts and audit.ts. It asks for no fix, so there was nothing to address.

b442251 is the commit with the merge-marker fix. The preview at https://lab--15909--forge-trevato-apps.open-platform.sh answers / with 200, so it boots again. I didn't open /system or the other named pages, because they need an admin session. The branch is clean and in sync with origin.

If a reviewer sees something wrong on one of those pages, tell me which and I'll fix it.

Approved

Earlier asks are met. /settings/capacity keeps its page under budget and its #egress-open id through emptyLine. The team agents list, the loads line and the /system disks item are now one muted line each, which fits 360px. OWN_WORDS lost the moved files, and the table test holds every kind to one sentence and one link at most.

Non-blocking: (1) emptyLine now carries two near-identical return branches, so build the <p> once and add the id conditionally. (2) The loads line lost its mt spacing, so check the gap under the dl at 360px. Next I would add a test that /settings/capacity still has id=egress-open when empty.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs