Skip to content

Commit dfce16a

Browse files
cknittclaude
andcommitted
Mark the last push's commits with a dot and a word
The line of its own under each marked commit took too much room. A green or yellow dot now leads the subject, and "new" or "edited" ends the identity line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzPS5F8RDSGZ6dhfK6NdZp Signed-off-by: Christoph Knittel <ck@cca.io>
1 parent 09e41f3 commit dfce16a

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

‎scripts/commitRecords.test.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,10 @@ test("--previous marks the commits the last push added or edited", async () => {
898898
has(comment, "<summary><b>Kept</b></summary>");
899899
const marked = (/** @type {string} */ subject) =>
900900
comment.split("<details").find(d => d.includes(`<b>${subject}</b>`)) ?? "";
901-
lacks(marked("Kept"), "in last push");
902-
has(marked("Edited"), "🟡 **Edited in last push**");
903-
has(marked("Added"), "🟢 **New in last push**");
901+
lacks(marked("Kept"), "🟢");
902+
lacks(marked("Kept"), "🟡");
903+
has(marked("Edited"), "<summary>🟡 <b>Edited</b></summary>");
904+
has(marked("Edited"), " · edited</sub>");
905+
has(marked("Added"), "<summary>🟢 <b>Added</b></summary>");
906+
has(marked("Added"), " · new</sub>");
904907
});

‎scripts/recordMarkdown.js‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -387,16 +387,14 @@ function section(s, parts, full) {
387387
return out.join("\n\n");
388388
}
389389

390-
/** The line under a commit's identity that says what the last push did to it. */
391-
const MARKS = {
392-
new: "🟢 **New in last push**",
393-
edited: "🟡 **Edited in last push**",
394-
};
390+
/** The dot before a commit's subject that marks what the last push did. */
391+
const DOTS = { new: "🟢", edited: "🟡" };
395392

396393
/**
397394
* A commit as a collapsible block: its subject, identity and message drawn;
398395
* without `full`, its forms are left to the page. A `change` (`new` or
399-
* `edited`) labels what the last push did to it.
396+
* `edited`), what the last push did to it, puts a dot before the subject
397+
* and the word in the identity line.
400398
* @param {CommitRecord} r
401399
* @param {boolean} full
402400
* @param {string} [change]
@@ -407,9 +405,8 @@ export function commitMarkdown(r, full, change = "") {
407405
const joined = (/** @type {Section} */ s) =>
408406
[...s.text, ...s.block.map(l => l.trim())].join(" ").trim();
409407
const out = [
410-
`<details open><summary><b>${inlineHtml(subject)}</b></summary>`,
411-
`<sub>${esc(r.sha)} · ${inline(byline(r))}${r.date ? ` · ${esc(r.date)}` : ""}${pr ? ` · #${pr}` : ""}</sub>`,
412-
MARKS[/** @type {keyof typeof MARKS} */ (change)] ?? "",
408+
`<details open><summary>${change ? `${DOTS[/** @type {keyof typeof DOTS} */ (change)] ?? ""} ` : ""}<b>${inlineHtml(subject)}</b></summary>`,
409+
`<sub>${esc(r.sha)} · ${inline(byline(r))}${r.date ? ` · ${esc(r.date)}` : ""}${pr ? ` · #${pr}` : ""}${change ? ` · ${esc(change)}` : ""}</sub>`,
413410
...sectionGroups(r.sections.filter(s => !BELOW.has(s.name))).map(g =>
414411
section(g.section, g.parts, full),
415412
),

‎scripts/recordMarkdown.test.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ ${SIGNED}
237237
has(tiny, "more commit");
238238
});
239239

240-
test("the commits the last push added or edited are marked under their identity", () => {
240+
test("the commits the last push added or edited carry a dot and the word", () => {
241241
const message = (/** @type {string} */ subject) =>
242242
`${subject}\n\n${SIGNED}\n`;
243243
const md = comment([message("Kept"), message("Edited"), message("Added")], {
@@ -248,17 +248,16 @@ test("the commits the last push added or edited are marked under their identity"
248248
});
249249
has(
250250
md,
251-
"<summary><b>Kept</b></summary>\n\n<sub>aaaaaaaa0 · A Person · Oct 22, 2026</sub>\n\n</details>",
251+
"<summary><b>Kept</b></summary>\n\n<sub>aaaaaaaa0 · A Person · Oct 22, 2026</sub>",
252252
);
253253
has(
254254
md,
255-
"<summary><b>Edited</b></summary>\n\n<sub>aaaaaaaa1 · A Person · Oct 22, 2026</sub>\n\n🟡 **Edited in last push**\n\n</details>",
255+
"<summary>🟡 <b>Edited</b></summary>\n\n<sub>aaaaaaaa1 · A Person · Oct 22, 2026 · edited</sub>",
256256
);
257257
has(
258258
md,
259-
"<summary><b>Added</b></summary>\n\n<sub>aaaaaaaa2 · A Person · Oct 22, 2026</sub>\n\n🟢 **New in last push**\n\n</details>",
259+
"<summary>🟢 <b>Added</b></summary>\n\n<sub>aaaaaaaa2 · A Person · Oct 22, 2026 · new</sub>",
260260
);
261-
assert.ok(!md.includes("<img"));
262261
});
263262

264263
test("an assistant co-author is drawn by its short name, others as written", () => {

0 commit comments

Comments
 (0)