Skip to content

Commit 1e8de28

Browse files
cknittclaude
andcommitted
Mark the last push's commits with sparkles and a pencil
A green or yellow dot read like a check's status, yellow above all as a check in progress. New commits now lead with sparkles and edited ones with a pencil, signs that say what happened without colour. 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 dfce16a commit 1e8de28

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎scripts/commitRecords.test.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,10 +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"), "🟢");
902-
lacks(marked("Kept"), "🟡");
903-
has(marked("Edited"), "<summary>🟡 <b>Edited</b></summary>");
901+
lacks(marked("Kept"), "✨");
902+
lacks(marked("Kept"), "✏️");
903+
has(marked("Edited"), "<summary>✏️ <b>Edited</b></summary>");
904904
has(marked("Edited"), " · edited</sub>");
905-
has(marked("Added"), "<summary>🟢 <b>Added</b></summary>");
905+
has(marked("Added"), "<summary>✨ <b>Added</b></summary>");
906906
has(marked("Added"), " · new</sub>");
907907
});

‎scripts/recordMarkdown.js‎

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

390-
/** The dot before a commit's subject that marks what the last push did. */
391-
const DOTS = { new: "🟢", edited: "🟡" };
390+
/** The sign before a commit's subject that marks what the last push did. */
391+
const SIGNS = { new: "✨", edited: "✏️" };
392392

393393
/**
394394
* A commit as a collapsible block: its subject, identity and message drawn;
395395
* without `full`, its forms are left to the page. A `change` (`new` or
396-
* `edited`), what the last push did to it, puts a dot before the subject
396+
* `edited`), what the last push did to it, puts a sign before the subject
397397
* and the word in the identity line.
398398
* @param {CommitRecord} r
399399
* @param {boolean} full
@@ -405,7 +405,7 @@ export function commitMarkdown(r, full, change = "") {
405405
const joined = (/** @type {Section} */ s) =>
406406
[...s.text, ...s.block.map(l => l.trim())].join(" ").trim();
407407
const out = [
408-
`<details open><summary>${change ? `${DOTS[/** @type {keyof typeof DOTS} */ (change)] ?? ""} ` : ""}<b>${inlineHtml(subject)}</b></summary>`,
408+
`<details open><summary>${change ? `${SIGNS[/** @type {keyof typeof SIGNS} */ (change)] ?? ""} ` : ""}<b>${inlineHtml(subject)}</b></summary>`,
409409
`<sub>${esc(r.sha)} · ${inline(byline(r))}${r.date ? ` · ${esc(r.date)}` : ""}${pr ? ` · #${pr}` : ""}${change ? ` · ${esc(change)}` : ""}</sub>`,
410410
...sectionGroups(r.sections.filter(s => !BELOW.has(s.name))).map(g =>
411411
section(g.section, g.parts, full),

‎scripts/recordMarkdown.test.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ test("the commits the last push added or edited carry a dot and the word", () =>
252252
);
253253
has(
254254
md,
255-
"<summary>🟡 <b>Edited</b></summary>\n\n<sub>aaaaaaaa1 · A Person · Oct 22, 2026 · edited</sub>",
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 · new</sub>",
259+
"<summary>✨ <b>Added</b></summary>\n\n<sub>aaaaaaaa2 · A Person · Oct 22, 2026 · new</sub>",
260260
);
261261
});
262262

0 commit comments

Comments
 (0)