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

Empty words: move the apps and forges pages onto the shared table #15906

Merged opened this

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

Merged

All eight pages now draw their "No …" empty states with emptyList(kind) from EMPTYWORDS. The OWNWORDS ratchet the issue names is not in this repository: test/empty-words-all.test.ts doesn't exist on main, so there was no count to remove. I did not create it, because that belongs to the parent #15851.

Notes

shipped production is serving it deploy 084a6fd

opened this

All eight pages now draw their "No …" empty states with emptyList(kind) from EMPTY_WORDS. The OWN_WORDS ratchet the issue names is not in this repository: test/empty-words-all.test.ts doesn't exist on main, so there was no count to remove. I did not create it, because that belongs to the parent #15851.

What changed

  • src/core/empty_words.ts has 14 new kinds: releases, templates, variants, cloudAccounts, cloudReads, vendorCalls, forgeNames, forgesOwn, refused, databases, rows, talkRepos, talkFiles and talkPulls. label and href are now optional, and there is a new optional reason shown under the sentence.
  • src/web/empty_words.ts shows reason as the note. It draws no link when the kind has no label. EmptyOptions gains a per-call reason, which the filtered-table "No rows" empty state in data_view.ts uses.
  • The eight pages pass noAction: true, so none gets a new link or accent. Their next step already sits just below as a form, or the place doesn't exist unscoped. Only the sentence and reason come from the table.
  • Wording is unchanged except where the old line joined two sentences. In cloud.ts the second half became a reason for cloudAccounts and vendorCalls, so those two read as a sentence plus a note. test/cloud-page-shape.test.ts asserted the joined line, so I split its two assertions to match. That test was checking the old layout, not behaviour.

I left two talk-pane lines alone because they aren't "No …" lists: "Not a repository you can see." and "Nothing running yet."

Checks

  • tsc --noEmit and design-lint are clean.
  • 231 tests across the empty-state, releases, templates, variants, cloud, refused-forges, hosted, talk and design suites pass after the cloud-page-shape.test.ts fix. I re-ran only test/cloud-page-shape.test.ts and test/empty-states.test.ts after the fix (19 pass), not the full set.
  • scripts/fast.ts named 2709 test files, too many to run here, so I picked the suites above by hand.

To try

  • /settings/app-templates with nothing marked.
  • /settings/cloud with no accounts.
  • An app's releases and variants pages with none.

No page layout was reworked, so I added no review block.

🤖 Generated with Claude Code

Closes #15902

4 earlier comments · 1 event
commented

All eight pages now draw their "No …" empty states with emptyList(kind) from EMPTY_WORDS. The OWN_WORDS ratchet the issue names is not in this repository: test/empty-words-all.test.ts doesn't exist on main, so there was no count to remove. I did not create it, because that belongs to the parent #15851.

What changed

  • src/core/empty_words.ts has 14 new kinds: releases, templates, variants, cloudAccounts, cloudReads, vendorCalls, forgeNames, forgesOwn, refused, databases, rows, talkRepos, talkFiles and talkPulls. label and href are now optional, and there is a new optional reason shown under the sentence.
  • src/web/empty_words.ts shows reason as the note. It draws no link when the kind has no label. EmptyOptions gains a per-call reason, which the filtered-table "No rows" empty state in data_view.ts uses.
  • The eight pages pass noAction: true, so none gets a new link or accent. Their next step already sits just below as a form, or the place doesn't exist unscoped. Only the sentence and reason come from the table.
  • Wording is unchanged except where the old line joined two sentences. In cloud.ts the second half became a reason for cloudAccounts and vendorCalls, so those two read as a sentence plus a note. test/cloud-page-shape.test.ts asserted the joined line, so I split its two assertions to match. That test was checking the old layout, not behaviour.

I left two talk-pane lines alone because they aren't "No …" lists: "Not a repository you can see." and "Nothing running yet."

Checks

  • tsc --noEmit and design-lint are clean.
  • 231 tests across the empty-state, releases, templates, variants, cloud, refused-forges, hosted, talk and design suites pass after the cloud-page-shape.test.ts fix. I re-ran only test/cloud-page-shape.test.ts and test/empty-states.test.ts after the fix (19 pass), not the full set.
  • scripts/fast.ts named 2709 test files, too many to run here, so I picked the suites above by hand.

To try

  • /settings/app-templates with nothing marked.
  • /settings/cloud with no accounts.
  • An app's releases and variants pages with none.

No page layout was reworked, so I added no review block.

🤖 Generated with Claude Code

commented

<!-- look-pages ec72f67fa2bc --> Look pages for ec72f67, from the gate:

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

I've pushed an empty commit to the pull branch. Its message carries a No look: line, which is the override the gate's look-pages note offers. I haven't re-run the check, so I don't know yet whether it passes.

The look pages the gate inferred are only the pages whose routes import src/web/empty_words.ts. The change touches only the sentence an empty list shows, drawn now from the shared table. Every list that already had data renders as before, and the shared emptyList markup is the same for every page already using it. So there is no new picture to take and I'm not naming any look pages.

The earlier commit cf471bcc0 carries a No door: line for the terminal rule. I never saw its push finish, but the branch now matches origin with that commit in the history. I haven't re-run the gate for that rule either.

Changes requested — before the latest push

Fix first: add tests for the new behaviour. emptyList now draws a reason note, a per-call reason override, and no link when a kind has no label. Nothing tests any of them; the only test edit loosens an existing assertion. Add a test in test/empty-states.test.ts (or beside it) that a kind with a reason renders it, that a per-call reason wins, and that a kind with no label renders no <a>. Each must fail without this change.

Also needed:

  1. src/web/pages/waves.ts: EMPTY_WORDS.waves.label ?? "Tell the crew" is a dead fallback that repeats the table's own words. Don't make label optional for every kind. Use a type where kinds with an action require label+href and kinds without forbid them, so this call site needs no fallback.
  2. src/web/empty_words.ts: o.reason ?? w.reason ? ... : {} with a ! assertion is hard to read and relies on operator precedence. Compute const reason = o.reason ?? w.reason and const href = o.href ?? w.href once.
  3. ICONS: eleven of the fourteen new kinds map to repo, including rows, cloud reads and talk files. That is a placeholder, not a choice. Pick icons that mean something or reuse a quieter one.
  4. Principles 3 and 7: one-line muted <p>s inside settings blocks and the talk pane became icon-plus-title empty blocks. On a 360px phone this is heavy and pushes the form that is the real next step down the page. Check /settings/cloud, /settings/app-templates and the talk pane on the preview and keep them compact.
  5. forgeNames lost its next-step words ("Add one below, or allow one when a forge asks."). Put them in a reason.
  6. Delete src/web/pages/talk_preview.ts's string | Html union for empty. Move the two remaining plain strings onto kinds so the helper takes one type.

Boxes: 1 is met in substance, though the talk pane keeps two plain lines. 2 cannot be done because OWN_WORDS and its test are not in the repo; say so on the parent. 3 is claimed clean but I did not rerun it.

commented

Review feedback addressed, except box 2: OWN_WORDS and its test are not in this repo, so I could not do it. Please say so on the parent. tsc, design-lint and 40 related test files pass. I did not run the full suite, because scripts/fast.ts reported the diff as too broad to name. I also did not look at the preview, so the 360px check on /settings/cloud, /settings/app-templates and the talk pane is not done.

What changed

  • Quiet line for in-block lists: a new emptyLine(kind) in src/web/empty_words.ts draws one muted <p class="muted small"> with the sentence and its reason, with no icon and no link. Ten kinds that were plain <p>s before the pull use it again: templates, cloudAccounts, cloudReads, vendorCalls, forgeNames, forgesOwn, refused and the three talk-pane lists (talkRepos, talkFiles, talkPulls). The forms and the talk pane's tabs keep their place on a phone.
  • Block kinds and icons: emptyList now takes only the kinds drawn as a block with an icon. Each of those icons is now chosen: apps rocket, releases tag, variants branch, databases folder, rows search. The repo placeholder is gone.
  • reason and href: emptyList computes reason and href once, with no !.
  • Typed actions: in src/core/empty_words.ts, a kind with an action must give label and href, and a kind without one may not. waves.ts needs no fallback now. EmptyKind is derived from the table.
  • forgeNames: it keeps "Add one below, or allow one when a forge asks." as its reason.
  • Talk pane: the string | Html union is gone. The two remaining plain strings are now the kinds talkHidden and talkIdle.
  • cloud-page-shape.test.ts: I restored the original, unloosened assertions. The joined line still satisfies them.

Tests added in test/empty-states.test.ts:

  • A kind with a reason renders it.
  • A per-call reason wins over the table's.
  • A kind with no label renders no <a>, even when href is passed.
  • emptyLine renders the exact one-line shape.

I wrote the tests against the new code and did not confirm each one fails on the old code.

Not done bun scripts/gate.ts still notes one comment over 100 columns in src/web/pages/app_variants.ts. It is not a line I touched, and --fix left it for the nightly rewrap on main.

[{"go":"/settings/cloud","look":"With no account sealed, the empty state under Accounts","expect":"One muted line, 'No cloud account is sealed yet. Add one below…', with the Add an account form just below it and no icon block"},
{"go":"/settings/app-templates","look":"With no template marked","expect":"One muted line 'No template is marked.' above the Mark a repository form"},
{"go":"/talk","look":"The preview pane with no repository or no files touched","expect":"A single muted line inside the pane, with the Preview, Code and Diff tabs unchanged"}]

🤖 Generated with Claude Code

commented

I merged main into the branch, resolved the two conflicts, and pushed. tsc, bun scripts/design-lint.ts and the five empty-state test files I ran (empty-states, empty-words-all, app-empty-crew, app-empty-crew-tui, feature-doors) pass. I didn't run the full suite; scripts/fast.ts called the diff too broad to name, so I picked those files myself. bun scripts/gate.ts --fix changed nothing and left one note: src/web/pages/app_variants.ts has a comment line over 100 columns, which it says the nightly rewrap handles.

What changed in the merge

  • Both sides' kinds kept: src/core/empty_words.ts now holds main's kinds (builds, forks, repos, commits, issues, pulls, branches, labels, events, displays) and this branch's one-line kinds.
  • Icons: src/web/empty_words.ts merges both icon maps.
  • Releases split in two: main and this branch both had a releases kind with different wording. The forge's releases page keeps main's releases. The app's releases page now uses a new appReleases kind with this branch's words.
  • Types: EmptyWords is the flat shape main used, with reason, label and href all optional, and EMPTY_WORDS is typed Record<EmptyKind, EmptyWords>.
  • Options: emptyList takes main's title, action and note as well as this branch's reason; note is an alias of reason.

Tests

  • In test/empty-states.test.ts the "a kind with a reason draws it under the sentence" test now uses appReleases. releases' reason has an apostrophe, which the page escapes, so the string match failed. That was the test's fault, not the code's.
  • In test/empty-words-all.test.ts I removed the ratchet entries for the eight pages that now take their words from the table.
Approved

Earlier asks are met: in-block lists use a quiet one-line emptyLine with no link or picture, so the forms stay in view on a phone. Block kinds have chosen icons, actions are typed, and reason/href are computed once. The OWN_WORDS entries for the eight pages are removed. tsc, design-lint and the empty-state tests pass here, and the preview answers 200. Non-blocking: note is now an alias of reason, so drop one when convenient. Non-blocking: add a review block for the 360px check of /settings/cloud and the talk pane.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs