Public: anyone can read this; the crew can change it.
small: /next has before-and-after looks for its keyboard moves at 390 px and 1280 px #12426
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/12410-small-next-has-before-and-after-looks-fo → main 3 commits fork
4 files
changed +18
−4
forge.json +2 −2
| @@ -4,8 +4,8 @@ | ||
| 4 | 4 | "api.github.com" |
| 5 | 5 | ], |
| 6 | 6 | "app": { |
| 7 | "looks": ["/", "/front", "/explore", "/board", "/notes", "/feed", "/review", "/releases", "/apps", "/repos", "/map", "/system", "/talk", "/flow", "/resilience", "/boards?help", "/settings/crew", "/settings/crew?help", "/preview-admin/sample", "/preview-admin/sample/pulls/3", "/preview-admin/sample/next", "/preview-admin/sample/bets", "/preview-admin/sample/waves", "/preview-admin/sample/milestones"], | |
| 8 | "looksAsOwner": ["/", "/board", "/flow", "/boards?help", "/settings/crew", "/settings/crew?help", "/talk", "/system", "/resilience", "/preview-admin/sample", "/preview-admin/sample/pulls/3", "/preview-admin/sample/next", "/preview-admin/sample/bets", "/preview-admin/sample/waves", "/preview-admin/sample/milestones"], | |
| 7 | "looks": ["/", "/front", "/explore", "/board", "/notes", "/feed", "/review", "/releases", "/apps", "/repos", "/map", "/system", "/talk", "/flow", "/resilience", "/boards?help", "/settings/crew", "/settings/crew?help", "/preview-admin/sample", "/preview-admin/sample/pulls/3", "/preview-admin/sample/next?pick", "/preview-admin/sample/bets", "/preview-admin/sample/waves", "/preview-admin/sample/milestones"], | |
| 8 | "looksAsOwner": ["/", "/board", "/flow", "/boards?help", "/settings/crew", "/settings/crew?help", "/talk", "/system", "/resilience", "/preview-admin/sample", "/preview-admin/sample/pulls/3", "/preview-admin/sample/next?pick", "/preview-admin/sample/bets", "/preview-admin/sample/waves", "/preview-admin/sample/milestones"], | |
| 9 | 9 | "run": "bun run src/main.ts", |
| 10 | 10 | "install": "", |
| 11 | 11 | "health": "/healthz", |
src/web/pages/next.ts +5 −1
| @@ -165,6 +165,7 @@ function line( | ||
| 165 | 165 | state: string | null = null, |
| 166 | 166 | mine = false, |
| 167 | 167 | promise: string | undefined = undefined, |
| 168 | current = false, | |
| 168 | 169 | ): Html { |
| 169 | 170 | const r = rows[at]!; |
| 170 | 171 | const n = r.issue.number; |
| @@ -185,6 +186,7 @@ function line( | ||
| 185 | 186 | lead: html`${position === null ? "·" : String(position)}`, |
| 186 | 187 | meta: html`${mine ? html`<span class="mine">Owner's pick</span> · ` : null}${r.role === "blocker" ? "Blocker" : "Enabler"} · #${n}${state === null ? "" : ` · ${state} · ${r.onIt ?? "next"}`} · ${r.roleWhy}${away ? null : html` · <span class="estimate">${rangeWords(priced.find((p) => p.number === n)?.estimate ?? { known: false, samples: 0, basis: "no estimate" })}</span>`}${state !== null || r.onIt === null ? "" : ` · on it: ${r.onIt}`}${r.why === null ? "" : ` · ${r.why}`}${promise === undefined ? "" : ` · ${promise}`}`, |
| 187 | 188 | nav: true, |
| 189 | current, | |
| 188 | 190 | data: { number: String(n), ...(cost === undefined ? {} : { cost: String(cost) }) }, |
| 189 | 191 | ...(controls === null ? {} : { after: controls }), |
| 190 | 192 | }); |
| @@ -225,6 +227,8 @@ export function nextPage(ctx: Ctx): Response { | ||
| 225 | 227 | // One numbered order, folded: the first TOP rows open, what comes after, then Later. |
| 226 | 228 | // A filter hides rows but keeps each one's place in the whole ranking. |
| 227 | 229 | const ats = rows.map((_, at) => at).filter((at) => shows(rows[at]!)); |
| 230 | // `?pick` shows the first row chosen, as `j` leaves it: a state a picture can ask for. | |
| 231 | const picked = ctx.url.searchParams.has("pick") ? ats[0] : undefined; | |
| 228 | 232 | const cutAt = lineAfter(week); |
| 229 | 233 | const section = (title: string, list: readonly number[], open: boolean, id?: string): Html => { |
| 230 | 234 | const mark = cutAt === null ? -1 : markBefore(list, cutAt); |
| @@ -232,7 +236,7 @@ export function nextPage(ctx: Ctx): Response { | ||
| 232 | 236 | <ul class="list setting-list"${id === undefined ? null : html` id="${id}"`}${id !== undefined && !isFiltered && costs !== null && capacity !== null && cut.unsure === null ? html` data-capacity="${String(capacity.usd)}"` : null}> |
| 233 | 237 | ${list.flatMap((at, i) => [ |
| 234 | 238 | ...(i === mark && id !== undefined ? [cutMark(cutAt!, false, cut.unsure !== null)] : []), |
| 235 | line(base, rows, at, writer, back, false, priced, costs?.[at], at + 1, stateWord(rows[at]!, facts(rows[at]!)), rows[at]!.byOwner, promise(rows[at]!)), | |
| 239 | line(base, rows, at, writer, back, false, priced, costs?.[at], at + 1, stateWord(rows[at]!, facts(rows[at]!)), rows[at]!.byOwner, promise(rows[at]!), id !== undefined && at === picked), | |
| 236 | 240 | ])} |
| 237 | 241 | </ul></details>`; |
| 238 | 242 | }; |
test/looks-owner.test.ts +1 −1
| @@ -312,7 +312,7 @@ describe("the forge's own owner looks, over the preview seed", () => { | ||
| 312 | 312 | test("forge.json takes the seed's other pages as the owner, and the seed's pull is the one the named list pictures", () => { |
| 313 | 313 | const manifest = parseManifest(readFileSync(join(import.meta.dir, "..", "forge.json"), "utf8"), undefined); |
| 314 | 314 | if (!manifest.ok) throw new Error(JSON.stringify(manifest.error)); |
| 315 | for (const page of ["next", "bets", "waves", "milestones"].map((p) => `${repoHome}/${p}`)) { | |
| 315 | for (const page of ["next", "bets", "waves", "milestones"].map((p) => `${repoHome}/${p === "next" ? "next?pick" : p}`)) { // the next page is pictured with its first row chosen | |
| 316 | 316 | expect(manifest.value.looks).toContain(page); |
| 317 | 317 | expect(manifest.value.looksAsOwner).toContain(page); |
| 318 | 318 | } |
test/next-order-page.test.ts +10
| @@ -88,3 +88,13 @@ test("the numbered rows, the folds and Later follow the dispatcher's order", asy | ||
| 88 | 88 | const lead = [...page.matchAll(/data-number="(\d+)"/g)].map((m) => Number(m[1])); |
| 89 | 89 | expect(lead.slice(0, order.length)).toEqual(order); |
| 90 | 90 | }); |
| 91 | ||
| 92 | test("?pick shows the top row chosen (aria-current) for a picture; without it no row is", async () => { | |
| 93 | const get = async (q: string) => (await (await fetch(`${servers.url}/alice/order/next${q}`, { headers: { cookie } })).text()); | |
| 94 | const plain = await get(""); | |
| 95 | expect(plain).not.toContain('aria-current="true"'); | |
| 96 | const picked = await get("?pick"); | |
| 97 | const marks = [...picked.matchAll(/<li[^>]*aria-current="true"/g)]; | |
| 98 | expect(marks.length).toBe(1); | |
| 99 | expect(marks[0]![0]).toContain(`data-number="${made3[11]!}"`); | |
| 100 | }); |
new above
offline