commit befc5f69b22ace8f3853be3a4e842614a44698f6
parent 2b81e91e8d2047c4f62cd031e6a8a4e7e626b48f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 6 Nov 2026 20:58:25 -0500
umtool: the shelf's goal fan reads the dial's goal board; a joke or another speaker's goal is no note
The shelf form of the goals (chrome-measure-extras.mjs shelfGoalStates) now
orders its notes by measure-goals.mjs goalsAt(goalBoard(schedule.measure), t)
-- the page code imports the board; measure-extras.mjs does not import back:
the board's headline, the closest goal in force, in front with "+N more" for
the others in force, the rest by recency; a state wherever the board alone
changes (a goal met, missed or past its day), so the fan reorders on the
same second the dial does; a missed goal struck in red with MISSED on it for
the dial's hold. The count pops only when a goal lands. The guessed state
shape (`goals.headline` in the measure state) is gone: the board is the one
source, and the shelf and the dial cannot disagree.
goalStates (the pile and the fan) skips a goal event flagged `unresolved`
or carrying a `speaker`, as the slice's tallies and the board do (operator,
6 Nov ruling 2).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
5 files changed, 87 insertions(+), 28 deletions(-)
diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md
@@ -1821,7 +1821,7 @@ A sticky note per goal on a pile in a corner of the footage box, read off the sc
|---|---|---|
| `deck.goals` | `true` · `false` · `{show, position, x, y, scale, hold, finale, max, color, countdown}` · default on with a measure slice | `umtool look <p> deck.goals=false` |
| `deck.goals.position`, `.x`/`.y`, `.scale` | `top-left` `top-right` `bottom-left` `bottom-right` `top-center` `bottom-center` · design px · 0.5–2 · default `bottom-right`, unset, 1 | `umtool look <p> deck.goals.position=bottom-left` |
-| `deck.goals.position=shelf` | its shelf form (`deck.shelf`): the count of goals set in a column, then the notes fanned sideways like the diet's tags -- the headline goal in front when the measure state names one (`goals.headline`: the closest goal in force) with "+N more" for the others in force, else the newest; a new goal landing from above as on the pile; each older one showing its goal's words in the strip beside it (all of each when there is room); a repeat comes to the front with its ×n. The fan takes the shelf's spare width (shelfLayout), up to its notes side by side. On the shelf it stays up from the first goal (`hold` unset). What the dial draws of the goal stays on the dial | `umtool look <p> deck.shelf.items='["diet","goals"]' deck.goals.position=shelf` |
+| `deck.goals.position=shelf` | its shelf form (`deck.shelf`): the count of goals set in a column, then the notes fanned sideways like the diet's tags -- ordered by the dial's goal board (measure-goals.mjs `goalsAt(goalBoard(schedule.measure), t)`, so the shelf and the dial always agree): its headline -- the closest goal in force -- in front with "+N more" for the others in force, the rest by recency; a goal the board misses struck in red, MISSED on it, for the dial's 6 s; with no goal in force, the newest in front; a new goal landing from above as on the pile; each older one showing its goal's words in the strip beside it (all of each when there is room); a repeat comes to the front with its ×n. The fan takes the shelf's spare width (shelfLayout), up to its notes side by side. On the shelf it stays up from the first goal (`hold` unset). What the dial draws of the goal stays on the dial | `umtool look <p> deck.shelf.items='["diet","goals"]' deck.goals.position=shelf` |
| `deck.goals.max`, `.color`, `.countdown` | 1–8 notes · #hex paper · bool · default 4, the palette's amber, `true` | `umtool look <p> deck.goals.max=6` |
| `deck.goals.hold`, `.finale` | 0 (up from the first goal on) or 2–600 s after each · `hide` `show` · default 20, `hide` | `umtool look <p> deck.goals.hold=0` |
| `deck.goals.onPosts`, `.onChapters` | `dodge` `hide` `show` · default `dodge`: while a post item's card (its card, slot and strip as postLayout lays them: the schedule's `covers`) or a chapter band is up where it stands, it moves to a free anchor of the footage box -- a size down to half if it must, never onto another measure extra that is up -- and hides when none fits; `hide` hides, `show` stays over it | `umtool look <p> deck.goals.onPosts=hide` |
diff --git a/umtool/report-to-video/chrome-measure-extras.mjs b/umtool/report-to-video/chrome-measure-extras.mjs
@@ -16,11 +16,12 @@ import { formatDeckDate } from "./attribution.mjs";
import { rgba } from "./chrome-deck.mjs";
import { compileCues, cuePageHtml, esc, INSTANT, joinSpans, r4, spanEvents } from "./chrome-cues.mjs";
import {
- daysBetween, daysLeftText, daysText, DIET_TAG, dietDays, dietStates, dietTagStep, goalStates, GOALS_SHELF, jitter, measureBox, measureExtraGeometry, measureOf, MEASURE_BOXES, promiseStripRect, promiseStripType,
+ daysBetween, daysLeftText, daysText, DIET_TAG, dietDays, dietStates, dietTagStep, goalStates, goalText, GOALS_SHELF, jitter, measureBox, measureExtraGeometry, measureOf, MEASURE_BOXES, promiseStripRect, promiseStripType,
MEASURE_DODGE_MOVE, measurePlacements, monthYear, peakStates, promiseStates, shortDate, streakStates, upSpans, weightText,
} from "./measure-extras.mjs";
import { dietTagWidth, MEASURE_RED, resolveMeasureExtra, SHELF_POSITION } from "./modules/measure-extras-settings.mjs";
import { dialFinaleGeometry, dialFinaleHandoff } from "./chrome-instruments.mjs";
+import { goalBoard, goalsAt } from "./measure-goals.mjs";
/** How each module's panel comes in and goes out, s. */
export const MEASURE_FADE = Object.freeze({ in: 0.35, out: 0.4 });
@@ -300,17 +301,9 @@ function goalsShelfHtml(schedule, render, opts, cfg, states) {
});
const spans = upSpans(states.map((s) => s.at), cfg, schedule);
const items = [];
- // THE ORDER ON THE SHELF: the headline goal in front when the state names one (the closest goal in force,
- // goalStates' `headline`), the rest by how recently he set them; else the newest in front, as the pile.
- let before = new Map();
- const shelfStates = states.map((st) => {
- const recent = [...st.notes].sort((a, b) => a.depth - b.depth);
- const lead = st.headline ? recent.find((n) => n.key === st.headline) : null;
- const list = lead ? [lead, ...recent.filter((n) => n !== lead)] : recent;
- const notes = list.map((n, i) => ({ ...n, depth: i, prev: before.has(n.key) ? before.get(n.key) : null }));
- before = new Map(notes.map((n) => [n.key, n.depth]));
- return { ...st, notes };
- });
+ // THE ORDER ON THE SHELF is the dial's (shelfGoalStates): the goal board's headline -- the closest goal in force --
+ // in front with "+N more" for the others in force, the rest by how recently he set them, a missed goal struck.
+ const shelfStates = shelfGoalStates(schedule, states);
const { init, cues } = stateCues(shelfStates, spans, {
own: (st, j, init) => {
const ev = [];
@@ -336,8 +329,11 @@ function goalsShelfHtml(schedule, render, opts, cfg, states) {
init[k] = { x: to.x, y: to.y, rotation: to.rotation };
}
}
- init[`s${j}.c`] = { scale: 1.6, opacity: 0 };
- ev.push({ k: `s${j}.c`, at: st.at + 0.25, dur: 0.3, to: { scale: 1, opacity: 1 }, ease: "back.out(2.2)" });
+ // The count pops as a goal lands; a state the board alone changed (a goal met, missed, or lapsed) keeps it still.
+ if (st.top) {
+ init[`s${j}.c`] = { scale: 1.6, opacity: 0 };
+ ev.push({ k: `s${j}.c`, at: st.at + 0.25, dur: 0.3, to: { scale: 1, opacity: 1 }, ease: "back.out(2.2)" });
+ }
return ev;
},
});
@@ -356,7 +352,9 @@ function goalsShelfHtml(schedule, render, opts, cfg, states) {
const back = backs && n.depth > 0
? `<div class="nb"${crossing ? ` data-k="${k}b"` : ""} style="opacity:${crossing ? 0 : 1}"><div class="bt">${esc(n.text)}</div>${n.date ? `<div class="bh">${esc(monthYear(n.date))}</div>` : ""}</div>`
: "";
- return `<div class="note" data-k="${k}" style="z-index:${20 - n.depth}"><div class="tape"></div>${face}${back}${count}${more}</div>`;
+ // Missed (the board's, held as the dial holds it): struck in red, MISSED on it.
+ const miss = st.missed?.includes(n.key) ? `<div class="mx"></div><div class="ms">Missed</div>` : "";
+ return `<div class="note${miss ? " missed" : ""}" data-k="${k}" style="z-index:${20 - n.depth}"><div class="tape"></div>${face}${back}${count}${more}${miss}</div>`;
}).join("");
const html = `<div class="st" data-k="s${j}"><div class="gc"><div class="gn" data-k="s${j}.c">${st.goalsSet}</div><div class="gl">goal${st.goalsSet === 1 ? "" : "s"} set</div></div>${notes}</div>`;
items.push({ key: `s${j}`, gate: [`s${j}`, "autoAlpha"], html });
@@ -388,13 +386,51 @@ function goalsShelfHtml(schedule, render, opts, cfg, states) {
color: rgba(42, 28, 6, 0.62); white-space: nowrap; }
.mo { position: absolute; right: ${px(8)}px; bottom: ${px(6)}px; padding: 0 ${px(7)}px; height: ${px(20)}px; border-radius: ${px(10)}px;
background: rgba(42, 28, 6, 0.85); color: ${paper}; font-family: 'DeckSansBold', sans-serif; font-size: ${px(12)}px; line-height: ${px(20)}px; }
+ .mx { position: absolute; left: ${px(6)}px; right: ${px(6)}px; top: 50%; height: ${px(4)}px; margin-top: ${px(-2)}px; background: ${MEASURE_RED};
+ transform: rotate(-8deg); border-radius: ${px(2)}px; }
+ .ms { position: absolute; left: ${px(10)}px; bottom: ${px(6)}px; padding: 0 ${px(7)}px; height: ${px(20)}px; border-radius: ${px(10)}px;
+ background: ${MEASURE_RED}; color: #fff; font-family: 'DeckSansBold', sans-serif; font-size: ${px(12)}px; line-height: ${px(20)}px;
+ letter-spacing: 0.1em; text-transform: uppercase; }
.ct { position: absolute; right: ${px(8)}px; top: ${px(5)}px; min-width: ${px(40)}px; height: ${px(24)}px; padding: 0 ${px(7)}px;
border-radius: ${px(12)}px; background: #2a1c06; color: ${paper}; text-align: center;
font-family: ${DISPLAY}; font-size: ${px(19)}px; line-height: ${px(24)}px; }`;
const body = `<div id="pn" data-k="pn">
${blocks.join("\n ")}
</div>`;
- return { html: page("goals", schedule, opts, F, css, body, init, cues, states.map((_, j) => `s${j}`), render), items };
+ return { html: page("goals", schedule, opts, F, css, body, init, cues, shelfStates.map((_, j) => `s${j}`), render), items };
+}
+
+/**
+ * The shelf's goal states, ordered by the dial's goal board (measure-goals.mjs goalBoard / goalsAt), so the two
+ * always agree: each of goalStates' states (one per goal he sets) and a state wherever the board alone changes
+ * after the first (a goal met, missed or past its day; a missed one's hold ending) -- the same notes, `top` null.
+ * Each carries `headline` (the board headline's note key, or null: the newest leads), `active` (the goals in force)
+ * and `missed` (the note keys struck now); its notes in front-to-back order: the headline, then by recency.
+ */
+export function shelfGoalStates(schedule, states) {
+ if (!states.length) return [];
+ const m = schedule.measure;
+ const board = goalBoard(m);
+ const unit = m?.unit ?? "lb";
+ const keyOf = new Map((m?.events ?? []).filter((e) => e.kind === "goal" || e.kind === "goalLoss").map((e) => [e.row, goalText(e, unit).toLowerCase()]));
+ const times = [...new Set([...states.map((st) => st.at), ...board.map((b) => r4(b.t)).filter((t) => t > states[0].at)])].sort((a, b) => a - b);
+ let before = new Map();
+ return times.map((t) => {
+ const own = states.find((st) => Math.abs(st.at - t) < 1e-6);
+ const base = own ?? [...states].reverse().find((st) => st.at <= t);
+ const b = goalsAt(board, t);
+ const headline = b.headline ? keyOf.get(b.headline.row) ?? null : null;
+ const recent = [...base.notes].sort((x, y) => x.depth - y.depth);
+ const lead = headline ? recent.find((n) => n.key === headline) : null;
+ const list = lead ? [lead, ...recent.filter((n) => n !== lead)] : recent;
+ const notes = list.map((n, i) => ({ ...n, depth: i, prev: before.has(n.key) ? before.get(n.key) : null }));
+ before = new Map(notes.map((n) => [n.key, n.depth]));
+ return {
+ ...base, at: t, top: own ? own.top : null, ...(own ? {} : { repeat: false }),
+ headline: lead ? headline : null, active: b.active.length,
+ missed: b.missed.map((g) => keyOf.get(g.row)).filter(Boolean), notes,
+ };
+ });
}
// ---------------------------------------------------------------------------
diff --git a/umtool/report-to-video/measure-extras.mjs b/umtool/report-to-video/measure-extras.mjs
@@ -229,9 +229,11 @@ export function goalStates(schedule, render) {
const states = [];
let prevDepth = new Map();
let n = 0;
- const rowKey = new Map();
for (const { e, s } of stepsOf(m)) {
if (e.kind !== "goal" && e.kind !== "goalLoss") continue;
+ // A goal of his that counts: not another speaker's, not an `unresolved` row (a joke) -- as the slice's tallies
+ // and the dial's goal board (measure-slice.mjs isUsable, measure-goals.mjs).
+ if (e.unresolved === true || (typeof e.speaker === "string" && e.speaker.trim())) continue;
n += 1;
const text = goalText(e, m.unit ?? "lb");
const key = text.toLowerCase();
@@ -252,22 +254,14 @@ export function goalStates(schedule, render) {
const target = s?.goal && s.goal.row === e.row && Number.isFinite(s.goal.value) ? s.goal.value
: e.kind === "goal" && Number.isFinite(e.value) ? e.value : null;
note.target = target;
- rowKey.set(e.row, key);
order = [...order.filter((k) => k !== key), key];
const shown = order.slice(-cfg.max);
const depth = new Map(shown.map((k, i) => [k, shown.length - 1 - i]));
- // The headline goal, when the state names one (the closest goal in force -- the measure state's
- // `goals.headline`, a row or a goal carrying its row): its note's key, else null (the newest leads).
- const hl = s?.goals && !Array.isArray(s.goals) ? s.goals.headline : s?.goalHeadline;
- const hlRow = typeof hl === "string" ? hl : hl?.row ?? null;
- const active = s?.goals && !Array.isArray(s.goals) && Array.isArray(s.goals.active) ? s.goals.active.length : null;
states.push({
at: r4(e.t),
top: key,
repeat: note.count > 1,
- ...(hlRow && rowKey.has(hlRow) ? { headline: rowKey.get(hlRow) } : {}),
- ...(active !== null ? { active } : {}),
- goalsSet: Array.isArray(s?.goals) ? s.goals.length : Array.isArray(s?.goals?.set) ? s.goals.set.length : n,
+ goalsSet: Array.isArray(s?.goals) ? s.goals.length : n,
notes: shown.map((k) => {
const x = notes.get(k);
return {
diff --git a/umtool/report-to-video/measure-goals.test.mjs b/umtool/report-to-video/measure-goals.test.mjs
@@ -143,3 +143,32 @@ test("seek-safe: the board at t is a pure function of the measure, and the dial'
const frames = Math.round(schedule.total * FPS);
assert.ok(frameKeys({ html, region: "dial", fps: FPS, frames, version: "t" }));
});
+
+test("the shelf's goal fan reads the same board: the headline in front, +N more, a missed goal struck; a joke or another's goal is no note", async () => {
+ const { goalStates } = await import("./measure-extras.mjs");
+ const { goalsHtml, shelfGoalStates } = await import("./chrome-measure-extras.mjs");
+ const m = { ...measureOf([
+ stated(1, "s1", "2026-01-09", 337),
+ goal(2, "g1", "2026-01-16", 320, { asOf: "2026-04-01" }),
+ goal(3, "g2", "2026-01-16", 240),
+ goal(4, "j1", "2026-01-16", 150, { unresolved: true }),
+ goal(5, "o1", "2026-01-16", 200, { speaker: "madamsavvy" }),
+ stated(10, "s2", "2026-05-02", 326),
+ ]), unit: "lb" };
+ const render = { width: 1920, height: 1080, fps: FPS, palette: { bg: "#0F1312", fg: "#EDF0EC", muted: "#98A29B", accent: "#22AB83", amber: "#E8A33F" },
+ chrome: { engine: "hyperframes", layout: "deck", deck: { measure: {}, dial: true, shelf: { items: ["goals"] }, goals: { position: "shelf" } } } };
+ const schedule = { kind: "deck", fps: FPS, total: 40, transition: 0, segments: [{ id: "a", start: 0, duration: 40, end: 40 }], measure: m };
+ const states = goalStates(schedule, render);
+ assert.deepEqual(states.map((s) => s.at), [2, 3], "the joke and her goal are no notes");
+ const shelf = shelfGoalStates(schedule, states);
+ // A state per goal set, and one where the board alone changes: g1 missed at 10, its hold's end.
+ assert.deepEqual(shelf.map((s) => s.at), [2, 3, 10, 10 + MISS_HOLD]);
+ const front = (s) => s.notes.find((n) => n.depth === 0).key;
+ // At 3 the newest is 240, but the CLOSEST leads: 320, with one more in force.
+ assert.deepEqual([front(shelf[1]), shelf[1].headline, shelf[1].active], ["320 lb", "320 lb", 2]);
+ assert.deepEqual([shelf[2].top, shelf[2].missed, front(shelf[2])], [null, ["320 lb"], "240 lb"]);
+ assert.deepEqual(shelf[3].missed, []);
+ const { html } = goalsHtml(schedule, render, {});
+ assert.match(html, /\+1 more/);
+ assert.match(html, /class="note missed"/);
+});
diff --git a/umtool/report-to-video/modules/goals.mjs b/umtool/report-to-video/modules/goals.mjs
@@ -28,7 +28,7 @@ export default measureExtraModule({
rows: [
["`deck.goals`", "`true` · `false` · `{show, position, x, y, scale, hold, finale, max, color, countdown}` · default on with a measure slice", "`umtool look <p> deck.goals=false`"],
["`deck.goals.position`, `.x`/`.y`, `.scale`", "`top-left` `top-right` `bottom-left` `bottom-right` `top-center` `bottom-center` · design px · 0.5–2 · default `bottom-right`, unset, 1", "`umtool look <p> deck.goals.position=bottom-left`"],
- ["`deck.goals.position=shelf`", "its shelf form (`deck.shelf`): the count of goals set in a column, then the notes fanned sideways like the diet's tags -- the headline goal in front when the measure state names one (\`goals.headline\`: the closest goal in force) with \"+N more\" for the others in force, else the newest; a new goal landing from above as on the pile; each older one showing its goal's words in the strip beside it (all of each when there is room); a repeat comes to the front with its ×n. The fan takes the shelf's spare width (shelfLayout), up to its notes side by side. On the shelf it stays up from the first goal (`hold` unset). What the dial draws of the goal stays on the dial", "`umtool look <p> deck.shelf.items='[\"diet\",\"goals\"]' deck.goals.position=shelf`"],
+ ["`deck.goals.position=shelf`", "its shelf form (`deck.shelf`): the count of goals set in a column, then the notes fanned sideways like the diet's tags -- ordered by the dial's goal board (measure-goals.mjs \`goalsAt(goalBoard(schedule.measure), t)\`, so the shelf and the dial always agree): its headline -- the closest goal in force -- in front with \"+N more\" for the others in force, the rest by recency; a goal the board misses struck in red, MISSED on it, for the dial's 6 s; with no goal in force, the newest in front; a new goal landing from above as on the pile; each older one showing its goal's words in the strip beside it (all of each when there is room); a repeat comes to the front with its ×n. The fan takes the shelf's spare width (shelfLayout), up to its notes side by side. On the shelf it stays up from the first goal (`hold` unset). What the dial draws of the goal stays on the dial", "`umtool look <p> deck.shelf.items='[\"diet\",\"goals\"]' deck.goals.position=shelf`"],
["`deck.goals.max`, `.color`, `.countdown`", "1–8 notes · #hex paper · bool · default 4, the palette's amber, `true`", "`umtool look <p> deck.goals.max=6`"],
["`deck.goals.hold`, `.finale`", "0 (up from the first goal on) or 2–600 s after each · `hide` `show` · default 20, `hide`", "`umtool look <p> deck.goals.hold=0`"],
],