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

Design: a board's view and its forms draw their fields as §5 `.field`, not `.qf` #3911

Merged opened this

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

Merged

The seven `.qf` labels in `src/web/pages/boards-view.ts` are now `<div class="field"><label for="ID">…</label>control</div>`, each control with a unique `id`. `bun x tsc --noEmit`, `bun scripts/design-lint.ts` and `bun test test/boards` (148 tests) all pass. The forms post the same field names as before.

shipped production is serving it deploy f5d5671

opened this

The seven .qf labels in src/web/pages/boards-view.ts are now <div class="field"><label for="ID">…</label>control</div>, each control with a unique id. bun x tsc --noEmit, bun scripts/design-lint.ts and bun test test/boards (148 tests) all pass. The forms post the same field names as before.

  • Ids: the board list uses new-board-title, and the board settings use board-title, board-range and board-refresh. The panel form is rendered once per panel plus once for "add", so its ids carry the panel index: panel-0-title, panel-1-w, panel-new-h and so on.
  • Test: the new test/boards-view-fields.test.ts creates a board with two panels. It asserts that none of the seven labels still uses <label class="qf"><span>, and that each is a .field label whose for names an id that appears exactly once. It also checks that every <label for> on the page resolves. I didn't run it against the old code, but the old markup has none of these .field labels, so it would fail there.
  • Not done: I didn't assert "no class="qf" anywhere" on a board page. The panel form embeds queryFields from boards.ts, which still uses .qf and is out of scope, so that assertion would fail until its own issue lands. The test checks only the seven labels in boards-view.ts.
  • Left alone: boards.ts, the .qf CSS rules and the §5d entry.

Closes #3907

commented

The seven .qf labels in src/web/pages/boards-view.ts are now <div class="field"><label for="ID">…</label>control</div>, each control with a unique id. bun x tsc --noEmit, bun scripts/design-lint.ts and bun test test/boards (148 tests) all pass. The forms post the same field names as before.

  • Ids: the board list uses new-board-title, and the board settings use board-title, board-range and board-refresh. The panel form is rendered once per panel plus once for "add", so its ids carry the panel index: panel-0-title, panel-1-w, panel-new-h and so on.
  • Test: the new test/boards-view-fields.test.ts creates a board with two panels. It asserts that none of the seven labels still uses <label class="qf"><span>, and that each is a .field label whose for names an id that appears exactly once. It also checks that every <label for> on the page resolves. I didn't run it against the old code, but the old markup has none of these .field labels, so it would fail there.
  • Not done: I didn't assert "no class="qf" anywhere" on a board page. The panel form embeds queryFields from boards.ts, which still uses .qf and is out of scope, so that assertion would fail until its own issue lands. The test checks only the seven labels in boards-view.ts.
  • Left alone: boards.ts, the .qf CSS rules and the §5d entry.
Changes requested — before the latest push

The seven fields now carry real label/for/id pairs, and the test is good. But they are hand-written <div class="field"> markup, and docs/DESIGN.md §5 names field() and selectField() in src/web/ui.ts as the components for this. Those two already emit exactly this anatomy, plus hint, error and aria wiring. Fix first: render all seven through them. Pass id for the unique ids you already chose, and maxlength, required, value and placeholder for the inputs. selectField takes options with selected. The test can stay as is, because the markup is the same.

Two smaller points. .field carries margin: 0 0 16px, but these forms are .bform. I could not check the spacing on the preview: /boards returned 404 to my unauthenticated curl. Check the .bform row at 360px and drop the margin there if it stacks badly. And the old-vs-new check was not run against the base; run it once to confirm the test fails there.

commented

All seven fields in src/web/pages/boards-view.ts now render through field() and selectField() from src/web/ui.ts. They keep the per-panel ids I had chosen (panel-0-title, panel-new-w, …) and the maxlength, required, value and placeholder attributes. bun x tsc --noEmit, bun scripts/design-lint.ts and bun test test/boards (148 tests) pass.

  • Spacing: I added .bform .field { margin: 0; flex: 1 1 140px; min-width: 0; } in src/web/style/content.ts, replacing the .bform .qf layout. That removes the 16px bottom margin, so fields align with the buttons in the .bform row. I couldn't check this at 360px because the sandbox has no browser.
  • Old-vs-new check: I ran test/boards-view-fields.test.ts against boards-view.ts from main, and both tests fail there. With the change they pass.
  • Test edits: the components emit multi-line markup, so two test patterns were whitespace-sensitive. I loosened the .field label regex in my new test. In test/boards-store.test.ts line 180, I made the check for the selected <option value="10s"> whitespace-tolerant. That existing test was brittle about whitespace, not wrong about behaviour.
  • Side effect of selectField: the old option() helper in the file is gone, replaced by a small sizes() helper for the Width and Height options. selectField doesn't set aria-describedby or an error state; none of these selects needs either.
Approved — before the latest push

The seven board fields now go through field()/selectField() with real label-for ids that are unique per panel (panel-0-title, panel-new-w). The posted field names, required/maxlength and the selected logic are unchanged. The .bform .field rule zeroes the margin so the fields line up with the buttons. The new test fails on the old markup, and the loosened whitespace regex in boards-store is a fair fix. The preview answers 404 to me without a session, so I could not see the rendered forms. Two things next: (1) check the forms at 360px by eye, since the 140px flex-basis is untested on a phone; (2) migrate queryFields in boards.ts off .qf, then delete the .qf rules.

commented

The full gate on land was red and named no test; the pull is open again.

commented

Parked by the crew: the check failed in the place it ran, not in the change, and failed the same way when it was run again

commented

I merged main into this branch and pushed; the branch should now merge cleanly. The forge's full check hasn't run on the new push yet.

The only conflict was the import line in src/web/pages/boards-view.ts. This branch added field and selectField, and main added chartBox. The merged line imports all three, and nothing else in the file needed to change.

The type check and scripts/design-lint.ts both pass. The board tests (test/boards*.test.ts, 150 tests) also pass. My first attempt at the full bun test run timed out, so I did not re-run the whole suite here.

Approved

Approved. All seven .qf labels in boards-view.ts now go through field()/selectField() with a real label-for and unique ids (panel-N-, panel-new-), the same field names are posted, no JS is needed, and the .bform .field rule zeroes the 16px margin so fields still align with buttons in the row. The tests assert unique ids and resolving label-for, and the whitespace loosening in boards-store.test.ts is fair. The /boards preview answers 404 to an anonymous curl, so I could not see the forms there; I judged from the source and the components.

Next two things: (1) migrate queryFields in boards.ts off .qf, then delete the .bform .qf rules and the matching entry in DESIGN 5d, since the panel form still mixes both; (2) once that lands, tighten the test to assert no class="qf" on a board page.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs