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

small: every list page still printing a bare "No …" takes its reason and next step from src/web/empty_words.ts #16705

Merged opened this

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

Merged

Six list pages that printed their own bare "No …" now take their words from src/core/emptywords.ts. I ran the empty-state, forges, crew, holds, client-search and no-standing-notes tests, tsc --noEmit and the design lint, and all pass. I did not run the whole suite, so tests outside those files are unchecked.

Notes

opened this

Six list pages that printed their own bare "No …" now take their words from src/core/empty_words.ts. I ran the empty-state, forges, crew, holds, client-search and no-standing-notes tests, tsc --noEmit and the design lint, and all pass. I did not run the whole suite, so tests outside those files are unchecked. bun scripts/gate.ts --fix printed nothing and I did not look into that.

emptyLine takes three new options, sentence, action and attr. A page can add a link or a data attribute without writing its own sentence. I reused emptyLine and emptyList rather than adding a new component.

Pages moved (all in src/web/pages/):

Tests:

  • A new test in test/empty-states.test.ts fails without the change. It checks that /forges, /crew and /boards/holds draw the table's sentence, and that the filtered forges line has the right markup.
  • I changed three existing assertions because the words moved, not because behaviour changed. forges-language.test.ts and keys-forges-list.test.ts now expect the sentence with its full stop instead of the old h2. client-search.test.ts expects " around the search term, because the search term is now escaped.

Left alone:

  • browse.ts already uses emptyList with a title that names its filter.
  • commits.ts and display.ts already pass their sentences through empty.
  • people.ts ("No apps yet" inside a table cell) and home_flow.ts ("No hosted forges yet" inside a status link) are not list pages.
  • Everything else under No in pages/ is a form error, a sentence in a paragraph or a doc comment.
  • The packs page test is not covered by a render test, because the seeded packs mean it never renders empty.

To try it: open /forges on an account that has sent no forges, then /forges?q=zzz, then /crew with no agents.

🤖 Generated with Claude Code

Closes #15950

7 earlier comments
commented

Six list pages that printed their own bare "No …" now take their words from src/core/empty_words.ts. I ran the empty-state, forges, crew, holds, client-search and no-standing-notes tests, tsc --noEmit and the design lint, and all pass. I did not run the whole suite, so tests outside those files are unchecked. bun scripts/gate.ts --fix printed nothing and I did not look into that.

emptyLine takes three new options, sentence, action and attr. A page can add a link or a data attribute without writing its own sentence. I reused emptyLine and emptyList rather than adding a new component.

Pages moved (all in src/web/pages/):

Tests:

  • A new test in test/empty-states.test.ts fails without the change. It checks that /forges, /crew and /boards/holds draw the table's sentence, and that the filtered forges line has the right markup.
  • I changed three existing assertions because the words moved, not because behaviour changed. forges-language.test.ts and keys-forges-list.test.ts now expect the sentence with its full stop instead of the old h2. client-search.test.ts expects " around the search term, because the search term is now escaped.

Left alone:

  • browse.ts already uses emptyList with a title that names its filter.
  • commits.ts and display.ts already pass their sentences through empty.
  • people.ts ("No apps yet" inside a table cell) and home_flow.ts ("No hosted forges yet" inside a status link) are not list pages.
  • Everything else under No in pages/ is a form error, a sentence in a paragraph or a doc comment.
  • The packs page test is not covered by a render test, because the seeded packs mean it never renders empty.

To try it: open /forges on an account that has sent no forges, then /forges?q=zzz, then /crew with no agents.

🤖 Generated with Claude Code

commented

