Public: anyone can read this; the crew can change it.
/templates shows each template's latest picture beside its name, with a plain placeholder when it has none #14584
Check · Review · Land · Live done — Landed and live in production.
Each template on /templates now shows a 64×40 picture before its name, or a same-sized box with its initial when it has none. The new test file and the existing templates, template-use and TUI tests pass (31 tests), and tsc, gate.ts --fix and the design lint are clean.
shipped production is serving it deploy 6dfa34b
7 earlier comments · 1 event
/templates now shows each template's newest look beside its name, or a box with its initial when there is none. I fixed the "both doors" failure and pushed. The other failure, apps: a slow test step, I did not look at or run, and it may be flaky.
- "both doors" failure: the check treats every file in
src/web/pages/as a page that needs a terminal screen.template_picture.tsis a helper for/templates, not a page. I moved it tosrc/web/template_picture.tsand updated its imports and the one import intemplates.ts./templateskeeps its existing terminal door. - Verification:
tsc --noEmitis clean.test/doorless.test.tsandtest/templates-picture.test.tspass (8 tests), andbun scripts/gate.ts --fixprints nothing. - Slow-test-step failure: the check log doesn't tie it to this pull. It sits in an area this change doesn't touch (a deploy whose test step sleeps). Please re-run the check, and if it fails again I'll look at it.
- To try it: open
/templates. Templates with a look show a 64×40 lazy-loaded picture whose alt text is the template's id. Built-ins and templates without a look show the initial in a box.
I merged main into the branch and pushed it. The only conflict was in src/web/pages/templates.ts, in the row markup.
I kept both sides: each row still shows the template's picture or initial box, and it now also shows the preview link that main added after the description. Type-check is clean, and the 201 tests in the template test files pass. I did not run the full suite. The sandbox blocked two outbound connections to localhost:80 during those tests.
bun scripts/gate.ts --fix rewrapped long comments in two files, and I committed those in the same merge commit.
Review block
[{"go":"/templates","look":"each template row","expect":"the picture (or initial box) sits before the name, and the preview link follows the description"}]The check failed because my earlier gate --fix rewrapped comments in src/git/pace.ts and test/check-times.test.ts, which this pull doesn't touch. I restored both files to main's version and merged the latest main again. bun scripts/gate.ts now passes, tsc is clean, and test/templates-picture.test.ts passes (4 tests). I didn't re-run the other template tests.
The diff against main is now five files:
docs/design/areas/templates.mdsrc/web/pages/templates.tssrc/web/style/components.tssrc/web/template_picture.tstest/templates-picture.test.ts
No other source or test file differs from main. I pushed this as ede74b223.
Review block
[{"go":"/templates","look":"each template row","expect":"the picture (or initial box) sits before the name, and the preview link follows the description"}]The feature works on the preview (rows carry .template-thumb) and the shape follows the repo. Changes before it lands, all in one round:
- Tests are too loose for box 3: the alt-escape test only checks
alt=is present, not that the hostile title is escaped inside the attribute; the speed test is a 500 ms bound that would pass for any page, so it does not hold 'under its budget'. There is also no test that a private/unfetchable look yields the placeholder, which is the main reason thumbLook exists here. - Design principle 6: the 1px border around the thumb is a box around a thing. Drop it and let the muted background carry the shape.
- Principle 8 / a11y: alt repeats the adjacent bold title, so a screen reader says the name twice. Keep alt naming the template as the issue asks, but make it distinct, e.g.
Latest look of ${title}. - Phone at 360px: the 64px thumb sits in a flex
.rowwith the text and the button; confirm the row wraps rather than squeezing the sentence, and addmin-width:0handling if it does not. - The initial is computed with an inline spread expression in the template literal; pull it into a small named helper.
Both-doors: /templates already has its terminal screen and a picture has no terminal form, so no TUI work is asked; no README change, good.
All five review points are addressed in 638f89edf. tsc and gate are clean, and the picture and page-budget tests pass (14 tests). I did not run the rest of the suite or look at the page on a 360px viewport.
- Tests:
- The alt-escape test now asserts the exact escaped attribute,
alt="Latest look of "><script>…", and that no raw<script>appears. - A new test seeds a template whose only look is a phone shot (the owner's view). A stranger gets the box with its initial and no
<img>. - I removed the 500 ms speed test and added
/templatesto the repo's page budget instead, insrc/perf/page_budgets/templates.ts. It is walked signed out, with a 50 ms median and a 12-statement limit; it measured 5 statements and about 3 ms on the seeded forge. The two tests intest/page-budget.test.tsthat pin the roster now list it too.
- The alt-escape test now asserts the exact escaped attribute,
- Border: I dropped the 1px border on
.template-thumb; the muted fill carries the shape. - Alt text: It now reads
Latest look of <title>. - 360px: I did not confirm this by eye. The sentence was a flex item with no
min-width: 0, so I made itflex: 1 1 0; min-width: 0; overflow-wrap: anywherein#templates form.row. The 64px thumb and the button keep their size. - Initial: It is now the exported
templateInitial()insrc/web/pages/templates.ts, with its own test.
Review block
[{"go":"/templates at 360px width","look":"a row with a long description","expect":"thumb, wrapped sentence and button on one line, nothing squeezed or overflowing"},{"go":"/templates","look":"a template with no picture","expect":"a plain muted box with the template's initial, no border"}]Pushed. The check should now go green on the failures this pull caused; the rest were already red on main, so this push does not fix them.
Mine, fixed: /templates had no entry in docs/design/size-budget.json. That broke "no first page's client JavaScript or CSS passes its ceiling" and "the ceiling file names exactly the budgeted pages". I regenerated the ceilings with FORGE_SIZE_WRITE=1 bun test test/client-size.test.ts. /templates now has js 21760 and css 47616, and every other page's css ceiling went up by 512 or 1024. The generator rewrote those, and I kept them rather than trimming the diff by hand. client-size, gate-size-ceiling-merged and templates-picture pass locally.
Not mine, left alone: a clean checkout of origin/main fails these on its own:
fetch-timeout:src/http/server.ts:3243andsrc/kernel/outbound.ts:206callfetchwith no signal.outbound-sweep(#14664):src/maintain/duties/edge_kept.tsnames the forge's own host unnamed.docs-link:docs/HOPS.mdhas no line inDOC_LINES.llms-budget:/llms.txtis over its byte budget.- The SQL-statement count on
/maintenance(86 against a budget of 83) tripspage-budget, and the matching count on/api/v1/maintenance/duties(69 against 66) tripspages-budget. I did not rerunllms-budgeton my branch.
Those need fixes on main; this pull touches none of them. I did not run tsc or the gate script this round.
The five remaining failures come from main, not from this pull. I merged the latest main and pushed, but no code of mine changed this round, so the check will most likely still be red on these five.
<timetest:src/web/pages/passkeys.ts:395writes a<time>by hand. My diff touches neither that file nor any<time>markup. I rerantest/time-element.test.tslocally on the merged tree and it fails on that line alone.- The other four: I did not rerun them this round. They were already failing on a clean
origin/mainin the last round, before the new merge:fetch-timeout: afetchinsrcwith no signal.llms-budget:/llms.txtover its byte budget.page-budget:/maintenanceruns more SQL statements than its budget.pages-budget: the same count on/maintenanceand/api/v1/maintenance/duties.
This pull is a change to the Templates page: it shows each template's latest picture, with a size ceiling for /templates and the CSS ceilings regenerated. It does not alter any of those five areas. I did not run tsc or the gate script this round.
To try it, open /templates on the preview.
The check is still going to fail on this push, but nothing it fails on comes from my change. I merged the latest main and reran the failing tests locally. test/client-size.test.ts and test/templates-picture.test.ts pass, and the /templates page (the one this pull changes) is not named in any failure.
What still fails, all in code this pull does not touch:
fetch-timeout:src/http/server.ts:3248andsrc/kernel/outbound.ts:206callfetchwith no signal.llms-budget:/llms.txtis 80797 bytes against a budget of 80500.page-budget:/changelogruns 22 SQL statements against a budget of 21.pages-budget:/maintenanceruns 86 against 83, and/api/v1/maintenance/dutiesruns 69 against 66.- Time and wait tests: the
<time>hand-written-markup test and the "wait is one budget under 25 s" test (#13794) were in the failure list but did not show up in my local run. I did not look into them separately.
They fail the same way on a clean origin/main, so I left them alone. They need fixes or raised budgets on main. I did not touch their budget files or tests, since doing that here would hide real regressions that belong to other pulls.
This pull itself is the Templates page showing each template's latest picture, plus the /templates size ceiling. To try it, open /templates on the preview.
I merged main into the branch and pushed. src/web/pages/templates.ts was the only conflict.
The conflict: main added a note under the template list for when no template has a repository (templates-empty, one wording for admins and one for everyone else). This branch changed the same call so each row gets its picture. I kept both, so the list now passes the pictures and the empty-state note still follows it.
Checks:
tscis clean.gate.ts --fixchanged nothing.- The templates tests,
client-sizeandpage-budgetpass: 69 tests across 12 files.
I did not run the full suite; the forge's check does that on the push.
To try it, open /templates on the preview. Each template should show its latest picture, and a forge with no repository-backed templates should show the empty-state note.
All five earlier asks are met: exact escaped alt assertion, private-look placeholder test, page budget replacing the timing test, border dropped, alt text now Latest look of <title>, and templateInitial exported with a test. The preview serves the placeholder box with the initial for built-ins and fixed 64x40 markup, no JS needed. Next, in order: (1) Non-blocking: check the row at 360px by eye, since it was only reasoned about; (2) Non-blocking: the placeholder uses a hard-coded font-weight; use the existing token if one exists. The raised size ceilings across all pages are generator output and acceptable.
Each template on
/templatesnow shows a 64×40 picture before its name, or a same-sized box with its initial when it has none. The new test file and the existing templates, template-use and TUI tests pass (31 tests), andtsc,gate.ts --fixand the design lint are clean. The full suite was not run here; the forge runs it on push.width/heightset so there is no layout shift. The alt text is the template's title, for examplealice/seen.src/web/pages/template_picture.tsreads every look for all the rows at once withlooksForApps, then applies the existingthumbLookandmayFetchLookchecks. A private app's picture never appears to someone who couldn't fetch it, so there is no broken image..template-thumbis added incomponents.tsand documented indocs/design/areas/templates.md.test/templates-picture.test.tscovers a template with a look, one without, a built-in, and a hostile title escaped in the alt text. It also checks the page answers quickly; that check is a loose 500 ms bound on a second request, not a tight budget./templates/owner/name) or the TUI, and there are no new dependencies.Try:line, so I added an empty commit for it.To try it, open
/templateson the preview. Any template repository that has a production look shows it.🤖 Generated with Claude Code
Closes #14558