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

The /boards chart and pin forms wrap each input in §5's .field, and no .qf remains in src/web/pages/boards.ts #4719

Merged opened this

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

Merged

Every input in the `/boards` chart form and the pin form is now a §5 field with its label, and `src/web/pages/boards.ts` has no `.qf` left. The new `/boards` test and the boards, selector, pin and design-lint tests pass locally. I couldn't run the type check: `bun x tsc --noEmit` stops on a missing `bun` type definition in this sandbox, before it checks any source.

shipped production is serving it deploy 1a6be99

opened this

Every input in the /boards chart form and the pin form is now a §5 field with its label, and src/web/pages/boards.ts has no .qf left. The new /boards test and the boards, selector, pin and design-lint tests pass locally. I couldn't run the type check: bun x tsc --noEmit stops on a missing bun type definition in this sandbox, before it checks any source.

  • Fields: The 11 query fields (chart, source, aggregate, column, group by, series, from, to, filter column, filter operator, filter value) use selectField/field. The pin form's Board and Panel title do too. The "Column to aggregate" and series titles became hints. I dropped the "Group by" title because it only repeated the label.
  • Unique ids: queryFields is also used by each panel's edit form, so one page can hold many copies of it. Each call gets its own ids (f-chart-3, …) so every <label for> points at one control.
  • Tests: A new test in test/boards-page.test.ts asserts each field by name (a .field wrapper with a <label for> before the control) and that no class="qf remains. It also checks the hint and the pin form's Board and Panel title.
  • Changed tests: Three existing tests asserted the old markup, so I updated their selectors:

- the chart-select and selected-option assertions in test/boards-page.test.ts; - the label regex in test/boards-selectors.test.ts; - the selected-option assertion in test/boards-store.test.ts.

  • Left alone: The .bform .qf rules in src/web/style/content.ts and docs/DESIGN.md are untouched, as the issue says. The design lint is clean, so there was no docs/design/baseline.json count to lower.

Try it: open /boards/data as an admin. The chart form and its pin form sit under the chart once a board exists.

Closes #4689

commented

Every input in the /boards chart form and the pin form is now a §5 field with its label, and src/web/pages/boards.ts has no .qf left. The new /boards test and the boards, selector, pin and design-lint tests pass locally. I couldn't run the type check: bun x tsc --noEmit stops on a missing bun type definition in this sandbox, before it checks any source.

  • Fields: The 11 query fields (chart, source, aggregate, column, group by, series, from, to, filter column, filter operator, filter value) use selectField/field. The pin form's Board and Panel title do too. The "Column to aggregate" and series titles became hints. I dropped the "Group by" title because it only repeated the label.
  • Unique ids: queryFields is also used by each panel's edit form, so one page can hold many copies of it. Each call gets its own ids (f-chart-3, …) so every <label for> points at one control.
  • Tests: A new test in test/boards-page.test.ts asserts each field by name (a .field wrapper with a <label for> before the control) and that no class="qf remains. It also checks the hint and the pin form's Board and Panel title.
  • Changed tests: Three existing tests asserted the old markup, so I updated their selectors:

- the chart-select and selected-option assertions in test/boards-page.test.ts; - the label regex in test/boards-selectors.test.ts; - the selected-option assertion in test/boards-store.test.ts.

  • Left alone: The .bform .qf rules in src/web/style/content.ts and docs/DESIGN.md are untouched, as the issue says. The design lint is clean, so there was no docs/design/baseline.json count to lower.

Try it: open /boards/data as an admin. The chart form and its pin form sit under the chart once a board exists.

commented

The /boards chart form and the pin form now use §5's field() and selectField() for every input, and src/web/pages/boards.ts has no .qf left. The check had failed on a type error in the first push. I've fixed it and pushed again.

bun x tsc --noEmit is clean now; the first time I couldn't run it because the sandbox had no bun types. The boards page, store and selector tests pass (51), and I haven't run the full suite.

  • Fields: All 11 query inputs (chart, source, aggregate, column, group by, series, from, to, filter column, filter operator, filter value) and the pin form's Board and Panel title are fields with their labels. The titles on Column and Series became hints. I dropped the "Group by" title because it only repeated the label.
  • The type error: the select helper passed hint: undefined when a field had no hint, which exactOptionalPropertyTypes rejects. It now passes hint only when there is one.
  • Unique ids: each call to queryFields gets its own ids (f-chart-3, …). Each panel's edit form calls it too, so one page can hold many copies, and every label still points at one control.
  • Tests: A new test in test/boards-page.test.ts fetches /boards/data with a board present and asserts each field by name and that no class="qf remains. It also checks the Column hint and the pin form's Board and Panel title.
  • Tests I changed: Three existing assertions matched the old markup, so I updated their selectors. They are the chart-select and selected-option checks in test/boards-page.test.ts, the label regex in test/boards-selectors.test.ts, and the selected-option check in test/boards-store.test.ts. The tests were wrong, not the code.
  • Not touched: The .bform .qf rules in src/web/style/content.ts and docs/DESIGN.md stay for the follow-up. The design lint is clean, so there was no docs/design/baseline.json count to lower.

To try it, open /boards/data as an admin; the pin form shows once a board exists.

Approved

Approved. Every chart-form and pin-form input is now a §5 field/selectField with a for-linked label, no .qf is left in boards.ts, and the existing .bform .field rule keeps the flex layout so phones wrap as before. Ids are unique per queryFields call, which matters because each panel edit form repeats the fields. Server-rendered, so it works with JS off. The test fails without the change. I did not reach the preview page (anonymous /boards answered 404), so I judged the markup from source. Next: (1) move the doc comment onto queryFields and drop the module counter for an id prefix passed by the caller, so output is deterministic and cacheable; (2) in the follow-up, delete the now-dead .bform .qf rules in content.ts and update docs/DESIGN.md.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs