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

Component library: skeleton, toast and confirm dialog as ui.ts parts, each in the gallery #16683

Merged opened this

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

Merged

I merged main into the branch and pushed it. The design, layout, gallery and audit tests pass, but I couldn't run the whole suite here and I didn't re-run the repo-wide gate. In tsc, the only errors left in src/ are latin1/utf-16 encoding ones that don't come from these files.

Notes

opened this

I merged main into the branch and pushed it. The design, layout, gallery and audit tests pass, but I couldn't run the whole suite here and I didn't re-run the repo-wide gate. In tsc, the only errors left in src/ are latin1/utf-16 encoding ones that don't come from these files. Tests that need happy-dom couldn't run here because the package is missing (palette is one). The forge's check will run them on this push.

Conflicts

  • Gallery address: main already uses /design/components for the theme explorer and /design/gallery for the static gallery. The living parts gallery from this pull now lives at /design/parts, with its own designPartsPage handler, route, tests, docs and audit entry. All three pages stay.
  • Admin link: main rebuilt the user menu without a Components item, so the /design/parts link is now a "Component parts" entry in the admin command palette. The gallery test checks for it there.
  • Toast: toast() in src/web/ui.ts takes a new optional ask slot. The flash toast in layout.ts uses it, so main's "ask whoever can" button still shows.
  • Other files: layout.ts keeps main's new icon import and the Docs link in the help dialog. origins.ts keeps the toast() call with main's 300-character cap. In repo.ts I took main's removal of the fetch-error toast.
  • Rest of the merge: reserved.ts, server.ts and browse.ts combine both sides.

Follow-ups the merge needed

  • Added gallery specimens for the four new ui.ts parts: popout, messageText, rowList and statusBadge. hintAttr, keyHint and chartFrame are listed as not drawn.
  • Updated docs/design/quiet-debt.json for the bare lists in the skeleton and picker.
  • Changed the 1440px frame rule to min-width to satisfy the new phone-width lint.

Not done

  • I didn't merge the two galleries or the two /design/components pages.
  • The gate's complaints about README sections and a missing terminal screen don't match this diff, which doesn't touch the README. I put Replaces: and No door: lines in the commit messages instead.

To try it: sign in as an admin and open /design/parts. /design/components and /design/gallery are unchanged from main.

Continues #16683

Show 10 earlier items

7 earlier comments
commented

/design/parts is now named as a look page through a commit message instead of forge.json. The new commit is an empty one, 93ebe9fad, with a Looks: /design/parts line.

I didn't add it to app.looks because that list is capped at 32 paths and already full. When I tried, test/forge-looks.test.ts and test/looks-owner.test.ts failed with 33 paths. Those tests had passed before the edit, so I reverted it. I ran the six look test files before pushing. The only failure on the clean tree is the real-chromium capture test (a real capture through the grant door, with /usr/bin/chromium), which fails here without my change.

The previous commit 48c510a19 already carried the same Looks: line, but the gate's comment still said "inferred". The gate reads it as named once the change is in the tree: gate.ts now reports "look pages (named): … a commit names /design/parts". I'm pushing a fresh commit in case the gate only reads the newest one.

No code changed in this round. bun scripts/gate.ts --fix and bun x tsc --noEmit showed nothing to fix. The gate does print two similarity notes that I left alone:

  • dialogParts in src/web/ui.ts against boardRow in src/web/pages/board.ts.
  • mk in test/design-gallery.test.ts against mk in test/board-pins.test.ts.
commented

<!-- look-pages 93ebe9fadc73 --> Look pages for 93ebe9f, from the gate:

  • look pages (inferred): "Looks: /design/parts" is not a page of app.looks in forge.json; this pull changes src/web/client.ts, src/web/gallery.ts, src/web/layout.ts and 6 more; the forge pictures / (src/web/client.ts), /docs (src/web/client.ts), /explore (src/web/client.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 look-pages note should now be waived, but I haven't seen the gate re-run on the new push. No code changed. This round only adds one more empty commit, 3131c6c8c.

The earlier Looks: /design/parts line didn't count. src/kernel/look_rule.ts only accepts a Looks: path that is already a page of app.looks in forge.json. /design/parts isn't one, and the list is capped at 32 paths and full. Adding it breaks the cap test in test/forge-looks.test.ts and the allowed-path check in test/looks-owner.test.ts.

The new commit carries a No look: waiver explaining this, and the rule treats that as an override. This is a choice. Making /design/parts a pictured page would mean raising the cap or dropping an existing look, and that decision is yours. Until then, open /design/parts on the preview to see the change: https://lab--16683--forge-trevato-apps.open-platform.sh/design/parts

The note is informational and never fails the check.

[{"go":"/design/parts","look":"skeleton, toast and confirm dialog specimens","expect":"each renders in its own framed section, no layout shift"}]
commented

Skeleton, toast and the confirm dialog are ui.ts parts, each with a specimen in src/web/gallery.ts, and the hand-written copies now use them. I merged current main into the branch and pushed it.

  • Parts: skeleton() (list or card shape), toast() (tone, role, message, optional link or code) and dialogParts() (head, body, foot), all in src/web/ui.ts.
  • Callers moved:
    • flashToast in layout.ts, and the toasts in pages/repo.ts, pages/browse.ts and pages/origins.ts, call toast().
    • The shortcuts dialog in layout.ts and the confirm form in pages/limb.ts call dialogParts().
    • No page writes .toast or the dialog head, body and foot by hand.
  • Gallery: specimens for all three, with tones, long-text and error states. test/design-gallery.test.ts enforces them.
  • Docs: docs/design/areas/toast.md and docs/design/areas/dialog.md describe the parts.

bun x tsc --noEmit, bun scripts/design-lint.ts and test/design-gallery.test.ts (17 pass) are clean on the merged branch. I did not run the rest of the suite here; the forge runs the full check on the push. bun scripts/gate.ts --fix passes, but it printed two "one implementation?" notes:

  • dialogParts is 0.67 like boardRow in pages/board.ts.
  • The test helper mk in test/design-gallery.test.ts is 1.00 like mk in test/board-pins.test.ts.

I left both alone: dialogParts and boardRow draw different things, and the two mk helpers are test-local.

I left the existing empty state, segmented filter, field error and copy button alone, as the issue asks.

To try it, open /design/components and look at the skeleton, toast and dialogParts rows.

[
  {"go": "/design/components", "look": "skeleton, toast and dialogParts specimens", "expect": "each shows its states with no layout shift; the skeleton still animates under reduced motion"},
  {"go": "/design/components", "look": "toast, long text state", "expect": "the message wraps and the icon stays in place"}
]

🤖 Generated with Claude Code

commented

The check failed because /talk was 16 bytes over its CSS ceiling. /talk ships 56,080 B of gzipped CSS, and its ceiling was 56,064 B. The overage comes from this pull's toast and confirm-dialog styles.

I raised only the /talk entry in docs/design/size-budget.json: CSS from 56,064 to 57,344 B and JS from 41,984 to 42,496 B. Every other page already passes its own ceiling. test/client-size.test.ts passes, 7 of 7. I did not rerun the rest of the suite.

The size test's own regeneration command, FORGE_SIZE_WRITE=1, raises every page's ceiling. I discarded that output and copied over only the /talk entry, so no other page gets looser headroom. The JS ceiling moved with CSS because the regeneration rounds both together, though only CSS was over.

The fix is commit 5c90a8f0b.

commented

Skeleton, toast and the confirm dialog are ui.ts parts, each with a gallery specimen. The hand-written copies now use them. This run only merged the latest main into the branch and pushed it.

  • Parts: skeleton() takes a list or card shape and a row count. toast() takes a tone, role, message, and an optional link or code. dialogParts() draws the dialog's head, body and foot.
  • Callers moved:
    • flashToast in layout.ts and the toasts in pages/repo.ts, pages/browse.ts and pages/origins.ts call toast().
    • The shortcuts dialog in layout.ts and the confirm form in pages/limb.ts call dialogParts().
    • Nothing writes .toast or the dialog's head, body and foot markup by hand.
  • Gallery: specimens for all three in src/web/gallery.ts, enforced by test/design-gallery.test.ts.
  • Docs: docs/design/areas/toast.md and docs/design/areas/dialog.md describe the parts.

After the merge, bun x tsc --noEmit is clean and test/design-gallery.test.ts passes (17 tests). I did not run the rest of the suite here; the forge runs the full check on the push. I left the existing empty state, segmented filter, field error and copy button alone, as the issue says.

To try it, open /design/components and look at the skeleton, toast and dialogParts rows.

[
  {"go": "/design/components", "look": "skeleton, toast and dialogParts specimens", "expect": "each shows its states with no layout shift; the skeleton still animates under reduced motion"},
  {"go": "/design/components", "look": "toast, long text state", "expect": "the message wraps and the icon stays in place"}
]

🤖 Generated with Claude Code

commented

Nothing new this run. Skeleton, toast and the confirm dialog are already ui.ts parts with gallery specimens, the hand-written copies use them, and the branch is pushed and up to date with main.

  • Parts: skeleton() takes a list or card shape and a row count. toast() takes a tone, role, message, and an optional link or code. dialogParts() draws the dialog's head, body and foot.
  • Callers moved:
    • flashToast in layout.ts and the toasts in pages/repo.ts, pages/browse.ts and pages/origins.ts call toast().
    • The shortcuts dialog in layout.ts and the confirm form in pages/limb.ts call dialogParts().
    • Nothing writes .toast or the dialog's head, body and foot markup by hand.
  • Gallery: specimens for all three in src/web/gallery.ts, enforced by test/design-gallery.test.ts.
  • Docs: docs/design/areas/toast.md and docs/design/areas/dialog.md describe the parts.

bun x tsc --noEmit is clean and test/design-gallery.test.ts passes (17 tests). I did not run the rest of the suite here; the forge runs the full check on the push. I left the existing empty state, segmented filter, field error and copy button alone, as the issue says.

To try it, open /design/components and look at the skeleton, toast and dialogParts rows.

[
  {"go": "/design/components", "look": "skeleton, toast and dialogParts specimens", "expect": "each shows its states with no layout shift; the skeleton still animates under reduced motion"},
  {"go": "/design/components", "look": "toast, long text state", "expect": "the message wraps and the icon stays in place"}
]

🤖 Generated with Claude Code

commented

This round takes /design/parts out and puts the three parts into the existing /design/gallery, so the pull is now the parts and nothing else.

I did not run the whole suite or the forge's full check. I ran tsc, scripts/gate.ts --fix, scripts/design-lint.ts, and 212 tests across the design, docs, unused-exports, limb, origins, palette and layout files. All pass. scripts/fast.ts named 3,814 files for this diff, so I picked those files by hand.

  • One gallery (1): /design/gallery now draws dialogParts() for the dialog sample and toast() for the toast sample. The toast sample shows three toasts: success, attn with a link, and danger with a code. It also has a new skeleton sample, and the §5 table gets a skeleton row. I deleted src/web/gallery.ts, src/web/pages/design_components.ts and the /design/parts route. The theme, width and part switches went with them.
  • Scope (2): searchPicker, its client.ts script, its tests and both palette entries are gone. client.ts is main's again.
  • Design principles and width rules (3, 4, 5): .gallery-stage, the card per part, the heading sentence and the inline-size rules were all part of the deleted page, so none remain.
  • size-budget.json (extra): I reverted it to main's version; the /talk raise is no longer needed. test/client-size.test.ts passes.
  • quiet-debt (6): skeleton now builds its list with rowList. quiet-debt.json and unused-exports-allow.json (8) are main's again.
  • Docs (7): areas/gallery.md and docs/features/design-gallery.md are main's again, so there is one H1 and no claim about a terminal door for a parts page.
  • Tests: test/design-gallery.test.ts now covers the three parts and checks that the gallery has a specimen for each.

I did not ask for /design/gallery to be added to app.looks: the list is capped at 32 and full. The latest commit carries a No look: line saying so. The page to open on the preview is /design/gallery, at the toast / flash, dialog and skeleton sections.

[{"go":"/design/gallery","look":"the toast / flash, dialog and skeleton sections","expect":"three toasts, a dialog with head body and foot, a list skeleton and a card skeleton, all inside the usual gallery frames"}]
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs