diff --git a/changelog.d/fixed-merge-bee-odometer.md b/changelog.d/fixed-merge-bee-odometer.md
new file mode 100644
index 0000000000..ff193e67f7
--- /dev/null
+++ b/changelog.d/fixed-merge-bee-odometer.md
@@ -0,0 +1 @@
+- Dashboard: the merge celebration bee is drawn at `--fs-3xl` (≈32 px, was ≈17 px) with a theme-aware halo so it reads on dark and light panels, and the Activity Monitor's Merged counter now rolls visibly like an odometer — the rightmost wheel (and any wheel right of the changed digit) spins a full turn on every increase, the day/week counts roll with the same mechanism, the day/week line no longer disappears mid-roll on the dark theme, and a reload rolls up from the values the tab showed before.
diff --git a/src/pkg/dashboard/stage_tracker_cues_test.go b/src/pkg/dashboard/stage_tracker_cues_test.go
index c1c58a565b..4a6fb7ef35 100644
--- a/src/pkg/dashboard/stage_tracker_cues_test.go
+++ b/src/pkg/dashboard/stage_tracker_cues_test.go
@@ -63,6 +63,12 @@ func TestStageTrackerCuesWiring(t *testing.T) {
`@media (prefers-reduced-motion: reduce) { .cue-working .ham-seg.active .ham-active-ico, .cue-spin, .cue-acting .ham-seg.active, .cue-event { animation: none; } }`,
`@media (prefers-reduced-motion: reduce) { .cue-flight { animation-name: cue-flight-fade; }`,
`id="activity-monitor-merged"`, `class="ham-merged-n"`, `class="ham-merged-sub"`,
+ // The merge glyph is sized and haloed through tokens, not a literal
+ // (hivecommons/hive#15398: at --fs-lg the operator could not tell
+ // what the bee was).
+ `:root { --cue-flight-size: var(--fs-3xl); --cue-flight-halo: drop-shadow(`,
+ `.cue-flight { position: fixed; z-index: var(--z-cue-flight); font-size: var(--cue-flight-size); line-height: 1; color: var(--amber); font-weight: var(--fw-semibold); filter: var(--cue-flight-halo);`,
+ `.ham-merged-count .ham-merged-n { font-variant-numeric: tabular-nums;`,
// The chip and the column header strip stick under the navbar
// while the list scrolls (hivecommons/hive#15096: the chip sat
// 2,300 px above the operator's viewport when the merge played).
@@ -254,6 +260,10 @@ func stageTrackerCelebrateJS(t *testing.T, html string) string {
jsConstLine(t, html, "STAGE_TRACKER_CELEBRATE_STAGGER_MS"),
jsConstLine(t, html, "STAGE_TRACKER_CELEBRATE_FLY_MS"),
jsConstLine(t, html, "STAGE_TRACKER_ODOMETER_MS"),
+ jsConstLine(t, html, "STAGE_TRACKER_ODOMETER_SUB_MS"),
+ jsConstLine(t, html, "STAGE_TRACKER_ODOMETER_TURN"),
+ jsConstLine(t, html, "STAGE_TRACKER_CELEBRATE_GLYPH_HALF"),
+ jsConstLine(t, html, "STAGE_TRACKER_MERGED_LAST_KEY"),
jsConstLine(t, html, "STAGE_TRACKER_CELEBRATE_MAX_FLIGHTS"),
jsConstLine(t, html, "STAGE_TRACKER_CELEBRATE_EXIT_PAD"),
jsConstLine(t, html, "STAGE_TRACKER_MERGE_BANNER_MS"),
@@ -276,6 +286,10 @@ func stageTrackerCelebrateJS(t *testing.T, html string) string {
jsFunc(t, html, "stageTrackerMergedHoldback"),
jsFunc(t, html, "stageTrackerOdometerPlan"),
jsFunc(t, html, "stageTrackerOdometerSet"),
+ jsFunc(t, html, "stageTrackerOdometerSeed"),
+ jsFunc(t, html, "stageTrackerMergedLastParse"),
+ jsFunc(t, html, "stageTrackerMergedLastLoad"),
+ jsFunc(t, html, "stageTrackerMergedLastSave"),
jsFunc(t, html, "stageTrackerMergedCountDraw"),
jsFunc(t, html, "stageTrackerMergedPopDraw"),
jsFunc(t, html, "hamMergedToggle"),
@@ -355,6 +369,7 @@ const pop = el('div', { id: 'activity-monitor-merged-pop' }); pop.hidden = true;
const byId = { 'activity-monitor-panel': panel, 'activity-monitor-merged': chip, 'activity-monitor-merged-pop': pop, 'merge-banners': banners, 'activity-monitor-merged-live': live };
global.document = { body, hidden: false, getElementById(id) { return byId[id] || null; }, createElement(tag) { if (tag === 'template') { const tpl = el('template'); Object.defineProperty(tpl, 'innerHTML', { set(v) { const c = el('p'); c.classList.add('cue-event'); c.attrs['data-cue-key'] = (v.match(/data-cue-key="([^"]*)"/) || [])[1]; c.textContent = v.replace(/<[^>]+>/g, ''); const age = el('span'); age.classList.add('cue-event-age'); age.attrs['data-at'] = (v.match(/data-at="(\d+)"/) || [])[1]; c.appendChild(age); tpl.content = { firstElementChild: c }; } }); return tpl; } return el(tag); } };
const store = {}; global.localStorage = { getItem: k => (k in store ? store[k] : null), setItem(k, v) { store[k] = String(v); } };
+const session = {}; global.sessionStorage = { getItem: k => (k in session ? session[k] : null), setItem(k, v) { session[k] = String(v); } };
let reduced = false; function stageTrackerReducedMotion() { return reduced; }
let soundOn = true; function stageTrackerSoundGate() { return soundOn; }
const zaps = []; function stageTrackerPlayZap(c) { zaps.push(c); }
@@ -611,12 +626,18 @@ console.log('ok');
func TestStageTrackerOdometerNode(t *testing.T) {
html := indexHTML(t)
runStageTrackerRowActionsScript(t, stageTrackerCelebrateJS(t, html)+stageTrackerCelebrateFixture+`
-// The plan: only the digits that rose roll, carries wrap past 9, a new
-// leading digit comes in from a blank, falls and foreign text sit still.
-assert.deepStrictEqual(stageTrackerOdometerPlan('9127', '9128'), [{ text: '9' }, { text: '1' }, { text: '2' }, { steps: ['7', '8'] }]);
-assert.deepStrictEqual(stageTrackerOdometerPlan('199', '200'), [{ steps: ['1', '2'] }, { steps: ['9', '0'] }, { steps: ['9', '0'] }], 'a carry wraps');
-assert.deepStrictEqual(stageTrackerOdometerPlan('7', '12'), [{ steps: [' ', '1'] }, { steps: ['7', '8', '9', '0', '1', '2'] }], 'a grown number rolls its new column in from a blank');
-assert.deepStrictEqual(stageTrackerOdometerPlan('201 today · 730 this week', '0 today · 731 this week'), [{ text: '0' }, { text: ' today · ' }, { text: '7' }, { text: '3' }, { steps: ['0', '1'] }, { text: ' this week' }], 'the day rollover sets today and rolls the week');
+// The plan: only the digits that rose roll; the first changed wheel rolls
+// its own distance, every wheel right of it — and the rightmost wheel
+// always — spins a full turn first (hivecommons/hive#15398: a one-cell
+// nudge was invisible); carries wrap past 9, a new leading digit comes in
+// from a blank, falls and foreign text sit still.
+const turn = (from, to) => { const out = [from]; let d = Number(from); do { d = (d + 1) % 10; out.push(String(d)); } while (d !== Number(to) || out.length <= STAGE_TRACKER_ODOMETER_TURN); return out; };
+assert.deepStrictEqual(turn('7', '8'), ['7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8'], 'a +1 on the last wheel is a full turn and one');
+assert.deepStrictEqual(stageTrackerOdometerPlan('9127', '9128'), [{ text: '9' }, { text: '1' }, { text: '2' }, { steps: turn('7', '8') }]);
+assert.deepStrictEqual(stageTrackerOdometerPlan('199', '200'), [{ steps: ['1', '2'] }, { steps: turn('9', '0') }, { steps: turn('9', '0') }], 'a carry: the first wheel steps once, the zeros whirr past');
+assert.deepStrictEqual(stageTrackerOdometerPlan('9471', '9481'), [{ text: '9' }, { text: '4' }, { steps: ['7', '8'] }, { steps: turn('1', '1') }], 'an unchanged wheel right of the change still spins round once');
+assert.deepStrictEqual(stageTrackerOdometerPlan('7', '12'), [{ steps: [' ', '1'] }, { steps: turn('7', '2') }], 'a grown number rolls its new column in from a blank');
+assert.deepStrictEqual(stageTrackerOdometerPlan('201 today · 730 this week', '0 today · 731 this week'), [{ text: '0' }, { text: ' today · ' }, { text: '7' }, { text: '3' }, { steps: turn('0', '1') }, { text: ' this week' }], 'the day rollover sets today and rolls the week');
assert.strictEqual(stageTrackerOdometerPlan('5', '5'), null, 'no change, no roll');
assert.strictEqual(stageTrackerOdometerPlan('5', '4'), null, 'a fall never rolls');
assert.strictEqual(stageTrackerOdometerPlan('1 today', '2 this week'), null, 'different words: no roll');
@@ -634,20 +655,35 @@ assert.strictEqual(odo.children.length, 1); const wrap = odo.children[0];
assert.strictEqual(wrap.className, 'ham-odo ham-odo-run'); assert.strictEqual(wrap.getAttribute('aria-hidden'), 'true');
assert.deepStrictEqual(wrap.children.map(c => c.className), ['ham-odo-static', 'ham-odo-static', 'ham-odo-static', 'ham-odo-col']);
const strip = wrap.children[3].children[0];
-assert.deepStrictEqual(strip.children.map(c => c.textContent), ['7', '8']); assert.strictEqual(strip.style.props['--odo-shift'], '-50.000%');
+assert.deepStrictEqual(strip.children.map(c => c.textContent), turn('7', '8')); assert.strictEqual(strip.style.props['--odo-shift'], (-(turn('7', '8').length - 1) * 100 / turn('7', '8').length).toFixed(3) + '%');
assert.strictEqual(wrap.style.props['--odo-ms'], STAGE_TRACKER_ODOMETER_MS + 'ms');
+assert.strictEqual(odo.children.length, 1, 'the element itself is kept: only an overlay was added');
tick(STAGE_TRACKER_ODOMETER_MS + 100);
assert.strictEqual(odo.children.length, 0, 'the overlay is gone'); assert.ok(!odo.classList.contains('ham-odo-rolling')); assert.strictEqual(odo.textContent, '9128');
// A second rise mid-roll restarts from the last value written.
stageTrackerOdometerSet(odo, 9129); assert.strictEqual(odo.children.length, 1);
stageTrackerOdometerSet(odo, 9131); assert.strictEqual(odo.children.length, 1, 'one overlay at a time');
assert.deepStrictEqual(odo.children[0].children[2].children[0].children.map(c => c.textContent), ['2', '3'], 'tens: 2 → 3');
-assert.deepStrictEqual(odo.children[0].children[3].children[0].children.map(c => c.textContent), ['9', '0', '1'], 'units: from the 9 last written');
+assert.deepStrictEqual(odo.children[0].children[3].children[0].children.map(c => c.textContent), turn('9', '1'), 'units: from the 9 last written');
tick(STAGE_TRACKER_ODOMETER_MS + 100); assert.strictEqual(odo.children.length, 0);
assert.strictEqual(stageTrackerOdometerSet(odo, 3), false, 'a fall just sets'); assert.strictEqual(odo.textContent, '3'); assert.strictEqual(odo.children.length, 0);
reduced = true;
assert.strictEqual(stageTrackerOdometerSet(odo, 4), false, 'reduced motion: no roll'); assert.strictEqual(odo.textContent, '4'); assert.strictEqual(odo.children.length, 0);
reduced = false;
+// A shorter roll for the day/week line: the duration is the caller's.
+const odo2 = el('span'); stageTrackerOdometerSet(odo2, '1 today'); stageTrackerOdometerSet(odo2, '2 today', STAGE_TRACKER_ODOMETER_SUB_MS);
+assert.strictEqual(odo2.children[0].style.props['--odo-ms'], STAGE_TRACKER_ODOMETER_SUB_MS + 'ms'); tick(STAGE_TRACKER_ODOMETER_SUB_MS + 100); assert.strictEqual(odo2.children.length, 0);
+// The session seed: an unwritten element takes the value it showed last
+// time only when the new value would roll from it.
+const odo3 = el('span');
+assert.strictEqual(stageTrackerOdometerSeed(odo3, '9471', 9472), true); assert.strictEqual(odo3.getAttribute('data-odo-value'), '9471');
+assert.strictEqual(stageTrackerOdometerSet(odo3, 9472), true, 'the first real write rolls up from the seed');
+assert.strictEqual(stageTrackerOdometerSeed(odo3, '1', 2), false, 'a written element is never re-seeded');
+const odo4 = el('span');
+assert.strictEqual(stageTrackerOdometerSeed(odo4, '9480', 9472), false, 'a seed ahead of the value is dropped'); assert.strictEqual(odo4.getAttribute('data-odo-value'), null);
+assert.strictEqual(stageTrackerOdometerSeed(odo4, null, 9472), false, 'no seed');
+assert.deepStrictEqual(stageTrackerMergedLastParse('{"n":"9471","sub":"73 today · 886 this week"}'), { n: '9471', sub: '73 today · 886 this week' });
+assert.strictEqual(stageTrackerMergedLastParse('{"n":"x"}'), null); assert.strictEqual(stageTrackerMergedLastParse('nope'), null); assert.strictEqual(stageTrackerMergedLastParse(''), null);
// Through the chip: the landing rolls both numbers; a redraw with the same
// values does not restart the roll.
panel.appendChild(row('o/r/pr#1'));
@@ -660,6 +696,15 @@ stageTrackerMergedCountDraw(false);
assert.strictEqual(n.children.length, 1, 'a redraw mid-roll keeps the overlay');
tick(STAGE_TRACKER_ODOMETER_MS + 100);
assert.strictEqual(n.children.length, 0); assert.strictEqual(sub.children.length, 0);
+assert.deepStrictEqual(stageTrackerMergedLastParse(session[STAGE_TRACKER_MERGED_LAST_KEY]), { n: '1', sub: '1 today · 1 this week' }, 'the values shown are remembered for the next load');
+// A fresh page (new chip, remembered values behind the server's) rolls up
+// from them on its first draw instead of just appearing.
+session[STAGE_TRACKER_MERGED_LAST_KEY] = JSON.stringify({ n: '0', sub: '0 today · 0 this week' });
+const chip2 = el('button', { id: 'activity-monitor-merged' }); const n2 = el('span'); n2.classList.add('ham-merged-n'); const sub2 = el('span'); sub2.classList.add('ham-merged-sub'); chip2.appendChild(n2); chip2.appendChild(sub2);
+chip.remove(); body.appendChild(chip2); byId['activity-monitor-merged'] = chip2; stageTrackerMergedChip.node = null;
+stageTrackerMergedCountDraw(false);
+assert.strictEqual(n2.textContent, '1'); assert.strictEqual(n2.children.length, 1, 'first draw rolls up from the remembered value'); assert.strictEqual(sub2.children.length, 1);
+tick(STAGE_TRACKER_ODOMETER_MS + 100); assert.strictEqual(n2.children.length, 0);
`)
}
@@ -693,7 +738,7 @@ tick(0);
assert.strictEqual(flights().length, 1); const g = flights()[0];
assert.strictEqual(g.textContent, '+1', 'the chosen glyph');
assert.strictEqual(g.style.props['--cue-dx'], '0px'); assert.strictEqual(g.style.props['--cue-dy'], -(410 + STAGE_TRACKER_CELEBRATE_EXIT_PAD) + 'px'); assert.strictEqual(g.style.props['--cue-end-opacity'], '1');
-assert.strictEqual(g.style.props['left'], '300px'); assert.strictEqual(g.style.props['top'], '400px', 'spawned at the ✓ cell');
+assert.strictEqual(g.style.props['left'], (310 - STAGE_TRACKER_CELEBRATE_GLYPH_HALF) + 'px'); assert.strictEqual(g.style.props['top'], (410 - STAGE_TRACKER_CELEBRATE_GLYPH_HALF) + 'px', 'spawned centred on the ✓ cell');
assert.strictEqual(g.attrs['aria-hidden'], 'true');
tick(STAGE_TRACKER_CELEBRATE_FLY_MS * 1.5 + 1);
assert.strictEqual(n.textContent, '1', 'the count bumps although the glyph left the screen');
@@ -708,7 +753,7 @@ const r = stageTrackerTestCelebration();
assert.strictEqual(settingsClosed, 1, 'the dialog closes first');
assert.deepStrictEqual(r, { flew: true, lands: true, faded: false }, JSON.stringify(toasts));
assert.ok(inView.classList.contains('cue-merged') && !above.classList.contains('cue-merged'), 'the row in view is the one that glows');
-assert.strictEqual(flights().length, 1); assert.strictEqual(flights()[0].style.props['top'], (410 - 10) + 'px', 'from the visible row\'s ✓ cell');
+assert.strictEqual(flights().length, 1); assert.strictEqual(flights()[0].style.props['top'], (410 - STAGE_TRACKER_CELEBRATE_GLYPH_HALF) + 'px', 'from the visible row\'s ✓ cell');
assert.strictEqual(banners.children.length, 1); assert.ok(banners.children[0].innerHTML.includes('(test)'), banners.children[0].innerHTML);
tick(STAGE_TRACKER_CELEBRATE_FLY_MS * 1.5 + 1);
assert.strictEqual(n.textContent, '1', 'the test does not count'); assert.ok(chip.classList.contains('cue-tick'), 'but pops'); assert.deepStrictEqual(zaps, [1], 'and zaps');
diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css
index 5502a79944..3b8539b6f6 100644
--- a/src/pkg/dashboard/static-src/css/tracker.css
+++ b/src/pkg/dashboard/static-src/css/tracker.css
@@ -13,6 +13,11 @@
stack fell back to z-index:auto and the chat FAB (9000) covered the
lowest toast's close × and text. Above the FAB and the modal chrome. */
:root { --z-cue-flight: 10000; --z-merge-banner: 10001; }
+ /* The merge glyph's size (hivecommons/hive#15398: at --fs-lg the bee
+ was "so small i can't see what it is") and the halo that lifts an
+ emoji off either theme's panel: a soft shadow in the text colour, so
+ it is a light glow on dark and a dark shadow on light. */
+ :root { --cue-flight-size: var(--fs-3xl); --cue-flight-halo: drop-shadow(0 0 2px color-mix(in srgb, var(--text) 45%, transparent)) drop-shadow(0 1px 2px color-mix(in srgb, var(--surface-0) 40%, transparent)); }
.ham-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-5); font-size: var(--fs-sm); color: var(--muted); }
.ham-toolbar label { display: inline-flex; align-items: center; gap: var(--sp-2); }
.ham-repo-filter { position: static; flex: 0 1 auto; gap: 0; min-width: 0; white-space: nowrap; }
@@ -377,10 +382,14 @@
the overlay goes and the plain text shows. Static characters and
digits that fell (the day rollover) just sit. The text underneath is
the real width (tabular-nums), so the pill never jiggles; reduced
- motion or the first draw sets the text outright. */
+ motion or the first draw sets the text outright.
+ Owner (2026-10-29, issue 15398): the glyph is drawn at
+ --cue-flight-size with --cue-flight-halo (see the tokens above), and
+ the rightmost wheel spins a full turn (a longer strip, same
+ transition) so a +1 reads as a roll, not a nudge. */
.cue-merged .ham-seg.cap { color: var(--amber); animation: cue-cap-glow 1.6s ease-out both; }
.cue-merged { background: color-mix(in srgb, var(--amber) 8%, transparent); transition: background 300ms ease; }
- .cue-flight { position: fixed; z-index: var(--z-cue-flight); font-size: var(--fs-lg); line-height: 1; color: var(--amber); font-weight: var(--fw-semibold); pointer-events: none; user-select: none; animation: cue-flight var(--cue-fly-ms, 2000ms) cubic-bezier(0.22, 0.61, 0.36, 1) both; }
+ .cue-flight { position: fixed; z-index: var(--z-cue-flight); font-size: var(--cue-flight-size); line-height: 1; color: var(--amber); font-weight: var(--fw-semibold); filter: var(--cue-flight-halo); pointer-events: none; user-select: none; animation: cue-flight var(--cue-fly-ms, 2000ms) cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.cue-flight.cue-flight-fade { animation: cue-flight-fade var(--cue-fly-ms, 2000ms) ease-out both; }
.ham-sticky { position: sticky; top: var(--navbar-sticky-height); z-index: calc(var(--z-sticky) + 1); display: flex; justify-content: flex-end; align-items: center; min-height: var(--ham-sticky-bar-h); box-sizing: border-box; padding: var(--sp-1) var(--sp-2); background: var(--panel); }
.ham-sticky-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@@ -388,13 +397,16 @@
.ham-merged-count:hover { border-color: var(--line-strong); }
.ham-merged-count .ham-merged-ico { width: 12px; height: 12px; color: var(--amber); }
.ham-merged-count .ham-merged-n { font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
- .ham-merged-count .ham-merged-sub { color: var(--text-faint); font-variant-numeric: tabular-nums; padding-left: var(--sp-2); border-left: var(--line-width) solid var(--line-subtle); }
+ .ham-merged-count .ham-merged-sub { color: var(--text-faint, var(--muted)); font-variant-numeric: tabular-nums; padding-left: var(--sp-2); border-left: var(--line-width) solid var(--line-subtle); }
.ham-merged-count.cue-tick { animation: cue-count-pop 320ms ease-out; }
.ham-merged-count .ham-merged-n, .ham-merged-count .ham-merged-sub { position: relative; }
.ham-merged-count .ham-odo-rolling { color: transparent; }
.ham-odo { position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden; white-space: pre; pointer-events: none; }
.ham-merged-count .ham-merged-n .ham-odo { color: var(--text); }
- .ham-merged-count .ham-merged-sub .ham-odo { left: var(--sp-2); color: var(--text-faint); }
+ /* The dark theme's token sheet has no --text-faint (only body.light-mode
+ sets it), so without a fallback the overlay inherited the rolling
+ line's transparent colour and the day/week counts vanished mid-roll. */
+ .ham-merged-count .ham-merged-sub .ham-odo { left: var(--sp-2); color: var(--text-faint, var(--muted)); }
.ham-odo-static, .ham-odo-col, .ham-odo-d { display: block; height: 1.25em; line-height: 1.25; }
.ham-odo-col { overflow: hidden; }
.ham-odo-strip { display: block; transform: translateY(0); transition: transform var(--odo-ms, 900ms) cubic-bezier(0.22, 0.61, 0.36, 1); }
diff --git a/src/pkg/dashboard/static-src/js/tracker-merged.js b/src/pkg/dashboard/static-src/js/tracker-merged.js
index 6879446f6e..aadc916866 100644
--- a/src/pkg/dashboard/static-src/js/tracker-merged.js
+++ b/src/pkg/dashboard/static-src/js/tracker-merged.js
@@ -221,8 +221,21 @@
(stageTrackerOdometerSet): per digit, a strip of the digits it passes
slides up for STAGE_TRACKER_ODOMETER_MS. The first draw, a fall
(today → 0 at midnight), reduced motion and text that does not line
- up just set the value. */
+ up just set the value.
+ Operator (2026-10-29, hivecommons/hive#15398): "the bee … is so
+ small i can't see what it is" and "i dont see the mileage counter
+ animation" — the roll was there but a +1 moved one 12 px digit a
+ single cell, mostly inside the chip's 320 ms pop, and a reload never
+ rolled. Now the rightmost wheel, and every wheel right of the first
+ changed one, spins a full turn (STAGE_TRACKER_ODOMETER_TURN) before
+ settling, so even a +1 is a visible roll; the day/week line uses the
+ same mechanism, shorter (STAGE_TRACKER_ODOMETER_SUB_MS); and the
+ values last shown are kept in sessionStorage
+ (STAGE_TRACKER_MERGED_LAST_KEY) so a reload rolls up from them. The
+ glyph is drawn at --cue-flight-size (two type steps up) with a
+ theme-aware halo; STAGE_TRACKER_CELEBRATE_GLYPH_HALF centres it. */
const STAGE_TRACKER_CELEBRATE_KEY = 'hive.tracker.celebrate';
+ const STAGE_TRACKER_MERGED_LAST_KEY = 'hive.tracker.merged.last';
const STAGE_TRACKER_CELEBRATE_GLYPH_KEY = 'hive.tracker.celebrate_glyph';
const STAGE_TRACKER_CELEBRATE_GLYPHS = { bee: '🐝', plus1: '+1' };
const STAGE_TRACKER_CELEBRATE_GLYPH_DEFAULT = 'bee';
@@ -230,6 +243,11 @@
const STAGE_TRACKER_CELEBRATE_STAGGER_MS = 200;
const STAGE_TRACKER_CELEBRATE_FLY_MS = 2000;
const STAGE_TRACKER_ODOMETER_MS = 900;
+ const STAGE_TRACKER_ODOMETER_SUB_MS = 600;
+ // Cells a spinning wheel passes before it may settle: one full turn.
+ const STAGE_TRACKER_ODOMETER_TURN = 10;
+ // Half the glyph's box (--cue-flight-size, 2rem) in px, to centre it on the ✓ cell.
+ const STAGE_TRACKER_CELEBRATE_GLYPH_HALF = 16;
const STAGE_TRACKER_CELEBRATE_MAX_FLIGHTS = 3;
const STAGE_TRACKER_CELEBRATE_EXIT_PAD = 40;
const STAGE_TRACKER_MERGED_TIP_MAX = 5;
@@ -389,9 +407,14 @@
// static runs ("201 today · 730 this week" keeps its words), no number
// rose, or every rise is a fall elsewhere. A column is { text } (sits
// still: static runs, unchanged digits, numbers that fell or held) or
- // { steps: ['9', '0'] } — the digits the column passes, old to new,
- // wrapping past 9 the way a carry does; a number that grew a digit rolls
- // its new leading column in from a blank.
+ // { steps: ['9', '0'] } — the digits the column passes, old to new. In
+ // a number that rose, the first changed wheel rolls just the digits
+ // between old and new (wrapping past 9 the way a carry does); every
+ // wheel to its right — and the rightmost wheel always — spins through
+ // at least one full turn (STAGE_TRACKER_ODOMETER_TURN cells) before it
+ // settles, so a +1 is a visible roll and a carry's zeros whirr past.
+ // A number that grew a digit rolls its new leading column in from a
+ // blank.
function stageTrackerOdometerPlan(from, to) {
const a = String(from == null ? '' : from).match(/\d+|\D+/g) || [];
const b = String(to == null ? '' : to).match(/\d+|\D+/g) || [];
@@ -405,12 +428,16 @@
if (Number(b[i]) <= Number(a[i]) || a[i].length > b[i].length) { cols.push({ text: b[i] }); continue; }
rose = true;
const old = a[i].padStart(b[i].length, ' ');
- for (let j = 0; j < b[i].length; j++) {
+ const last = b[i].length - 1;
+ let first = -1;
+ for (let j = 0; j <= last; j++) if (old[j] !== b[i][j] && first < 0) first = j;
+ for (let j = 0; j <= last; j++) {
const o = old[j], nw = b[i][j];
- if (o === nw) { cols.push({ text: nw }); continue; }
+ const spin = j > first || j === last;
+ if (o === nw && !spin) { cols.push({ text: nw }); continue; }
const steps = [o];
if (o === ' ') steps.push(nw);
- else { let d = Number(o); do { d = (d + 1) % 10; steps.push(String(d)); } while (d !== Number(nw)); }
+ else { let d = Number(o); do { d = (d + 1) % 10; steps.push(String(d)); } while (d !== Number(nw) || (spin && steps.length <= STAGE_TRACKER_ODOMETER_TURN)); }
cols.push({ steps });
}
}
@@ -419,16 +446,17 @@
// Stateful: write `text` into el, rolling the digits that rose like an
// odometer. The element's own text is always the plain value (it sets
// the width, and it is what a screen reader and a test read); the roll
- // is an aria-hidden overlay of digit columns appended over it for
- // STAGE_TRACKER_ODOMETER_MS, during which the plain text is transparent
- // (.ham-odo-rolling). The value last written is kept on data-odo-value
- // so a redraw mid-roll compares against it, not the overlay's digits.
- // Instant (no overlay) on the first write, under reduced motion, and
- // when stageTrackerOdometerPlan says nothing rolls. Returns whether a
- // roll started.
- function stageTrackerOdometerSet(el, text) {
+ // is an aria-hidden overlay of digit columns appended over it for `ms`
+ // (STAGE_TRACKER_ODOMETER_MS unless given), during which the plain
+ // text is transparent (.ham-odo-rolling). The value last written is
+ // kept on data-odo-value so a redraw mid-roll compares against it, not
+ // the overlay's digits. Instant (no overlay) on the first write, under
+ // reduced motion, and when stageTrackerOdometerPlan says nothing rolls.
+ // Returns whether a roll started.
+ function stageTrackerOdometerSet(el, text, ms) {
if (!el) return false;
text = String(text);
+ ms = Number(ms) > 0 ? Number(ms) : STAGE_TRACKER_ODOMETER_MS;
const prev = el.getAttribute('data-odo-value');
if (prev === text) return false;
el.setAttribute('data-odo-value', text);
@@ -452,15 +480,39 @@
col.appendChild(strip);
wrap.appendChild(col);
}
- wrap.style.setProperty('--odo-ms', STAGE_TRACKER_ODOMETER_MS + 'ms');
+ wrap.style.setProperty('--odo-ms', ms + 'ms');
el.appendChild(wrap);
el._odoWrap = wrap;
el.classList.add('ham-odo-rolling');
void el.offsetWidth;
wrap.classList.add('ham-odo-run');
- el._odoTimer = setTimeout(() => { el._odoTimer = 0; el._odoWrap = null; el.classList.remove('ham-odo-rolling'); wrap.remove(); }, STAGE_TRACKER_ODOMETER_MS + 80);
+ el._odoTimer = setTimeout(() => { el._odoTimer = 0; el._odoWrap = null; el.classList.remove('ham-odo-rolling'); wrap.remove(); }, ms + 80);
return true;
}
+ // Stateful: seed an element that has not been written yet with the
+ // value it showed last time (so the first real write rolls up from
+ // it). Only a value the new text would roll from is taken; anything
+ // else leaves the first write instant. Returns whether it seeded.
+ function stageTrackerOdometerSeed(el, last, next) {
+ if (!el || last == null || el.getAttribute('data-odo-value') != null) return false;
+ if (!stageTrackerOdometerPlan(String(last), String(next))) return false;
+ el.setAttribute('data-odo-value', String(last));
+ el.textContent = String(last);
+ return true;
+ }
+ // Pure: the chip's remembered values ({ n, sub }) from a sessionStorage
+ // string, or null when absent or malformed.
+ function stageTrackerMergedLastParse(raw) {
+ if (!raw) return null;
+ try { const v = JSON.parse(raw); if (v && typeof v === 'object' && /^\d+$/.test(String(v.n)) && typeof v.sub === 'string') return { n: String(v.n), sub: v.sub }; } catch {}
+ return null;
+ }
+ function stageTrackerMergedLastLoad() {
+ try { return stageTrackerMergedLastParse(sessionStorage.getItem(STAGE_TRACKER_MERGED_LAST_KEY)); } catch { return null; }
+ }
+ function stageTrackerMergedLastSave(n, sub) {
+ try { sessionStorage.setItem(STAGE_TRACKER_MERGED_LAST_KEY, JSON.stringify({ n: String(n), sub: String(sub) })); } catch {}
+ }
function stageTrackerMergedCountDraw(tick) {
const chip = stageTrackerMergedChip();
const now = Date.now();
@@ -470,8 +522,16 @@
if (txt.count > _stageTrackerMergedShown || tick) _stageTrackerMergedShown = Math.max(_stageTrackerMergedShown, txt.count);
const shown = _stageTrackerMergedShown;
if (!chip) return;
- stageTrackerOdometerSet(chip.querySelector('.ham-merged-n'), shown);
- stageTrackerOdometerSet(chip.querySelector('.ham-merged-sub'), txt.sub);
+ const n = chip.querySelector('.ham-merged-n'), sub = chip.querySelector('.ham-merged-sub');
+ // First draw of this page: roll up from what the tab showed before
+ // the reload, when that is behind the number we have now.
+ if (n && n.getAttribute('data-odo-value') == null) {
+ const last = stageTrackerMergedLastLoad();
+ if (last) { stageTrackerOdometerSeed(n, last.n, shown); stageTrackerOdometerSeed(sub, last.sub, txt.sub); }
+ }
+ stageTrackerOdometerSet(n, shown);
+ stageTrackerOdometerSet(sub, txt.sub, STAGE_TRACKER_ODOMETER_SUB_MS);
+ if (shown > 0) stageTrackerMergedLastSave(shown, txt.sub);
const title = txt.title.replace(/^Merged: \d+ all time/, `Merged: ${shown} all time`);
if (chip.title !== title) chip.title = title;
if (tick) {
@@ -660,8 +720,8 @@
glyph.className = 'cue-flight' + (reduced ? ' cue-flight-fade' : '');
glyph.setAttribute('aria-hidden', 'true');
glyph.textContent = stageTrackerCelebrateGlyph();
- glyph.style.setProperty('left', (from.left + from.width / 2 - 10) + 'px');
- glyph.style.setProperty('top', (from.top + from.height / 2 - 10) + 'px');
+ glyph.style.setProperty('left', (from.left + from.width / 2 - STAGE_TRACKER_CELEBRATE_GLYPH_HALF) + 'px');
+ glyph.style.setProperty('top', (from.top + from.height / 2 - STAGE_TRACKER_CELEBRATE_GLYPH_HALF) + 'px');
glyph.style.setProperty('--cue-dx', to.dx + 'px');
glyph.style.setProperty('--cue-dy', to.dy + 'px');
glyph.style.setProperty('--cue-end-opacity', to.lands ? '0.25' : '1');
diff --git a/src/pkg/dashboard/static-src/js/tracker-sound.js b/src/pkg/dashboard/static-src/js/tracker-sound.js
index edfac57237..d6bdff67cc 100644
--- a/src/pkg/dashboard/static-src/js/tracker-sound.js
+++ b/src/pkg/dashboard/static-src/js/tracker-sound.js
@@ -410,7 +410,7 @@
const opts = Object.keys(STAGE_TRACKER_CELEBRATE_GLYPHS).map(id => ``).join('');
return ` When a pull request merges its row stays for a moment, its ✓ cell glows and a small glyph rises from it towards the top of the window — landing on the "Merged" chip when it is in view, otherwise leaving through the top edge — the count rolls up like an odometer, and a banner at the bottom right names the merge until dismissed (or 30 s). Under reduced motion the glyph fades in place. The chip's number is the hive's all-time count (kept on the server, so it survives a reload); click it for the recent merges. When a pull request merges its row stays for a moment, its ✓ cell glows and a glyph (the bee) rises from it towards the top of the window — landing on the "Merged" chip when it is in view, otherwise leaving through the top edge — the count rolls up like an odometer, and a banner at the bottom right names the merge until dismissed (or 30 s). Under reduced motion the glyph fades in place. The chip's number is the hive's all-time count (kept on the server, so it survives a reload); click it for the recent merges.
When a pull request merges its row stays for a moment, its ✓ cell glows and a small glyph rises from it towards the top of the window — landing on the "Merged" chip when it is in view, otherwise leaving through the top edge — the count rolls up like an odometer, and a banner at the bottom right names the merge until dismissed (or 30 s). Under reduced motion the glyph fades in place. The chip's number is the hive's all-time count (kept on the server, so it survives a reload); click it for the recent merges.
+When a pull request merges its row stays for a moment, its ✓ cell glows and a glyph (the bee) rises from it towards the top of the window — landing on the "Merged" chip when it is in view, otherwise leaving through the top edge — the count rolls up like an odometer, and a banner at the bottom right names the merge until dismissed (or 30 s). Under reduced motion the glyph fades in place. The chip's number is the hive's all-time count (kept on the server, so it survives a reload); click it for the recent merges.