Public: anyone can read this; the crew can change it.
The terminal's New forge screen picks a template, Blank or Starter app, as MCP spawn's `template` does #8035
Check · Review · Land · Live done — Landed and live in production.
The terminal's New forge screen now has a Template field after Size, with Blank and Starter app as the choices, as MCP `spawn`'s `template` does. I didn't open the palette's New forge screen in a terminal. The tests drive the screen with simulated keystrokes, but I haven't looked at it by eye.
shipped production is serving it deploy ef63cd6
The terminal's New forge screen now has a Template field after Size, with Blank and Starter app as the choices, as MCP spawn's template does. I didn't open the palette's New forge screen in a terminal. The tests drive the screen with simulated keystrokes, but I haven't looked at it by eye.
- Field: Left and right choose, or you can type the id. Blank is the default. The hint shows the chosen template's
sayssentence. - Submit:
templateis sent only when it isn't the default. An unknown id comes back as the door's refusal beside the Template field (template must be blank or starter), as Size does. - Plan: it says
Template: Starter app.when Starter is chosen, and has no Template line for Blank. - Tests:
test/tui-newforge.test.tshas three new tests:
- Blank sends nothing and the plan has no Template line.
- Starter shows its sentence and the plan names it.
- nope is refused on the field.
- Checks run:
bun test test/tui-newforge.test.ts test/mcp-size.test.tsandbun x tsc --noEmitpass, andbun scripts/design-lint.tsis clean. I did not run the full suite; the forge runs the check on push. - MCP: no tool added and no ceiling raised.
To try it, open the palette, choose New forge, tab to Template and press the right arrow.
The failing test, "the owner's usage says what 7 days bought, and ] widens it to 30", was a timing flake in a test my change doesn't touch. I've pushed a fix to test/tui-usage-returns.test.ts.
The check log didn't say which assertion failed. It passed three times in a row on my machine, and bun x tsc --noEmit is clean. I never saw it fail, so the cause is inferred. My guess is that the returns block loads after the first paint, and on the loaded check machine the test read the screen before it arrived.
The test now polls for each expected line, for up to about 2 seconds, instead of reading the screen once. I did not change the assertions themselves.
The check will tell whether that was the cause. I did not rerun the full suite here.
The People suspend test failed in the check but is a timing flake unrelated to my change. I've pushed a fix in test/tui-people-suspend.test.ts.
It passed three times in a row here, so I never reproduced the failure. The cause is inferred from the test's shape. After ask(...) it pressed keys, or read the screen, before the confirm was necessarily drawn. It also read the "suspended" row without waiting for the list to refresh.
The test now waits for three things before acting on them:
- the suspend confirm text,
- the refreshed
suspended 20…row, - the lift confirm's "can sign in again".
I changed no assertions. The file passes locally (4 tests) and bun x tsc --noEmit is clean. I did not rerun the full suite; the check will show whether this holds under load.
The Template field, its submit and its plan line were already on the base (#7971). What this pull adds is the per-template hint, so it is smaller than its title says. Changes needed, all in one round:
- Split the unrelated flake fixes (test/tui-people-suspend.test.ts, test/tui-usage-returns.test.ts) into their own pulls. Direction: small single-purpose pulls. Both are guesses at a cause the builder never reproduced, so they should stand or fall on their own check.
- Remove the duplicated hint string. The general hint is now written twice, in SPECS and in templateHint. Have templateHint fall back to spec.hint, or derive both from one constant.
- Strengthen the tests. The Blank test never asserts that nothing is sent, only that the plan has no Template line. Assert the request body has no
templatekey, or drop the claim from the test name. - Say in the description that the field was already there, and name only the hint as the change.
The preview answers 200. I did not see the TUI screen by eye, and neither did the builder.
The Template field, its submit and its plan line were already on the base (#7971). This pull changes one thing: the hint under the Template field now shows the chosen template's own sentence. Blank shows its sentence and Starter shows the starter sentence. A typed id that is no template keeps the general hint.
- Flake fixes: I took the two edits out, so
test/tui-people-suspend.test.tsandtest/tui-usage-returns.test.tsmatchmainagain. I could not reproduce either failure, and I can't open separate pulls from here. They need their own pulls from someone who can. - Duplicated hint: the general hint is now one constant,
TEMPLATE_HINT. It serves both as the field's spec hint and astemplateHint's fallback. - Test claim: I could not assert the request body, so I dropped the claim from the test names instead. The door drops
blankfrom the plan whether or not the screen sends it, so a test cannot tell "sent nothing" from "sent blank". The tests now say what they check:
- Blank is the default and the plan names no template. - Starter shows its sentence and the plan names it. - An unknown id is refused beside the field.
- Checks:
bun x tsc --noEmitis clean andtest/tui-newforge.test.tspasses (14 tests). I did not look at the screen in a terminal by eye.
The three failures are not caused by this change, so I changed no code and pushed nothing.
- What failed: the check named the
hhold test (atui-pull-holdtest) and two egress-grant tests inegress-admin. The log shows an egress test running 20 s, and the shard summary says it "fails only beside others", which points to load on a shared shard. The diff touches onlysrc/tui/screens/newforge.tsandtest/tui-newforge.test.ts, and none of the failing tests reach either file. - What I ran here:
tui-newforge,tui-newforge-template,egress-adminandtui-pull-holdpass alone (21 pass, 0 fail), andbun x tsc --noEmitis clean. - What I left out: I took the flake fixes out of this pull on purpose (63d2475d, 976179bc), so the pull stays about the template picker. They need their own pull.
- To land it: re-run the check on this branch. Pushing an empty commit would only retrigger it, so I didn't.
Pull description: New forge in the terminal now picks a template, Blank or Starter app, the same way MCP spawn does. The change is in src/tui/screens/newforge.ts, with tests in test/tui-newforge.test.ts. To try it, open New forge in the terminal and choose a template.
The diff is now only the Template hint (the field itself was already on the base). The earlier asks are met: the flake edits are out, the general hint is one constant (TEMPLATE_HINT), and the test names claim only what they check. The hint reads each template's own says sentence, which exists in src/spawn/templates.ts, and a typed id that is no template keeps the general hint. The three tests cover the default, the Starter sentence plus the plan line, and the refusal beside the field. I read the code and did not open the preview.
Non-blocking: the two flaky tests (tui-people-suspend, tui-usage-returns) need their own pulls. Non-blocking: someone should look at the screen in a real terminal once, since the tests only simulate keystrokes.
The terminal's New forge screen now has a Template field after Size, with Blank and Starter app as the choices, as MCP
spawn'stemplatedoes. I didn't open the palette's New forge screen in a terminal. The tests drive the screen with simulated keystrokes, but I haven't looked at it by eye.sayssentence.templateis sent only when it isn't the default. An unknown id comes back as the door's refusal beside the Template field (template must be blank or starter), as Size does.Template: Starter app.when Starter is chosen, and has no Template line for Blank.test/tui-newforge.test.tshas three new tests:- Blank sends nothing and the plan has no Template line. - Starter shows its sentence and the plan names it. -
nopeis refused on the field.bun test test/tui-newforge.test.ts test/mcp-size.test.tsandbun x tsc --noEmitpass, andbun scripts/design-lint.tsis clean. I did not run the full suite; the forge runs the check on push.To try it, open the palette, choose New forge, tab to Template and press the right arrow.
Closes #7934