commit 407c8a7a55dad7c6c54c4190feb42a5607365ff6
parent c4ee4593915fca562c2d48e7c92395c354601597
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 9 Nov 2026 21:45:30 -0500
umtool: versions to judge -- the recent and the older renders are two cards, each counted by its own rows (redesign L4)
The Review card said "3 versions to judge" over a count of 2 when one render was older
than two weeks (Quiet).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/umtool/lib/inbox/needs-you.test.ts b/umtool/lib/inbox/needs-you.test.ts
@@ -58,7 +58,8 @@ test("versions to judge: rendered (its preview there, whatever `draft` says), no
assert.equal(row.action.label, "Play and judge");
// A render nobody judged for two weeks is no longer waiting: Quiet, folded.
const later = versionsDecisions({ project: "x", projectTitle: "X", takes, verdicts, playHref: () => "/", skip: (t) => t.id === "clip", now: Date.parse("2026-11-16T12:00:00Z") });
- assert.deepEqual(later.map((r) => [r.target, r.severity]), [["v2", "open"], ["v1", "info"], ["d2", "info"]]);
+ assert.deepEqual(later.map((r) => [r.target, r.severity, r.what]), [["v2", "open", "1 version to judge"], ["v1", "info", "2 versions to judge"], ["d2", "info", "2 versions to judge"]]);
+ assert.equal(later[1].href, "/");
assert.equal(groupOf(later[1]), "quiet");
assert.deepEqual(versionsDecisions({ project: "x", projectTitle: "X", takes: [], verdicts: {}, playHref: () => "/" }), []);
// Shapes it does not know are left out, never thrown on.
diff --git a/umtool/lib/inbox/versions.mjs b/umtool/lib/inbox/versions.mjs
@@ -68,22 +68,27 @@ const mins = (s) => (Number.isFinite(s) && s > 0 ? `${Math.floor(s / 60)}:${Stri
export function versionsDecisions({ project, projectTitle, projectKind, takes, verdicts, playHref, skip, now = Date.now() }) {
const waiting = versionsToJudge(takes, verdicts, { skip });
if (!waiting.length) return [];
- const what = versionsWhat(waiting);
- // The card's sentence is its newest row's (summarizeGroups keeps the first, ranked newest first).
- const newest = waiting[0];
- const href = playHref(newest.id);
- const facts = [`${newest.version ? "version" : "take"} ${newest.id}`, newest.label && newest.label !== newest.id ? `“${newest.label}”` : null, mins(newest.seconds), day(timeOf(newest)) ? `rendered ${day(timeOf(newest))}` : null];
- const why = `${what} · newest ${facts.filter(Boolean).join(" · ")} — play it and say like, maybe or no`;
- return waiting.map((t) => ({
- project,
- projectTitle,
- ...(projectKind ? { projectKind } : {}),
- kind: VERSION_UNJUDGED,
- target: t.id,
- what,
- why,
- href,
- severity: now - timeOf(t) > RECENT_DAYS * 864e5 ? "info" : "open",
- at: timeOf(t),
- }));
+ const old = (t) => now - timeOf(t) > RECENT_DAYS * 864e5;
+ // Two cards at most: the recent renders (Review) and the older ones (Quiet), each counted and named by its own.
+ return [waiting.filter((t) => !old(t)), waiting.filter(old)].flatMap((rows) => {
+ if (!rows.length) return [];
+ const what = versionsWhat(rows);
+ // The card's sentence is its newest row's (summarizeGroups keeps the first, ranked newest first).
+ const newest = rows[0];
+ const href = playHref(newest.id);
+ const facts = [`${newest.version ? "version" : "take"} ${newest.id}`, newest.label && newest.label !== newest.id ? `“${newest.label}”` : null, mins(newest.seconds), day(timeOf(newest)) ? `rendered ${day(timeOf(newest))}` : null];
+ const why = `${what} · newest ${facts.filter(Boolean).join(" · ")} — play it and say like, maybe or no`;
+ return rows.map((t) => ({
+ project,
+ projectTitle,
+ ...(projectKind ? { projectKind } : {}),
+ kind: VERSION_UNJUDGED,
+ target: t.id,
+ what,
+ why,
+ href,
+ severity: old(t) ? "info" : "open",
+ at: timeOf(t),
+ }));
+ });
}