<!-- look-pages 78737a72152a --> Look pages for 78737a7, from the gate:

  • look pages (inferred): this pull changes src/web/empty_words.ts, src/web/pages/boards-holds.ts, src/web/pages/crew.ts and 3 more; the forge pictures / (src/web/empty_words.ts), /docs (src/web/empty_words.ts), /explore (src/web/empty_words.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The "both doors" gate failed because the pull edits several src/web/pages/ files and has no src/tui/ change or docs/features/ how-to. I pushed an empty commit whose message carries a No door: line saying why. I haven't seen the forge's re-run, so I don't know yet whether the check now passes.

The line says the empty-words table only moves the pages' existing text into one place. The words printed are unchanged, so the terminal has nothing new to show.

I didn't re-run bun scripts/gate.ts --fix, tsc or any tests locally, and I made no code change in this push. gate.ts --fix produced nothing to commit, so the long-comment note stays; the gate calls it informational.

The diff of this branch against main is large and removes many test files, which suggests main has moved since the branch was cut. I didn't look into it.

commented

<!-- look-pages 612f0d529dce --> Look pages for 612f0d5, from the gate:

  • look pages (inferred): this pull changes src/web/empty_words.ts, src/web/pages/boards-holds.ts, src/web/pages/crew.ts and 3 more; the forge pictures / (src/web/empty_words.ts), /docs (src/web/empty_words.ts), /explore (src/web/empty_words.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

I pushed an empty commit that narrows the gate's inferred look pages to /forges and /crew, using Looks: lines. I haven't seen the forge's re-run, so I don't know yet whether it accepts the narrowing.

The gate inferred 31 pages because src/web/empty_words.ts is imported by many routes. Only the lists with nothing in them print those words. I picked /forges and /crew as the two to picture, and they are my choice, not something the gate required.

I made no code change in this push. The No door: line is repeated in the new commit message, since the gate reads the pull's commit messages.

commented

<!-- look-pages 04e44ee6cb43 --> Look pages for 04e44ee, from the gate:

  • look pages (inferred): "Looks: /forges" is not a page of app.looks in forge.json; this pull changes src/web/empty_words.ts, src/web/pages/boards-holds.ts, src/web/pages/crew.ts and 3 more; the forge pictures / (src/web/empty_words.ts), /docs (src/web/empty_words.ts), /explore (src/web/empty_words.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The gate rejected my last push because /forges and /crew aren't in app.looks in forge.json. I pushed an empty commit with a No look: line instead. I haven't seen the forge's re-run, so I don't know whether it accepts that.

The line says the new words print only on a list with nothing in it, and no page in app.looks is shown empty. I also say the tests render those lists directly, but I didn't re-check that this time.

I didn't add /forges or /crew to app.looks, since that changes which pages the forge pictures on every push. If you want an empty list pictured, say which page and I'll add it.

There is no code change in this push.

commented

I've addressed all six points and pushed. The six affected test files pass, tsc is clean and design-lint is clean. I ran no other tests, and the forge hasn't run its check on this push yet.

What changed

  • Test (1, 6): the old test skipped any non-200 page. Skipping hid that /crew and /boards/holds don't exist, since both return 404. It now asserts a 200 and each page's own sentence on the real routes, /forges, /settings/crew and /boards. Packs is rendered directly for admin and non-admin.
  • forgesMatch (2): dropped from the table, so no entry goes unprinted. The search and state lines on /forges go back to their own markup (<p data-empty>…), which also reverts my edit to client-search.test.ts. Their words depend on the query and CLIENT_STATE_EMPTY, so they can't live in the table.
  • emptyLine (3): back to its original two options, so the raw(" " + attr) door is gone. Holds (data-no-holds) and the display-choices line keep their own markup and take only the table's sentence.
  • Headings and action size (4, 5): a new emptySection(kind, {reason, action}) draws the table's sentence as an <h2>, then the reason, then the action in a normal-size <p>. Forges none-sent, /settings/crew and packs use it. The <h2>No forges sent yet</h2> assertion in forges-language.test.ts is back, and a new test checks the crew heading.

The No door: and No look: lines are repeated in the latest commit message, reworded: headings and sizes are now unchanged, so they hold.

The gate prints two "one implementation?" notes about similar code, emptyLine against emptySection and a test helper against one in map-page.test.ts. I left them: the two functions differ in what they draw and take different options.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs