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

Each app's last-change line reads in plain words a client understands: what changed, in one sentence, with no ids #16077

Merged opened this in answer to

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

Merged

scout/forge:scout/16052-each-app-s-last-change-line-reads-in-pla → main 0 commits fork

  • Merged. scout/16052-each-app-s-last-change-line-reads-in-pla was merged into main as 45fad82.

Review

Sign in to review this change.
3 files changed +17 −3
src/story/last_change.ts +2 −2
@@ -7,7 +7,7 @@
77 import { plainWords } from "../core/app-crew.ts";
88 import { cutTitle } from "../core/client-apps.ts";
99
10 export const NO_CHANGE_LINE = "The crew has not changed anything yet.";
10 export const NO_CHANGE_LINE = "No changes yet.";
1111 const DAY = 86_400_000;
1212 const WEEKDAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
1313 const MONTHS = [
@@ -39,7 +39,7 @@ function day(at: number, now: number): string {
3939 /** The sentence for an app's newest merged pull, or the "not yet" one when it has none. */
4040 export function lastChangeLine(last: { title: string; at: string } | undefined, now: number): string {
4141 if (last === undefined) return NO_CHANGE_LINE;
42 const title = cutTitle(plainWords(last.title).replace(DEV_TOKENS, "").replace(/\(\s*\)/g, ""));
42 const title = cutTitle(plainWords(last.title.split(/\r?\n/)[0] ?? "").replace(DEV_TOKENS, "").replace(/\(\s*\)/g, ""));
4343 const at = Date.parse(last.at);
4444 if (title === "" || Number.isNaN(at)) return NO_CHANGE_LINE;
4545 return `The crew's last change was “${title}”, ${day(at, now)}.`;
test/client-home.test.ts +1 −1
@@ -649,7 +649,7 @@ describe("a client's first screen", () => {
649649 if (!other.ok) throw new Error(JSON.stringify(other.error));
650650 const none = main(await page(owner));
651651 expect(none).not.toContain("last change was");
652 expect(none).toContain("has not changed anything yet");
652 expect(none).toContain("No changes yet");
653653 seedIssue("i-doing-4", 9004, "pull", "Older <i>fix</i>", "closed");
654654 seedIssue("i-doing-5", 9005, "pull", "Add <b>rye</b> bread", "closed");
655655 const ins = child.db.query(
test/story-last-change-words.test.ts added +14
@@ -0,0 +1,14 @@
1 import { expect, test } from "bun:test";
2 import { lastChangeLine } from "../src/story/last_change.ts";
3
4 const NOW = Date.parse("2026-11-21T12:00:00.000Z");
5
6 test("the sentence carries no issue or pull numbers, and only the title's first line", () => {
7 const line = lastChangeLine({ title: "Add the booking form (#42)\nCloses #7, PR 9", at: "2026-11-17T09:00:00.000Z" }, NOW);
8 expect(line).toBe("The crew's last change was “Add the booking form”, on Tuesday.");
9 expect(line).not.toMatch(/#|\d/);
10 });
11
12 test("an app with no change says 'No changes yet.'", () => {
13 expect(lastChangeLine(undefined, NOW)).toBe("No changes yet.");
14 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs