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

The New forge page offers the built-in templates as radio choices, defaulting to today's behaviour, server-rendered with no script #14147

Merged opened this

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

Merged

/forges/new now shows the templates as radio buttons, one per built-in template with its sentence, and Blank is checked by default. It renders on the server with no script.

Notes

opened this

/forges/new now shows the templates as radio buttons, one per built-in template with its sentence, and Blank is checked by default. It renders on the server with no script. The tests I ran pass (the new file plus templates-page, template-unknown, new-forge and spawn-template, and the other test files that reference /forges/new). tsc and design-lint are clean too. I did not run the full suite, and I did not check the 360 px layout in a browser.

  • Radios replace the select: src/web/pages/new-forge.ts now has a "Template" fieldset in place of the old select. Template repositories the viewer can read still appear as extra radios after the built-in ones.
  • Moved out of "More options": the fieldset sits above the "More options" disclosure, so the choice is visible without opening it. I took template out of the list of fields that force that disclosure open on an error, because it no longer lives there.
  • ?template=<id>: a valid id is preselected. An unknown id falls back to Blank and is never echoed into the page.
  • Template list: it already existed in src/spawn/templates.ts, so there is no second copy.
  • New test: test/new-forge-template.test.ts covers three things.
    • The page has one radio per template with its sentence, and Blank is checked.
    • ?template=starter preselects Starter, and an XSS-shaped id is ignored and not echoed.
    • A posted starter reaches spawnDoor and stays checked on the plan page.
  • Existing tests changed: these asserted <select>/<option selected> for the template field, so I rewrote them to check radios. They are new-forge, spawn-template, template-unknown and templates-page.

I added an empty "Try:" commit because the pre-push hook required one.

Left out: no CSS change; the radios reuse the existing check label pattern from the follow-mode radios.

To try it: open /forges/new and then /forges/new?template=starter.

Closes #14122

4 earlier comments
commented

/forges/new now shows the templates as radio buttons, one per built-in template with its sentence, and Blank is checked by default. It renders on the server with no script. The tests I ran pass (the new file plus templates-page, template-unknown, new-forge and spawn-template, and the other test files that reference /forges/new). tsc and design-lint are clean too. I did not run the full suite, and I did not check the 360 px layout in a browser.

  • Radios replace the select: src/web/pages/new-forge.ts now has a "Template" fieldset in place of the old select. Template repositories the viewer can read still appear as extra radios after the built-in ones.
  • Moved out of "More options": the fieldset sits above the "More options" disclosure, so the choice is visible without opening it. I took template out of the list of fields that force that disclosure open on an error, because it no longer lives there.
  • ?template=<id>: a valid id is preselected. An unknown id falls back to Blank and is never echoed into the page.
  • Template list: it already existed in src/spawn/templates.ts, so there is no second copy.
  • New test: test/new-forge-template.test.ts covers three things.
    • The page has one radio per template with its sentence, and Blank is checked.
    • ?template=starter preselects Starter, and an XSS-shaped id is ignored and not echoed.
    • A posted starter reaches spawnDoor and stays checked on the plan page.
  • Existing tests changed: these asserted <select>/<option selected> for the template field, so I rewrote them to check radios. They are new-forge, spawn-template, template-unknown and templates-page.

I added an empty "Try:" commit because the pre-push hook required one.

Left out: no CSS change; the radios reuse the existing check label pattern from the follow-mode radios.

To try it: open /forges/new and then /forges/new?template=starter.

commented

I merged main into the branch and pushed it. Git reported no conflicts, so there was nothing to resolve by hand in docs/features/maintenance.md or src/maintain/registry.ts.

  • Type check: bun x tsc --noEmit printed nothing, so it is clean.
  • Tests: I ran the six test files covering the New forge page and templates, plus the new maintenance test from main, and all 51 pass. I did not run the full suite. scripts/fast.ts said the diff was too broad to name tests, so I picked these myself.
  • Gate: bun scripts/gate.ts --fix did not pass. It reports two things on this pull:
    • It could not trace the page route for src/web/pages/new-forge.ts, so it wants a Looks: <path> or No look: <why> line.
    • It wants a change under src/tui/ or a how-to under docs/features/ for the same edit, or a No door: <why> line in a commit message.

    I did not add either, so a reviewer will need to decide those. The gate may also have failed before the merge.

commented

<!-- look-pages 0df90e01a477 --> Look pages for 0df90e0, from the gate:

  • look pages (none): this pull changes src/web/pages/new-forge.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The gate now passes locally (no output from bun scripts/gate.ts), and I've pushed two commits to fix the "both doors" failure. I didn't rerun the tests, since only docs and commit messages changed since the last green run. The forge's check hasn't reported on this push yet.

  • Commit 495f75633: adds a "Choosing on the page: radios" section to docs/features/new-forge-template.md.
  • Commit 369abab00: adds an empty commit with a No door: line and a No look: line. The No door: line says the terminal's New forge screen already cycles the same template list. The No look: line says the form is a plain list of radios and the gate can't trace a page route for it.

Adding the docs section alone did not clear the gate's "both doors" rule locally, so I added the No door: line to the commit message. The two commit-message lines are the reviewer's call.

commented

The New forge page now offers the built-in templates as server-rendered radios, Blank checked by default. This update fixes the Blank radio's missing name and ties the hint and error to the group, both raised in review.

  • Blank label: the default radio now reads "Blank: only the apps you fork and the fresh one you describe." It had read "The forge's own code: …". Every template label now starts with its title, so the radio matches what the hint names. The change is in templateOptions in src/web/pages/new-forge.ts.
  • Hint: it now says "What the new forge starts from besides the apps you fork." with the Templates link. I dropped "Blank is the default" because the label says it.
  • Screen readers: the hint span has the id f-template-hint, and the fieldset has aria-describedby pointing at it. When the field has an error, aria-describedby also lists f-template-err, so a screen reader reads the hint and the error with the group.
  • Test changed: test/new-forge.test.ts asserted the old "The forge's own code" label, which was wrong after this change. It now asserts the Blank label and the aria-describedby attribute.

bun x tsc --noEmit printed nothing, and the three tests covering the page (test/new-forge-template.test.ts, test/new-forge.test.ts, test/template-unknown.test.ts) pass, 26 in all. bun scripts/gate.ts --fix showed no problems for the last two commits.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs