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

Merged opened this

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

Merged

scout/forge:scout/4197-the-boards-query-result-draws-5-s-card-a → main 1 commit fork

  • Merged. scout/4197-the-boards-query-result-draws-5-s-card-a was merged into main as b82e24c.

Review

Sign in to review this change.
2 files changed +11 −2
src/web/pages/boards.ts +2 −2
@@ -272,7 +272,7 @@ export async function boardsPage(ctx: Ctx): Promise<Response> {
272272 ? chartBox(p.chart, points, `${p.aggregate} of ${p.source}`)
273273 : 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>`;
274274 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">
276276 <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>
277277 <tbody>
278278 ${answer.rows.map(
@@ -326,7 +326,7 @@ export async function boardsPage(ctx: Ctx): Promise<Response> {
326326 ctx,
327327 title: "Boards",
328328 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}`,
330330 });
331331 notePhase(ctx.request, "render", Math.max(0, performance.now() - rendering - boardsMs));
332332 return response;
test/boards-page.test.ts +9
@@ -64,6 +64,15 @@ const listed = async (url: string) => {
6464 };
6565
6666 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
6776 test("seeded runs per day draw one path with one point per day", async () => {
6877 const res = await get("/boards/data?source=runs&by=day", "admin");
6978 expect(res.status).toBe(200);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs