Public: anyone can read this; the crew can change it.

The map's first screen is one row per wave with its issue count and how many have landed #16150

Merged opened this

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

Merged

scout/forge:scout/16130-the-map-s-first-screen-is-one-row-per-wa → main 0 commits fork 3 threads · 3 unresolved

  • Merged. scout/16130-the-map-s-first-screen-is-one-row-per-wa was merged into main as ac9d4fe.

Review

Sign in to review this change.
5 files changed +63 −8
docs/features/roadmap.md +5
@@ -28,3 +28,8 @@ sealed, and Needs you is shown to writers only.
2828 - MCP: `map` with `roadmap: true`.
2929 - Terminal: the palette command "Roadmap of a repository" (`owner/name`);
3030 `j`/`k` scroll, `esc` closes. Same model, `src/web/roadmap.ts`.
31
32 ## How a pillar's standing reads (#16130)
33
34 Each pillar row says its standing as "3 of 8 landed", on the page and in the
35 terminal's map screen alike. A pillar with nothing counted in it is not listed.
src/tui/screens/roadmap.ts +3 −3
@@ -10,7 +10,7 @@ import type { User } from "../../core/users.ts";
1010 import { mapGrowth, type Since } from "../../core/growth.ts";
1111 import type { Repo } from "../../core/repos.ts";
1212 import { sealedScope } from "../../core/sealed.ts";
13 import { paceSentence, roadmapOf, type Roadmap, type RoadmapIssue } from "../../web/roadmap.ts";
13 import { landedWords, paceSentence, shownPillars, roadmapOf, type Roadmap, type RoadmapIssue } from "../../web/roadmap.ts";
1414 import type { Ctx, Screen } from "../app/app.ts";
1515 import { binding } from "../app/keys.ts";
1616 import type { Session } from "../session.ts";
@@ -30,8 +30,8 @@ export function roadmapLines(road: Roadmap, width = 80): string[] {
3030 for (const n of road.needsYou) out.push(...wrap(` ${n.text} (${n.pull ? "pull" : "issue"} #${n.number}: ${n.action})`, w));
3131 out.push("");
3232 }
33 for (const p of road.pillars) {
34 const state = p.state === "done" ? "done" : p.total === 0 ? "nothing yet" : `${p.done} of ${p.total} done`;
33 for (const p of shownPillars(road)) {
34 const state = landedWords(p.done, p.total);
outdated

Medium: this filter and the new wording in roadmapLines are not tested; test/map-waves.test.ts only covers the web body. Add a test calling roadmapLines with an empty pillar and a 3-of-8 pillar that fails without this change (and that a done pillar reads 'N of N landed').

3535 out.push(`${p.name} ${state}${p.state === "current" ? ` ${p.etaAt === null ? "no date yet" : `around ${p.etaAt.slice(0, 10)}`}` : ""}`);
3636 if (p.state === "future") continue;
3737 const g = p.groups;
src/web/pages/roadmap.ts +3 −5
@@ -9,7 +9,7 @@
99
1010 import { html, type Html } from "../html.ts";
1111 import { avatar, row } from "../ui.ts";
12 import { finishWords, paceSentence } from "../roadmap.ts";
12 import { finishWords, landedWords, paceSentence, shownPillars } from "../roadmap.ts";
1313 import type {
1414 NeedsYou,
1515 Roadmap,
@@ -63,9 +63,7 @@ function group(base: string, title: string, rows: readonly RoadmapIssue[]): Html
6363 }
6464
6565 function meta(p: RoadmapPillar): string {
66 if (p.state === "done") return "done";
67 if (p.total === 0) return "nothing yet";
68 return `${p.done} of ${p.total} done${p.state === "current" ? ` · ${finishWords(p.etaAt)}` : ""}`;
66 return `${landedWords(p.done, p.total)}${p.state === "current" ? ` · ${finishWords(p.etaAt)}` : ""}`;
6967 }
7068
7169 function pillarRow(base: string, p: RoadmapPillar): Html {
@@ -92,5 +90,5 @@ function pillarRow(base: string, p: RoadmapPillar): Html {
9290 /** The region's inner markup; the live swap replaces exactly this. */
9391 export function roadmapBody(base: string, road: Roadmap): Html {
9492 return html`<p class="rm-pace" id="rm-pace">${paceSentence(road)}</p>${needs(base, road.needsYou)}
95 <ul class="list" id="rm-pillars">${road.pillars.map((p) => pillarRow(base, p))}</ul>`;
93 <ul class="list" id="rm-pillars">${shownPillars(road).map((p) => pillarRow(base, p))}</ul>`;
9694 }
outdated

Low: the same total > 0 filter is duplicated here and in the tui screen. Do it once in roadmapOf's view or a shared helper so the two doors cannot drift.

src/web/roadmap.ts +14
@@ -292,3 +292,17 @@ export function paceSentence(road: Roadmap): string {
292292 if (p.current === null) return `${landed} Every pillar is done.`;
293293 return `${landed} ${p.current} ${finishWords(p.etaAt)}.`;
294294 }
295
296 /** A pillar's standing in plain words: "3 of 8 landed". Nothing counted says nothing. */
297 export function landedWords(landed: number, total: number): string {
298 if (!Number.isInteger(landed) || !Number.isInteger(total) || total <= 0) return "";
299 return `${Math.min(Math.max(landed, 0), total)} of ${total} landed`;
300 }
301
302 /**
303 * The pillars worth a row: one with nothing counted in it is left out, on the page and in the
304 * terminal.
305 */
306 export function shownPillars(road: Roadmap): RoadmapPillar[] {
307 return road.pillars.filter((p) => p.total > 0);
308 }
test/map-waves.test.ts added +38
@@ -0,0 +1,38 @@
1 import { expect, test } from "bun:test";
2 import { roadmapLines } from "../src/tui/screens/roadmap.ts";
3 import { roadmapBody } from "../src/web/pages/roadmap.ts";
4 import { landedWords, type Roadmap, type RoadmapPillar } from "../src/web/roadmap.ts";
5
6 const pillar = (short: string, done: number, total: number, state: RoadmapPillar["state"] = "future"): RoadmapPillar => ({
7 short, name: `${short} Name`, umbrella: null, state, done, total, merged: 0, building: [], next: null,
8 lastLanding: null, etaDays: null, etaAt: null,
9 groups: { building: [], upNext: [], waiting: [], blocked: [], doneThisWeek: [] }, movedCount: 0,
10 });
11 const road = (pillars: RoadmapPillar[]): Roadmap => ({
12 generatedAt: "2026-11-23T00:00:00Z",
13 pace: { landed24h: 0, landed7d: 0, days: 7, current: null, etaDays: null, etaAt: null },
14 needsYou: [], pillars,
15 });
16
17 test("a wave reads as plain words", () => {
18 expect(landedWords(3, 8)).toBe("3 of 8 landed");
19 expect(landedWords(8, 8)).toBe("8 of 8 landed");
20 expect(landedWords(0, 0)).toBe("");
21 expect(landedWords(9, 8)).toBe("8 of 8 landed");
22 });
23
24 test("the map lists each non-empty wave as one row and hides an empty one", () => {
25 const out = String(roadmapBody("/o/r", road([pillar("P1", 3, 8), pillar("P2", 0, 0), pillar("P3", 2, 2, "done")])));
26 expect(out).toContain("3 of 8 landed");
27 expect(out).toContain("2 of 2 landed");
28 expect(out).not.toContain("P2 Name");
29 expect(out).not.toContain("nothing yet");
30 });
31
32 test("the terminal says the same words and hides the same empty pillar", () => {
33 const text = roadmapLines(road([pillar("P1", 3, 8), pillar("P2", 0, 0), pillar("P3", 2, 2, "done")])).join("\n");
34 expect(text).toContain("P1 Name 3 of 8 landed");
35 expect(text).toContain("P3 Name 2 of 2 landed");
36 expect(text).not.toContain("P2 Name");
37 expect(text).not.toContain("nothing yet");
38 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs