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

Errors on the crew page are §5's field error, not .error-note #5091

Merged opened this

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

Merged

The three `error-note` uses in `src/web/pages/crew.ts` are gone, and a test now checks that a refused crew edit shows its error beside the field. `bun test` passes for `web-apps` and `crew-sandbox` (49 tests) and `design-lint` is clean. I couldn't type-check, because `tsc` failed on the missing `bun` types.

shipped production is serving it deploy 0af2c9c

opened this

The three error-note uses in src/web/pages/crew.ts are gone, and a test now checks that a refused crew edit shows its error beside the field. bun test passes for web-apps and crew-sandbox (49 tests) and design-lint is clean. I couldn't type-check, because tsc failed on the missing bun types.

  • The three uses: They weren't form errors. They were the readiness warnings at the top of the page: no crew runner, the crew can't run, and unsandboxed. Each is now a card with tone: "danger", which is §5's existing component. The crew-unsandboxed id is kept.
  • Form errors: The agent form already used field(), so a refused budget, brief or model already shows as .field[data-invalid] > .error and needed no code change.
  • Tests: In test/web-apps.test.ts, a refused create and a refused edit (both with a bad budget) now check three things. The response is a 422. The error is the .error span in the budget's .field[data-invalid]. The page has no error-note. The refused edit also checks that the stored budget is unchanged.
  • Left alone: The .error-note rule and §5d stay, as the issue says. I added no docs file or new class.

Closes #5069

commented

The three error-note uses in src/web/pages/crew.ts are gone, and a test now checks that a refused crew edit shows its error beside the field. bun test passes for web-apps and crew-sandbox (49 tests) and design-lint is clean. I couldn't type-check, because tsc failed on the missing bun types.

  • The three uses: They weren't form errors. They were the readiness warnings at the top of the page: no crew runner, the crew can't run, and unsandboxed. Each is now a card with tone: "danger", which is §5's existing component. The crew-unsandboxed id is kept.
  • Form errors: The agent form already used field(), so a refused budget, brief or model already shows as .field[data-invalid] > .error and needed no code change.
  • Tests: In test/web-apps.test.ts, a refused create and a refused edit (both with a bad budget) now check three things. The response is a 422. The error is the .error span in the budget's .field[data-invalid]. The page has no error-note. The refused edit also checks that the stored budget is unchanged.
  • Left alone: The .error-note rule and §5d stay, as the issue says. I added no docs file or new class.
Approved

The three readiness warnings on the crew page (no runner, cannot run, unsandboxed) are now card() with tone danger, which is a named §5 component. The crew-unsandboxed id is kept. The agent form already used field(), so its errors needed no change. The new tests pin the field error beside the budget for both a refused create and a refused edit, and that no error-note appears. The preview answers. I did not log in to the crew page, so I did not see the cards rendered there. The change is small, in scope and works with JavaScript off. Two things to do next: (1) the card puts the warning text in a non-live region, so consider role="alert" on the no-runner and cannot-run cards. (2) error-note is still used in account.ts, repo.ts, browse.ts and fleet-graph.ts, so the rule and §5d have to stay until those move as well.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs