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

Merged opened this

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

Merged

scout/forge:scout/12410-small-next-has-before-and-after-looks-fo → main 3 commits fork

  • Merged. scout/12410-small-next-has-before-and-after-looks-fo was merged into main as b03df93.

Review

Sign in to review this change.
4 files changed +18 −4
forge.json +2 −2
@@ -4,8 +4,8 @@
44 "api.github.com"
55 ],
66 "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"],
99 "run": "bun run src/main.ts",
1010 "install": "",
1111 "health": "/healthz",
src/web/pages/next.ts +5 −1
@@ -165,6 +165,7 @@ function line(
165165 state: string | null = null,
166166 mine = false,
167167 promise: string | undefined = undefined,
168 current = false,
168169 ): Html {
169170 const r = rows[at]!;
170171 const n = r.issue.number;
@@ -185,6 +186,7 @@ function line(
185186 lead: html`${position === null ? "·" : String(position)}`,
186187 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}`}`,
187188 nav: true,
189 current,
188190 data: { number: String(n), ...(cost === undefined ? {} : { cost: String(cost) }) },
189191 ...(controls === null ? {} : { after: controls }),
190192 });
@@ -225,6 +227,8 @@ export function nextPage(ctx: Ctx): Response {
225227 // One numbered order, folded: the first TOP rows open, what comes after, then Later.
226228 // A filter hides rows but keeps each one's place in the whole ranking.
227229 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;
228232 const cutAt = lineAfter(week);
229233 const section = (title: string, list: readonly number[], open: boolean, id?: string): Html => {
230234 const mark = cutAt === null ? -1 : markBefore(list, cutAt);
@@ -232,7 +236,7 @@ export function nextPage(ctx: Ctx): Response {
232236 <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}>
233237 ${list.flatMap((at, i) => [
234238 ...(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),
236240 ])}
237241 </ul></details>`;
238242 };
test/looks-owner.test.ts +1 −1
@@ -312,7 +312,7 @@ describe("the forge's own owner looks, over the preview seed", () => {
312312 test("forge.json takes the seed's other pages as the owner, and the seed's pull is the one the named list pictures", () => {
313313 const manifest = parseManifest(readFileSync(join(import.meta.dir, "..", "forge.json"), "utf8"), undefined);
314314 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
316316 expect(manifest.value.looks).toContain(page);
317317 expect(manifest.value.looksAsOwner).toContain(page);
318318 }
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
8888 const lead = [...page.matchAll(/data-number="(\d+)"/g)].map((m) => Number(m[1]));
8989 expect(lead.slice(0, order.length)).toEqual(order);
9090 });
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 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs