Public: anyone can read this; the crew can change it.
The /boards query result draws §5's card and table, and .boards-result leaves the markup #4234
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4197-the-boards-query-result-draws-5-s-card-a → main 1 commit fork
2 files
changed +11
−2
src/web/pages/boards.ts +2 −2
| @@ -272,7 +272,7 @@ export async function boardsPage(ctx: Ctx): Promise<Response> { | ||
| 272 | 272 | ? chartBox(p.chart, points, `${p.aggregate} of ${p.source}`) |
| 273 | 273 | : html`<p class="muted small">The rows behind a point, as the values of ${cols[0] ?? ""} with how many rows have each. <a href="${link({ ...p, rows: "" })}">Back to the chart</a>.</p>`; |
| 274 | 274 | result = html`${chart} |
| 275 | ${when(p.rows !== "" || p.chart !== "table", () => html`<table class="table"> | |
| 275 | ${when(p.rows !== "" || p.chart !== "table", () => html`<table class="table mt"> | |
| 276 | 276 | <thead><tr><th scope="col">${p.by}</th>${split ? html`<th scope="col">${p.series}</th>` : null}<th scope="col" class="num">${p.aggregate}</th></tr></thead> |
| 277 | 277 | <tbody> |
| 278 | 278 | ${answer.rows.map( |
| @@ -326,7 +326,7 @@ export async function boardsPage(ctx: Ctx): Promise<Response> { | ||
| 326 | 326 | ctx, |
| 327 | 327 | title: "Boards", |
| 328 | 328 | body: html`<div class="page-head"><h1>Data</h1>${btn("All boards", { href: "/boards", variant: "ghost" })}</div> |
| 329 | ${form} ${absent} ${card(result, { head: html`<h2>${p.source}</h2>`, extra: "boards-result" })} ${pin} ${sources}`, | |
| 329 | ${form} ${absent} ${card(result, { head: html`<h2>${p.source}</h2>` })} ${pin} ${sources}`, | |
| 330 | 330 | }); |
| 331 | 331 | notePhase(ctx.request, "render", Math.max(0, performance.now() - rendering - boardsMs)); |
| 332 | 332 | return response; |
test/boards-page.test.ts +9
| @@ -64,6 +64,15 @@ const listed = async (url: string) => { | ||
| 64 | 64 | }; |
| 65 | 65 | |
| 66 | 66 | describe("/boards/data", () => { |
| 67 | test("the result is drawn with §5's card and table, not .boards-result", async () => { | |
| 68 | const body = await (await get("/boards/data?source=runs&by=day", "admin")).text(); | |
| 69 | expect(body).not.toContain("boards-result"); | |
| 70 | expect(body).toMatch(/<table\s+class="table mt"/); | |
| 71 | expect(body).toContain("<h2>runs</h2>"); | |
| 72 | expect(body).toContain('<th scope="col" class="num">'); | |
| 73 | expect(body).toContain("2026-10-02"); | |
| 74 | }); | |
| 75 | ||
| 67 | 76 | test("seeded runs per day draw one path with one point per day", async () => { |
| 68 | 77 | const res = await get("/boards/data?source=runs&by=day", "admin"); |
| 69 | 78 | expect(res.status).toBe(200); |
new above
offline