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

Design: `.qf` leaves the stylesheet and docs/DESIGN.md §5d #4739

Merged opened this

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

Merged

mason/forge:mason/3908-design-qf-leaves-the-stylesheet-and-docs → main 7 commits fork

  • Merged. mason/3908-design-qf-leaves-the-stylesheet-and-docs was merged into main as e8d27c6.

Review

Sign in to review this change.
5 files changed +3 −9
docs/DESIGN.md −1
@@ -498,7 +498,6 @@ the same line (#4888).
498498 - `.owner`
499499 - `.page-head`
500500 - `.policy-line`
501 - `.qf`
502501 - `.repo-actions`
503502 - `.repo-desc`
504503 - `.repo-layout`
src/web/style/content.ts −2
@@ -203,8 +203,6 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); }
203203 .bp-h2 .chart-box.is-table { height: 400px; }
204204 .bp-h3 .chart-box.is-table { height: 540px; }
205205 .bform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 8px; }
206 .bform .qf { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; min-width: 0; }
207 .bform .qf > span { font-size: 12.5px; font-weight: 600; color: var(--fg); }
208206 .bform .field { margin: 0; flex: 1 1 140px; min-width: 0; }
209207 .bform .btn { flex: none; }
210208 .table-wrap { overflow-x: auto; max-width: 100%; }
test/boards-page.test.ts +1 −2
@@ -67,11 +67,10 @@ const listed = async (url: string) => {
6767 };
6868
6969 describe("/boards forms", () => {
70 test("the chart and pin forms are §5 fields, not .qf", async () => {
70 test("the chart and pin forms are §5 fields", async () => {
7171 const made = await makeBoard(app, admin, "Pins");
7272 expect(made.ok).toBe(true);
7373 const body = await (await get("/boards/data?source=runs&by=day", "admin")).text();
74 expect(body).not.toContain('class="qf');
7574 for (const name of ["chart", "source", "aggregate", "column", "by", "series", "from", "to", "fcolumn", "fop", "fvalue"]) {
7675 expect(body).toMatch(new RegExp(`<div class="field"[^>]*>\\s*<label for="f-${name}-\\d+">[^]*?name="${name}"`));
7776 }
test/boards-selectors.test.ts +1 −1
@@ -66,7 +66,7 @@ test("every query selector has a visible label and sits outside .row-actions", a
6666
6767 test("the selector styles never hide or collapse a control", () => {
6868 const css = components + content;
69 const rules = [...css.matchAll(/(^|\})\s*([^{}]*\.(?:bform|qf)[^{}]*)\{([^}]*)\}/g)].map((m) => m[3]!);
69 const rules = [...css.matchAll(/(^|\})\s*([^{}]*\.bform[^{}]*)\{([^}]*)\}/g)].map((m) => m[3]!);
7070 expect(rules.length).toBeGreaterThan(0);
7171 for (const body of rules) {
7272 expect(body).not.toMatch(/opacity:\s*0\b|display:\s*none|visibility:\s*hidden|height:\s*0\b/);
test/boards-view-fields.test.ts +1 −3
@@ -1,7 +1,6 @@
11 /**
22 * A board's view and its forms draw their fields as `.field` with a real
3 * `<label for>`, not the `.qf` wrapper. (The query fields in boards.ts keep
4 * `.qf` until their own issue, so those are left out of the check.)
3 * `<label for>`.
54 */
65 import { afterAll, beforeAll, expect, test } from "bun:test";
76 import { mkdtemp, rm } from "node:fs/promises";
@@ -46,7 +45,6 @@ const LABELS = ["New board", "Panel title", "Width", "Height", "Board title", "R
4645
4746 function check(html: string, labels: string[]) {
4847 for (const text of labels) {
49 expect(html, text).not.toContain(`<label class="qf"><span>${text}</span>`);
5048 const m = html.match(new RegExp(`<div class="field"[^>]*>\\s*<label for="([^"]+)">${text}</label>`));
5149 expect(m, text).not.toBeNull();
5250 expect(html.match(new RegExp(`id="${m![1]}"`, "g"))?.length, `${text} id is unique`).toBe(1);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs