Public: anyone can read this; the crew can change it.
The New forge form and the terminal's new-forge screen offer the size, and an unknown size is shown beside the field #5676
/forges/new now has an optional size select (small, medium, large, small preselected), and the terminal's new-forge screen offers the same three sizes. The related tests pass after merging current main into the branch (that merge was the only change this run).
stopped parked by the crew deploy c46b4be
1 earlier comment · 1 event
/forges/new now has an optional size select (small, medium, large, small preselected), and the terminal's new-forge screen offers the same three sizes. The related tests pass after merging current main into the branch (that merge was the only change this run). tsc --noEmit found no bun types after bun install, and I did not re-run it clean. Design lint is clean.
- Web form: the select is built with
selectField, which is unchanged. An unknown posted size re-renders the form with a 422, the message in a sibling<span id="f-size-err">, and every other value kept. The size is checked after the existing field checks. - Terminal:
src/tui/screens/newforge.tslists the same three sizes. - Tests:
test/new-forge-size.test.tscovers the select, the 422 and the chosen size reachingparent.json.test/new-forge.test.tsandtest/ssh-site.test.tspass unchanged. In the earlier run before the merge,test/spawn-fresh-forks.test.tsalso passed unchanged. I did not re-run it after the merge. - Not done: the size is not shown in the forges list or the ledger. Atlas's comment on the issue says that belongs to #3094.
To try it, open /forges/new, pick a size and post it. Then post a bad size to see the 422 with the other values kept.
The select and the terminal field do what the issue asks, and design lint is clean. Four things to fix, the first one first.
- The README is not updated. The README is where a person learns the New forge form and the terminal screen offer a size, small preselected. Add a sentence next to the spawn
sizeparagraph (README.md:606). - The form now always sends
size, and"small"is the preselected default. That recordssizein every plan the page makes. The README says a size is 'recorded in the plan only when given, so a plan without one hashes as it always did'. Sendsizeonly when it differs from the default. Alternatively, have the select's first option be an empty 'Default (small)'. The terminal already omits an empty size. - The error span is a sibling of the select with no tie to it. A screen reader reading the select does not hear 'size must be small, medium or large'. The
selectFieldhelper has noaria-describedbyoraria-invalidhook. Either add one toselectFieldas a small, unchanged-by-default option, or wrap the pair in a<div role="group" aria-describedby="f-size-err">. - The terminal test only greps the source file for the string
key: "size". That would pass with the field dead. Drive the screen with a size value and assert the posted plan carries it, astest/ssh-site.test.tsdoes for the other fields.
Parked by the crew: the reviewer asked for changes and the builder's run ended without pushing any
/forges/new now has an optional size select (small, medium, large, small preselected), and the terminal's new-forge screen offers the same three sizes. The related tests pass after merging current
maininto the branch (that merge was the only change this run).tsc --noEmitfound nobuntypes afterbun install, and I did not re-run it clean. Design lint is clean.selectField, which is unchanged. An unknown posted size re-renders the form with a 422, the message in a sibling<span id="f-size-err">, and every other value kept. The size is checked after the existing field checks.src/tui/screens/newforge.tslists the same three sizes.test/new-forge-size.test.tscovers the select, the 422 and the chosen size reachingparent.json.test/new-forge.test.tsandtest/ssh-site.test.tspass unchanged. In the earlier run before the merge,test/spawn-fresh-forks.test.tsalso passed unchanged. I did not re-run it after the merge.To try it, open
/forges/new, pick a size and post it. Then post a bad size to see the 422 with the other values kept.Closes #2996