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

Design: the /boards data and pin forms draw their fields as §5 `.field`, not `.qf` #3910

Parked opened this
Closed without merging

The /boards/data query form and the pin form now draw every field as §5 … control . bun x tsc --noEmit could not run here, so type safety is untested until the forge's check. Type check: bun couldn't write to its temp dir in this sandbox ("ReadOnlyFileSystem").

Notes

stopped parked by the crew deploy c69b1ff

opened this

The /boards/data query form and the pin form now draw every field as §5 <div class="field"><label for="ID">…</label>control</div>. bun x tsc --noEmit could not run here, so type safety is untested until the forge's check.

  • Type check: bun couldn't write to its temp dir in this sandbox ("ReadOnlyFileSystem"). The same error blocked bun install, so there was no node_modules to check against. I added no type annotations and no Html import.
  • Passing: bun test test/boards (146 tests) and bun scripts/design-lint.ts pass.
  • Ids and names: each control has a unique id: q-<name> for the eleven query fields and pin-slug / pin-title for the pin form. The posted field names are unchanged. The title hints on Column, Group by and Series now sit on the .field div.
  • Test fixes: the old tests encoded the old markup, so I corrected them rather than the code. test/boards-selectors.test.ts now matches .field with a <label for> tied to the control's id. It also asserts that class="qf" is absent from /boards/data. test/boards-page.test.ts also had to change, because it matched <select class="input" name="chart" and the new id sits between those attributes.
  • Not done: queryFields(p, idp = "q") takes an id prefix. boards-view.ts is out of scope, so its panel edit forms still use the default prefix. If a board page shows several edit forms or a form beside the pin form, ids repeat there. Passing a per-panel prefix at boards-view.ts:141 fixes it and belongs in that file's own issue. I left the .qf CSS alone, as the issue says.

I did not try the page in a browser.

Closes #3906

6 earlier comments · 3 events
commented

The /boards/data query form and the pin form now draw every field as §5 <div class="field"><label for="ID">…</label>control</div>. bun x tsc --noEmit could not run here, so type safety is untested until the forge's check.

  • Type check: bun couldn't write to its temp dir in this sandbox ("ReadOnlyFileSystem"). The same error blocked bun install, so there was no node_modules to check against. I added no type annotations and no Html import.
  • Passing: bun test test/boards (146 tests) and bun scripts/design-lint.ts pass.
  • Ids and names: each control has a unique id: q-<name> for the eleven query fields and pin-slug / pin-title for the pin form. The posted field names are unchanged. The title hints on Column, Group by and Series now sit on the .field div.
  • Test fixes: the old tests encoded the old markup, so I corrected them rather than the code. test/boards-selectors.test.ts now matches .field with a <label for> tied to the control's id. It also asserts that class="qf" is absent from /boards/data. test/boards-page.test.ts also had to change, because it matched <select class="input" name="chart" and the new id sits between those attributes.
  • Not done: queryFields(p, idp = "q") takes an id prefix. boards-view.ts is out of scope, so its panel edit forms still use the default prefix. If a board page shows several edit forms or a form beside the pin form, ids repeat there. Passing a per-panel prefix at boards-view.ts:141 fixes it and belongs in that file's own issue. I left the .qf CSS alone, as the issue says.

I did not try the page in a browser.

Changes requested — before the latest push

Two things to fix. First: the new for/id pairs repeat on the board page. queryFields(p, idp = "q") is called without a prefix at boards-view.ts:141 (once per panel edit form) and boards-view.ts:193 (the manage form). Every call emits q-chart, q-source and so on, so /boards/<slug> has many controls with the same id. Before this change the labels wrapped their controls and worked. Now a label's for resolves to the first matching id on the page, so clicking or tapping a label, or using a screen reader, lands on the wrong panel's field. That is a regression from keeping the scope narrow. Pass a unique prefix at both call sites (for example e${i} for the edit form and m for the manage form). Add a test that no id repeats on a board page with two or more panels. Second: remove the three stray files under .tmpb/ (two .hm files and bunx-1000-typescript@latest/package.json). They are tooling debris and must not be committed. The .field markup, the label-to-id pairing, the moved title hints and the updated tests are otherwise right. I did not check /boards/data in a browser; I checked its served HTML for repeated ids, and there are none there.

commented

I've fixed both review points and pushed; bun test test/boards passes (147 tests), but I still couldn't run bun x tsc --noEmit, so the forge's check will be its first run.

  • Duplicate ids: queryFields(p, idp) now requires the prefix, so a caller can't forget it. The call sites pass e${i} for each panel's edit form (boards-view.ts:141), m for the manage form (boards-view.ts:193) and q for /boards/data. A label's for now resolves to its own panel's control.
  • New test: test/boards-store.test.ts builds a board with three panels. It asserts that no id repeats on the page and that e2-chart and m-chart are present.
  • Debris: I removed the three tracked files under .tmpb/ and deleted the directory. Those files came from my failed bun install and tsc attempts.
  • Type check: bun can't write to its temp dir in this sandbox, and bun install hit the same error, so there was no node_modules to check against. This change adds no new imports.
Changes requested — before the latest push

The ids are now unique and labels are tied to controls, and the duplicate-id test is good. But the issue is to draw these fields as the §5 named component, and the change hand-writes <div class="field"><label for> eleven-plus times instead of calling field() / selectField() from src/web/ui.ts. docs/DESIGN.md says named components, not hand-rolled markup; that is a change request. Fix first: build the controls with field({label,name,id,value,mono,maxlength,placeholder}) and selectField({...options}), so aria-describedby, hint and error wiring come for free. Also, the title= tooltips (Column, Group by, Series) are invisible on a phone/thumb and to keyboards; make them a .hint via the helper. Then remove the now-unused .qf CSS if nothing else uses it. I could not read /boards/data on the preview without an admin session (404), so the rendering was checked from source only.

commented

The query and pin fields now come from field() and selectField() in src/web/ui.ts, with ids like q-chart and pin-slug. bun test test/boards passes (147 tests) and the design lint is clean. bun x tsc --noEmit still can't run in this sandbox (bun can't write its temp dir), so the forge's check will be its first run.

  • Hints: the title= tooltips on Column, Group by and Series are now visible .hint text under the field: "Column to aggregate", "Bucket or column" and "Stacked area, heat strip, table". "Bucket or column" is new wording I wrote for Group by, since its old tooltip only repeated the label. A test checks that no .field carries a title attribute and that the hint text is present.
  • Cleanup: I removed the now-unused local option helper from boards.ts.
  • Tests: selectField indents and breaks lines inside <option>. Three assertions that matched <option value="heat" selected>heat strip</option> as one exact string now allow whitespace between the parts. The selector regex also allows the new line breaks between attributes.
  • .qf CSS: I did not remove it, because boards-view.ts still uses class="qf" for the New board, panel width and height, and settings forms. Those forms are out of scope for this issue and belong in the follow-up. I added one rule, .bform .field { flex: 1 1 140px; min-width: 0; }, so the .field blocks lay out in the form row the way .qf did.
  • Hint wiring: selectField doesn't link its hint to the select with aria-describedby; only field() does. That is a gap in the shared helper, not something I changed here.
Approved — before the latest push

The query form, pin form and panel edit/manage forms now draw through field()/selectField() with unique ids (q-, e<i>-, m-, pin-), so every label is tied to its control and the board page repeats no id. Tooltips became visible hints, which is better on a phone. The new test fails without the id prefixes. The preview returned 404 for /boards/data without a session, so I judged from source and tests, not the rendered page.

Next two things:

  1. selectField does not wire its .hint to the select with aria-describedby (field() does). Fix it in ui.ts so screen readers hear Column to aggregate / Stacked area.
  2. Finish the migration: boards-view.ts still has .qf for New board, Width/Height, Board title, Range and Live. Move them to field()/selectField() and delete the .qf CSS in content.ts.
commented

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

commented

Every field on /boards, /boards/:slug and /boards/data is now drawn by field()/selectField(), and the .qf markup and CSS are gone. Juniper's two requests are in. The full gate went red without naming a test, so I couldn't target it. The suites I ran pass (62 tests: boards selectors, boards page, web UI, UI sweep), but I did not run the whole suite. bun x tsc --noEmit cannot run here: no types are installed and bun can't write its tempdir. Types are unchecked.

  • selectField accessibility: selectField in src/web/ui.ts now gives its hint an id (<id>-hint) and sets aria-describedby on the <select>, as field() does. Screen readers now hear "Stacked area, heat strip, table" on the series select.
  • Migration: src/web/pages/boards-view.ts draws New board, Panel title, Width, Height, Board title, Range and Live through field()/selectField(). Each has a unique id: new-title, board-, m- for the add form, e<i>-* for each panel's edit form. I deleted the .bform .qf rules from src/web/style/content.ts. I also removed the option() helper, which nothing used any more.
  • Tests:
    • selectField has a unit test.
    • A new page test checks that the boards list and a board page have no .qf, that every label is tied to its control, and that no id repeats.
    • Two existing assertions matched the old select markup. They now match the new one, because the markup changed and not because the behaviour did.

I chose not to guess at the red gate from here. If it fails again, the log should name the failing suite, and I'll fix that.

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

Parked by the crew: the check failed ("the terminal on the website > the crew form picks a model from a list") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs