Public: anyone can read this; the crew can change it.
A build's screenshots page shows its pictures under a plain heading, not a boxed card #10007
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/9999-a-build-s-screenshots-page-shows-its-pic → main 2 commits fork
2 files
changed +3
−2
src/web/pages/build_shots.ts +1 −2
| @@ -13,7 +13,6 @@ import type { Ctx } from "../../http/context.ts"; | ||
| 13 | 13 | import { crumbsFor, loadRepo, notFoundPage, repoBase, repoHeader, repoPalette } from "../chrome.ts"; |
| 14 | 14 | import { html, type Html } from "../html.ts"; |
| 15 | 15 | import { page } from "../layout.ts"; |
| 16 | import { card } from "../ui.ts"; | |
| 17 | 16 | |
| 18 | 17 | export const SHOTS_LIVE = "build.shots,build.pinned"; |
| 19 | 18 | |
| @@ -39,7 +38,7 @@ export async function shotsPage(ctx: Ctx): Promise<Response> { | ||
| 39 | 38 | )}</div>`; |
| 40 | 39 | const body = html`${repoHeader(ctx, repo, "branches", { compact: true })} |
| 41 | 40 | <div class="mt"><p class="small"><a href="${base}/builds">← Builds</a></p> |
| 42 | <div id="pin-shots" data-live="${SHOTS_LIVE}" data-live-repo="${repo.ownerName}/${repo.name}" aria-live="polite">${card(grid, { head: html`<h2>Screenshots · ${label}</h2>` })}</div></div>`; | |
| 41 | <div id="pin-shots" data-live="${SHOTS_LIVE}" data-live-repo="${repo.ownerName}/${repo.name}" aria-live="polite"><h2>Screenshots · ${label}</h2>${grid}</div></div>`; | |
| 43 | 42 | return timePhase(ctx.request, "render", () => |
| 44 | 43 | page({ ctx, title: `Screenshots ${label} · ${repo.name}`, crumbs: crumbsFor(repo), palette: repoPalette(ctx, repo), body }), |
| 45 | 44 | ); |
test/build-shots.test.ts +2
| @@ -173,6 +173,8 @@ describe("pin screenshots", () => { | ||
| 173 | 173 | const text = await page.text(); |
| 174 | 174 | expect(text).toContain("/alice/karts/builds/v1/shots/01.png?v="); |
| 175 | 175 | expect(text).toContain('data-live="build.shots'); |
| 176 | expect(text).toContain("<h2>Screenshots · v1</h2>"); | |
| 177 | expect(text.slice(text.indexOf("<main"))).not.toContain('class="card'); | |
| 176 | 178 | expect((await get("/alice/karts/builds/nope/shots")).status).toBe(404); |
| 177 | 179 | expect((await get("/alice/secret/builds/v1/shots", "bob")).status).toBe(404); |
| 178 | 180 | expect((await get("/alice/secret/builds/v1/shots")).status).toBe(404); |