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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/16130-the-map-s-first-screen-is-one-row-per-wa → main 0 commits fork 3 threads · 3 unresolved
5 files
changed +63
−8
docs/features/roadmap.md +5
| @@ -28,3 +28,8 @@ sealed, and Needs you is shown to writers only. | ||
| 28 | 28 | - MCP: `map` with `roadmap: true`. |
| 29 | 29 | - Terminal: the palette command "Roadmap of a repository" (`owner/name`); |
| 30 | 30 | `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"; | ||
| 10 | 10 | import { mapGrowth, type Since } from "../../core/growth.ts"; |
| 11 | 11 | import type { Repo } from "../../core/repos.ts"; |
| 12 | 12 | 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"; | |
| 14 | 14 | import type { Ctx, Screen } from "../app/app.ts"; |
| 15 | 15 | import { binding } from "../app/keys.ts"; |
| 16 | 16 | import type { Session } from "../session.ts"; |
| @@ -30,8 +30,8 @@ export function roadmapLines(road: Roadmap, width = 80): string[] { | ||
| 30 | 30 | for (const n of road.needsYou) out.push(...wrap(` ${n.text} (${n.pull ? "pull" : "issue"} #${n.number}: ${n.action})`, w)); |
| 31 | 31 | out.push(""); |
| 32 | 32 | } |
| 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); | |
| 35 | 35 | out.push(`${p.name} ${state}${p.state === "current" ? ` ${p.etaAt === null ? "no date yet" : `around ${p.etaAt.slice(0, 10)}`}` : ""}`); |
| 36 | 36 | if (p.state === "future") continue; |
| 37 | 37 | const g = p.groups; |
src/web/pages/roadmap.ts +3 −5
| @@ -9,7 +9,7 @@ | ||
| 9 | 9 | |
| 10 | 10 | import { html, type Html } from "../html.ts"; |
| 11 | 11 | import { avatar, row } from "../ui.ts"; |
| 12 | import { finishWords, paceSentence } from "../roadmap.ts"; | |
| 12 | import { finishWords, landedWords, paceSentence, shownPillars } from "../roadmap.ts"; | |
| 13 | 13 | import type { |
| 14 | 14 | NeedsYou, |
| 15 | 15 | Roadmap, |
| @@ -63,9 +63,7 @@ function group(base: string, title: string, rows: readonly RoadmapIssue[]): Html | ||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | 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)}` : ""}`; | |
| 69 | 67 | } |
| 70 | 68 | |
| 71 | 69 | function pillarRow(base: string, p: RoadmapPillar): Html { |
| @@ -92,5 +90,5 @@ function pillarRow(base: string, p: RoadmapPillar): Html { | ||
| 92 | 90 | /** The region's inner markup; the live swap replaces exactly this. */ |
| 93 | 91 | export function roadmapBody(base: string, road: Roadmap): Html { |
| 94 | 92 | 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>`; | |
| 96 | 94 | } |
outdated
Low: the same |
src/web/roadmap.ts +14
| @@ -292,3 +292,17 @@ export function paceSentence(road: Roadmap): string { | ||
| 292 | 292 | if (p.current === null) return `${landed} Every pillar is done.`; |
| 293 | 293 | return `${landed} ${p.current} ${finishWords(p.etaAt)}.`; |
| 294 | 294 | } |
| 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 | }); |
new above
offline
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').