From 5d79ba42d8829e7117d071b9c9614286d3edf536 Mon Sep 17 00:00:00 2001 From: mendezr Date: Fri, 30 Oct 2026 18:50:47 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=90=9B=20fix:=20persist=20activity=20?= =?UTF-8?q?merge=20delivery=20and=20show=20banner=20countdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep the last observed PR state and delivered identities across reloads, and resolve audit repo aliases after the last row disappears. Use the shared countdown for configured merge-banner lifetimes. Hive-Run: hivecommons/hive#15828 Hive-Plan: issue-15828-merge-session-and-countdown Hive-Spec: issue-15828#merge-delivery-and-countdown Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> Signed-off-by: mendezr Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../fixed-15828-merge-session-countdown.md | 1 + src/pkg/dashboard/stage_tracker_cues_test.go | 4 + .../stage_tracker_merge_session_test.go | 88 +++++++++++++++++++ .../stage_tracker_merge_sound_test.go | 4 +- .../static-src/js/tracker-filter-render.js | 2 +- .../dashboard/static-src/js/tracker-merged.js | 43 ++++++++- src/pkg/dashboard/static/index.html | 45 ++++++++-- 7 files changed, 175 insertions(+), 12 deletions(-) create mode 100644 changelog.d/fixed-15828-merge-session-countdown.md create mode 100644 src/pkg/dashboard/stage_tracker_merge_session_test.go diff --git a/changelog.d/fixed-15828-merge-session-countdown.md b/changelog.d/fixed-15828-merge-session-countdown.md new file mode 100644 index 0000000000..9a219bb4d2 --- /dev/null +++ b/changelog.d/fixed-15828-merge-session-countdown.md @@ -0,0 +1 @@ +- Activity monitor merge notifications survive reloads without replaying delivered merges, resolve audit events for vanished rows, and show a countdown bar using the configured banner lifetime. diff --git a/src/pkg/dashboard/stage_tracker_cues_test.go b/src/pkg/dashboard/stage_tracker_cues_test.go index 5d504617ca..ebaa70a7c6 100644 --- a/src/pkg/dashboard/stage_tracker_cues_test.go +++ b/src/pkg/dashboard/stage_tracker_cues_test.go @@ -362,6 +362,8 @@ func stageTrackerCelebrateJS(t *testing.T, html string) string { jsFunc(t, html, "toastCountdownBar"), jsFunc(t, html, "toastCountdownCancel"), jsFunc(t, html, "stageTrackerMergeBanner"), + jsFunc(t, html, "toastCountdownBar"), + jsFunc(t, html, "toastCountdownCancel"), jsFunc(t, html, "stageTrackerMergeBannerDismiss"), jsFunc(t, html, "hamBannerDismiss"), jsFunc(t, html, "hamBannerShowRow"), @@ -418,6 +420,8 @@ function el(tag, attrs) { get outerHTML() { return '
'; }, querySelector(sel) { return e.querySelectorAll(sel)[0] || null; }, querySelectorAll(sel) { const out = []; const unesc = v => v.replace(/\\(.)/g, '$1'); const m = sel.match(/^\[([\w-]+)="(.*)"\]$/); const word = sel.match(/^\[([\w-]+)~="(.*)"\]\[data-ham-key\]$/); const cls = sel.match(/^\.([\w-]+)/); const capOfRow = sel === '.ham-row[data-ham-key] .ham-seg.cap'; const walk = n => { for (const c of n.children) { if (capOfRow) { if (c.classList.contains('cap') && c.closest('.ham-row') && c.closest('.ham-row').classList.contains('ham-row')) out.push(c); } else if (m && c.attrs[m[1]] === unesc(m[2])) out.push(c); else if (word && c.attrs['data-ham-key'] != null && String(c.attrs[word[1]] || '').split(' ').includes(unesc(word[2]))) out.push(c); else if (!m && !word && cls && c.classList.contains(cls[1]) && (!sel.includes('[data-at]') || c.attrs['data-at'] != null)) out.push(c); walk(c); } }; walk(e); return out; }, + matches() { return false; }, + contains(node) { return node === e || e.children.some(c => c.contains(node)); }, closest(sel) { let n = e; while (n) { if (n.attrs && n.attrs['data-ham-key'] != null) return n; n = n.parentNode; } return null; }, matches() { return false; }, contains(x) { return x === e || e.children.some(c => c.contains(x)); }, }; diff --git a/src/pkg/dashboard/stage_tracker_merge_session_test.go b/src/pkg/dashboard/stage_tracker_merge_session_test.go new file mode 100644 index 0000000000..33bdafe555 --- /dev/null +++ b/src/pkg/dashboard/stage_tracker_merge_session_test.go @@ -0,0 +1,88 @@ +package dashboard + +import ( + "strings" + "testing" +) + +// Exercise the real reconcile entry point with a shared sessionStorage but +// reset SPA memory, as a reload would. Detached glyph flight itself belongs +// to the companion #15817 change; this pins delivery to that pipeline. +func TestStageTrackerMergeSessionNode(t *testing.T) { + html := indexHTML(t) + script := stageTrackerCelebrateJS(t, html) + "\n" + strings.Join([]string{ + jsConstLine(t, html, "STAGE_TRACKER_MERGE_SESSION_KEY"), + "var _stageTrackerMergeSessionLoaded = false;", + jsFunc(t, html, "stageTrackerReconcileMerges"), + }, "\n") + stageTrackerCelebrateFixture + ` +function reload() { + _stageTrackerMergeSessionLoaded = false; + _stageTrackerMergeState = null; + _stageTrackerZapped = {}; +} +stageTrackerReconcileMerges(items(42)); +// Webhook eviction can precede the audit fact, including across a reload. +stageTrackerReconcileMerges({ items: [] }); +assert.strictEqual(banners.children.length, 0, 'absence alone is not a merge'); +reload(); +const merged = { items: [], recently_merged: [{ repo: 'r', number: 42 }] }; +stageTrackerReconcileMerges(merged); +tick(0); +assert.strictEqual(banners.children.length, 1, 'last row absent, short audit repo still resolves after reload'); +assert.strictEqual(_stageTrackerMergeState['o/r/pr#42'], true); +assert.strictEqual(_stageTrackerZapped['o/r/pr#42'], true); +assert.strictEqual(zaps.length, 1, 'exactly one delivery to the celebration/count pipeline'); +stageTrackerReconcileMerges({ items: [], merged: { recent: [{ repo: 'o/r', number: 42 }] } }); +reload(); +stageTrackerReconcileMerges(merged); +tick(0); +assert.strictEqual(banners.children.length, 1, 'reload after delivery does not repeat the banner'); +assert.strictEqual(zaps.length, 1, 'ledger + audit + reload do not repeat the counter tick'); +// Delivered identity outlives the server's recent-history window, even +// if a stale open snapshot resurfaces after another reload. +stageTrackerReconcileMerges({ items: [] }); +reload(); +stageTrackerReconcileMerges(items(42)); +stageTrackerReconcileMerges(payloadMerged(42)); +tick(0); +assert.strictEqual(banners.children.length, 1, 'expired recent history cannot erase delivered identity'); +// A tab's first snapshot is a baseline, not a replay of old merges. +delete session[STAGE_TRACKER_MERGE_SESSION_KEY]; +reload(); +stageTrackerReconcileMerges(payloadMerged(99)); +tick(0); +assert.strictEqual(banners.children.length, 1); +// A corrupt/unavailable browser store must not break normal live delivery. +session[STAGE_TRACKER_MERGE_SESSION_KEY] = '{broken'; +reload(); +stageTrackerReconcileMerges(items(43)); +stageTrackerReconcileMerges(payloadMerged(43)); +tick(0); +assert.strictEqual(banners.children.length, 2); +` + runStageTrackerRowActionsScript(t, script) +} + +func TestStageTrackerMergeBannerCountdownNode(t *testing.T) { + html := indexHTML(t) + runStageTrackerRowActionsScript(t, stageTrackerCelebrateJS(t, html)+stageTrackerCelebrateFixture+` +const ttl = 2468; +stageTrackerMergeBannerMs = () => ttl; +const b = stageTrackerMergeBanner({ key: 'o/r/pr#7', repo: 'o/r', number: 7, at: clock }); +assert.ok(b.querySelector('.toast-bar'), 'merge banner draws the shared countdown'); +assert.strictEqual(b.style.props['--toast-ttl'], ttl + 'ms'); +tick(ttl - 1); +assert.ok(b.parentNode, 'banner remains for its configured lifetime'); +tick(1); +assert.ok(b.classList.contains('merge-banner-out'), 'shared timer dismisses at the bar deadline'); +tick(200); +assert.strictEqual(b.parentNode, null); +const manual = stageTrackerMergeBanner({ key: 'o/r/pr#8', repo: 'o/r', number: 8 }); +assert.ok(manual._countdown.timer); +stageTrackerMergeBannerDismiss(manual); +assert.strictEqual(manual._countdown, null, 'manual dismissal cancels countdown'); +`) + if !strings.Contains(cssRule(t, html, ".merge-banner"), "position: relative;") { + t.Fatal("merge countdown must be positioned within its own banner") + } +} diff --git a/src/pkg/dashboard/stage_tracker_merge_sound_test.go b/src/pkg/dashboard/stage_tracker_merge_sound_test.go index b62bfbcc53..ffde1ef32f 100644 --- a/src/pkg/dashboard/stage_tracker_merge_sound_test.go +++ b/src/pkg/dashboard/stage_tracker_merge_sound_test.go @@ -97,7 +97,7 @@ func TestStageTrackerMergeSoundWiring(t *testing.T) { `localStorage.getItem(STAGE_TRACKER_SOUND_KEY) === '1'`, `localStorage.setItem(STAGE_TRACKER_SOUND_KEY, _stageTrackerSoundOn ? '1' : '0')`, `const STAGE_TRACKER_BUZZ_MASTER_GAIN = 0.2;`, - `function stageTrackerMergeState(d)`, + `function stageTrackerMergeState(d, prev)`, `function stageTrackerCarryOpen(prev, next)`, `function stageTrackerNewlyMerged(prev, next)`, `function stageTrackerNoteMerges(d)`, @@ -105,7 +105,7 @@ func TestStageTrackerMergeSoundWiring(t *testing.T) { `function stageTrackerNewlyOpened(prev, next)`, `function stageTrackerNoteOpened(d)`, `function hamSoundToggle()`, - `if (data && typeof data === 'object') { _stageTracker = data; stageTrackerNoteMerges(data); stageTrackerNoteOpened(data); stageTrackerNoteMoves(data); }`, + `if (data && typeof data === 'object') { _stageTracker = data; stageTrackerReconcileMerges(data); stageTrackerNoteOpened(data); stageTrackerNoteMoves(data); }`, `if (stageTrackerSoundGate()) stageTrackerPlayZap(`, `if (stageTrackerSoundGate()) stageTrackerPlayBuzz(`, `function stageTrackerSoundGate() { return !!_stageTrackerSoundOn && !document.hidden; }`, diff --git a/src/pkg/dashboard/static-src/js/tracker-filter-render.js b/src/pkg/dashboard/static-src/js/tracker-filter-render.js index 27a0629c86..9d1984c55b 100644 --- a/src/pkg/dashboard/static-src/js/tracker-filter-render.js +++ b/src/pkg/dashboard/static-src/js/tracker-filter-render.js @@ -52,7 +52,7 @@ } function renderStageTracker(data, countRefresh = false) { - if (data && typeof data === 'object') { _stageTracker = data; stageTrackerNoteMerges(data); stageTrackerNoteOpened(data); stageTrackerNoteMoves(data); } + if (data && typeof data === 'object') { _stageTracker = data; stageTrackerReconcileMerges(data); stageTrackerNoteOpened(data); stageTrackerNoteMoves(data); } // Row-action feedback rides the payload: a result toast leaves and a // row stops "acting" once the item it targets reads a new state. if (data && typeof data === 'object' && typeof stageTrackerResultToastsSync === 'function') { stageTrackerNoteEvents(data); stageTrackerResultToastsSync(data); stageTrackerPendingExpire(data); } diff --git a/src/pkg/dashboard/static-src/js/tracker-merged.js b/src/pkg/dashboard/static-src/js/tracker-merged.js index 124a0a106c..4c8264d659 100644 --- a/src/pkg/dashboard/static-src/js/tracker-merged.js +++ b/src/pkg/dashboard/static-src/js/tracker-merged.js @@ -4,10 +4,17 @@ // Pure: PR key → merged? for one payload. Issues are not tracked. A // recently_merged repo given by its short name is resolved against the // owner/name of the items (any kind, any repo) when exactly one matches. - function stageTrackerMergeState(d) { + function stageTrackerMergeState(d, prev) { const out = {}; if (!d || typeof d !== 'object') return out; const byShort = {}; + // A dropped row (including one from before a reload) still teaches + // the short repo alias used by the audit side list. + for (const key of Object.keys(prev || {})) { + const repo = key.slice(0, key.lastIndexOf('/pr#')); + const slash = repo.lastIndexOf('/'); + if (slash > 0) { const short = repo.slice(slash + 1); byShort[short] = (short in byShort && byShort[short] !== repo) ? '' : repo; } + } for (const it of (Array.isArray(d.items) ? d.items : [])) { if (!it) continue; // Every item of every repo (issues too) teaches the short → full @@ -47,10 +54,38 @@ return Object.keys(next).filter(k => next[k] === true && prev[k] === false).sort(); } + const STAGE_TRACKER_MERGE_SESSION_KEY = 'hive.tracker.merge-session.v1'; + var _stageTrackerMergeSessionLoaded = false; + // Persist both the last observation and the delivered keys: saving only + // delivered keys loses an open→merged transition across a reload. The + // first visit still seeds history silently rather than replaying it. + function stageTrackerReconcileMerges(d) { + if (!_stageTrackerMergeSessionLoaded) { + _stageTrackerMergeSessionLoaded = true; + try { + const saved = JSON.parse(sessionStorage.getItem(STAGE_TRACKER_MERGE_SESSION_KEY)); + if (saved && saved.state && typeof saved.state === 'object' && !Array.isArray(saved.state)) { + const state = {}, delivered = {}; + for (const key of Object.keys(saved.state)) { + if (!/^.+\/pr#[1-9][0-9]*$/.test(key) || typeof saved.state[key] !== 'boolean') continue; + state[key] = saved.state[key]; + } + for (const key of Object.keys(saved.delivered || {})) { + if (/^.+\/pr#[1-9][0-9]*$/.test(key) && saved.delivered[key] === true) delivered[key] = true; + } + _stageTrackerMergeState = state; + _stageTrackerZapped = delivered; + } + } catch {} // Storage disabled/corrupt: keep the in-memory path. + } + stageTrackerNoteMerges(d); + try { sessionStorage.setItem(STAGE_TRACKER_MERGE_SESSION_KEY, JSON.stringify({ state: _stageTrackerMergeState, delivered: _stageTrackerZapped })); } catch {} + } + function stageTrackerNoteMerges(d) { const nowMs = Date.now(); _stageTrackerMergingHoldMs = stageTrackerMergingHoldMsOf(d, _stageTrackerMergingHoldMs); - const raw = stageTrackerCarryOpen(_stageTrackerMergeState, stageTrackerMergeState(d)); + const raw = stageTrackerCarryOpen(_stageTrackerMergeState, stageTrackerMergeState(d, _stageTrackerMergeState)); // The merge gate's hold (hivecommons/hive#15245, #15808) keeps a // row the payload dropped mid-merge on the board at "Merging" until // the merged fact arrives (then the merge is fresh at once) or the @@ -204,7 +239,7 @@ function stageTrackerMergingHoldRelease() { _stageTrackerMergingHoldTimer = 0; if (!_stageTracker || typeof _stageTracker !== 'object') return; - stageTrackerNoteMerges(_stageTracker); + stageTrackerReconcileMerges(_stageTracker); renderStageTracker(undefined, true); } @@ -945,7 +980,7 @@ if (b.rowKey) el.setAttribute('data-ham-row', b.rowKey); el.innerHTML = `
${num ? `#${esc(num)} ` : ''}merged${info.preview ? ' (test)' : ''}
${esc(t.text)}
`; box.appendChild(el); - while (box.children.length > STAGE_TRACKER_MERGE_BANNER_MAX) box.children[0].remove(); + while (box.children.length > STAGE_TRACKER_MERGE_BANNER_MAX) { toastCountdownCancel(box.children[0]); box.children[0].remove(); } toastCountdownBar(el, stageTrackerMergeBannerMs(), () => stageTrackerMergeBannerDismiss(el)); return el; } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 808ecc9374..04b6d1c246 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -19407,7 +19407,7 @@

All labels

} function renderStageTracker(data, countRefresh = false) { - if (data && typeof data === 'object') { _stageTracker = data; stageTrackerNoteMerges(data); stageTrackerNoteOpened(data); stageTrackerNoteMoves(data); } + if (data && typeof data === 'object') { _stageTracker = data; stageTrackerReconcileMerges(data); stageTrackerNoteOpened(data); stageTrackerNoteMoves(data); } // Row-action feedback rides the payload: a result toast leaves and a // row stops "acting" once the item it targets reads a new state. if (data && typeof data === 'object' && typeof stageTrackerResultToastsSync === 'function') { stageTrackerNoteEvents(data); stageTrackerResultToastsSync(data); stageTrackerPendingExpire(data); } @@ -21980,10 +21980,17 @@

All labels

// Pure: PR key → merged? for one payload. Issues are not tracked. A // recently_merged repo given by its short name is resolved against the // owner/name of the items (any kind, any repo) when exactly one matches. - function stageTrackerMergeState(d) { + function stageTrackerMergeState(d, prev) { const out = {}; if (!d || typeof d !== 'object') return out; const byShort = {}; + // A dropped row (including one from before a reload) still teaches + // the short repo alias used by the audit side list. + for (const key of Object.keys(prev || {})) { + const repo = key.slice(0, key.lastIndexOf('/pr#')); + const slash = repo.lastIndexOf('/'); + if (slash > 0) { const short = repo.slice(slash + 1); byShort[short] = (short in byShort && byShort[short] !== repo) ? '' : repo; } + } for (const it of (Array.isArray(d.items) ? d.items : [])) { if (!it) continue; // Every item of every repo (issues too) teaches the short → full @@ -22023,10 +22030,38 @@

All labels

return Object.keys(next).filter(k => next[k] === true && prev[k] === false).sort(); } + const STAGE_TRACKER_MERGE_SESSION_KEY = 'hive.tracker.merge-session.v1'; + var _stageTrackerMergeSessionLoaded = false; + // Persist both the last observation and the delivered keys: saving only + // delivered keys loses an open→merged transition across a reload. The + // first visit still seeds history silently rather than replaying it. + function stageTrackerReconcileMerges(d) { + if (!_stageTrackerMergeSessionLoaded) { + _stageTrackerMergeSessionLoaded = true; + try { + const saved = JSON.parse(sessionStorage.getItem(STAGE_TRACKER_MERGE_SESSION_KEY)); + if (saved && saved.state && typeof saved.state === 'object' && !Array.isArray(saved.state)) { + const state = {}, delivered = {}; + for (const key of Object.keys(saved.state)) { + if (!/^.+\/pr#[1-9][0-9]*$/.test(key) || typeof saved.state[key] !== 'boolean') continue; + state[key] = saved.state[key]; + } + for (const key of Object.keys(saved.delivered || {})) { + if (/^.+\/pr#[1-9][0-9]*$/.test(key) && saved.delivered[key] === true) delivered[key] = true; + } + _stageTrackerMergeState = state; + _stageTrackerZapped = delivered; + } + } catch {} // Storage disabled/corrupt: keep the in-memory path. + } + stageTrackerNoteMerges(d); + try { sessionStorage.setItem(STAGE_TRACKER_MERGE_SESSION_KEY, JSON.stringify({ state: _stageTrackerMergeState, delivered: _stageTrackerZapped })); } catch {} + } + function stageTrackerNoteMerges(d) { const nowMs = Date.now(); _stageTrackerMergingHoldMs = stageTrackerMergingHoldMsOf(d, _stageTrackerMergingHoldMs); - const raw = stageTrackerCarryOpen(_stageTrackerMergeState, stageTrackerMergeState(d)); + const raw = stageTrackerCarryOpen(_stageTrackerMergeState, stageTrackerMergeState(d, _stageTrackerMergeState)); // The merge gate's hold (hivecommons/hive#15245, #15808) keeps a // row the payload dropped mid-merge on the board at "Merging" until // the merged fact arrives (then the merge is fresh at once) or the @@ -22180,7 +22215,7 @@

All labels

function stageTrackerMergingHoldRelease() { _stageTrackerMergingHoldTimer = 0; if (!_stageTracker || typeof _stageTracker !== 'object') return; - stageTrackerNoteMerges(_stageTracker); + stageTrackerReconcileMerges(_stageTracker); renderStageTracker(undefined, true); } @@ -22921,7 +22956,7 @@

All labels

if (b.rowKey) el.setAttribute('data-ham-row', b.rowKey); el.innerHTML = `
${num ? `#${esc(num)} ` : ''}merged${info.preview ? ' (test)' : ''}
${esc(t.text)}
`; box.appendChild(el); - while (box.children.length > STAGE_TRACKER_MERGE_BANNER_MAX) box.children[0].remove(); + while (box.children.length > STAGE_TRACKER_MERGE_BANNER_MAX) { toastCountdownCancel(box.children[0]); box.children[0].remove(); } toastCountdownBar(el, stageTrackerMergeBannerMs(), () => stageTrackerMergeBannerDismiss(el)); return el; } From 657c1c1d3a994e0f12602c70a995cca57cede10f Mon Sep 17 00:00:00 2001 From: mendezr Date: Fri, 30 Oct 2026 19:04:11 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=90=9B=20fix:=20align=20merge=20feedb?= =?UTF-8?q?ack=20fixtures=20with=20session=20reconciliation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mendezr Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/pkg/dashboard/stage_tracker_cues_test.go | 3 +++ src/pkg/dashboard/stage_tracker_merge_session_test.go | 10 ++++------ src/pkg/dashboard/stage_tracker_merge_sound_test.go | 10 +++++----- src/pkg/dashboard/stage_tracker_motion_test.go | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_cues_test.go b/src/pkg/dashboard/stage_tracker_cues_test.go index ebaa70a7c6..f4ea56b4df 100644 --- a/src/pkg/dashboard/stage_tracker_cues_test.go +++ b/src/pkg/dashboard/stage_tracker_cues_test.go @@ -375,6 +375,9 @@ func stageTrackerCelebrateJS(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerAgoText"), jsFunc(t, html, "stageTrackerAfter"), jsFunc(t, html, "stageTrackerTransient"), + jsConstLine(t, html, "STAGE_TRACKER_MERGE_SESSION_KEY"), + "var _stageTrackerMergeSessionLoaded = false;", + jsFunc(t, html, "stageTrackerReconcileMerges"), jsFunc(t, html, "stageTrackerNoteMerges"), stageTrackerMergingHoldOffJS, jsFunc(t, html, "stageTrackerPRKey"), diff --git a/src/pkg/dashboard/stage_tracker_merge_session_test.go b/src/pkg/dashboard/stage_tracker_merge_session_test.go index 33bdafe555..f2c994d951 100644 --- a/src/pkg/dashboard/stage_tracker_merge_session_test.go +++ b/src/pkg/dashboard/stage_tracker_merge_session_test.go @@ -10,11 +10,7 @@ import ( // to the companion #15817 change; this pins delivery to that pipeline. func TestStageTrackerMergeSessionNode(t *testing.T) { html := indexHTML(t) - script := stageTrackerCelebrateJS(t, html) + "\n" + strings.Join([]string{ - jsConstLine(t, html, "STAGE_TRACKER_MERGE_SESSION_KEY"), - "var _stageTrackerMergeSessionLoaded = false;", - jsFunc(t, html, "stageTrackerReconcileMerges"), - }, "\n") + stageTrackerCelebrateFixture + ` + script := stageTrackerCelebrateJS(t, html) + stageTrackerCelebrateFixture + ` function reload() { _stageTrackerMergeSessionLoaded = false; _stageTrackerMergeState = null; @@ -75,7 +71,9 @@ tick(ttl - 1); assert.ok(b.parentNode, 'banner remains for its configured lifetime'); tick(1); assert.ok(b.classList.contains('merge-banner-out'), 'shared timer dismisses at the bar deadline'); -tick(200); +// No animationend is emitted by the fake DOM: allow the shared +// stageTrackerAfter fallback (1.5 times the 180ms exit animation) to fire. +tick(270); assert.strictEqual(b.parentNode, null); const manual = stageTrackerMergeBanner({ key: 'o/r/pr#8', repo: 'o/r', number: 8 }); assert.ok(manual._countdown.timer); diff --git a/src/pkg/dashboard/stage_tracker_merge_sound_test.go b/src/pkg/dashboard/stage_tracker_merge_sound_test.go index ffde1ef32f..9b7f004a59 100644 --- a/src/pkg/dashboard/stage_tracker_merge_sound_test.go +++ b/src/pkg/dashboard/stage_tracker_merge_sound_test.go @@ -228,23 +228,23 @@ assert.deepStrictEqual(stageTrackerMergeState({ items: [P(20, 50), { kind: 'pr', { 'a/b/pr#20': false, 'c/b/pr#1': false, 'b/pr#20': true }, 'an ambiguous short name is left alone'); stageTrackerNoteMerges({ items: [P(21, 50)] }); stageTrackerNoteMerges({ items: [], recently_merged: [{ repo: 'b', number: 21 }] }); -assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1], 'short-name entry with no item left to resolve it cannot match…'); +assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1], 'short-name entry resolves against the last observed row after eviction'); stageTrackerNoteMerges({ items: [P(22, 50)] }); stageTrackerNoteMerges({ items: [P(22, 50)], recently_merged: [{ repo: 'b', number: 22 }] }); -assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1], '…but one that arrives while the item is still listed does'); +assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1, 1], 'an entry that arrives while the item is still listed also zaps'); // Regression: the PR drops out of items one payload before the audit log // lists its merge (webhook-patched snapshot vs poller). Carried as open, // it still zaps when recently_merged catches up — once. stageTrackerNoteMerges({ items: [P(30, 50), P(31, 60)] }); stageTrackerNoteMerges({ items: [P(31, 60)] }); -assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1], 'vanished without a merge entry: nothing yet'); +assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1, 1], 'vanished without a merge entry: nothing yet'); assert.strictEqual(_stageTrackerMergeState['a/b/pr#30'], false, 'carried as still open'); stageTrackerNoteMerges({ items: [P(31, 60)], recently_merged: [{ repo: 'a/b', number: 30 }] }); -assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1, 1], 'late recently_merged entry zaps'); +assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1, 1, 1], 'late recently_merged entry zaps'); stageTrackerNoteMerges({ items: [P(31, 60)], recently_merged: [{ repo: 'a/b', number: 30 }] }); stageTrackerNoteMerges({ items: [P(31, 60)] }); -assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1, 1], 'no replay once the entry ages out'); +assert.deepStrictEqual(plays, [STAGE_TRACKER_SOUND_MAX_PLAYS, 1, 1, 1, 1], 'no replay once the entry ages out'); assert.deepStrictEqual(stageTrackerCarryOpen(null, { x: true }), { x: true }); assert.deepStrictEqual(stageTrackerCarryOpen({ a: false, b: true, c: false }, { c: true }), { a: false, c: true }, 'merged keys are not carried, open ones are'); ` diff --git a/src/pkg/dashboard/stage_tracker_motion_test.go b/src/pkg/dashboard/stage_tracker_motion_test.go index 5319d9c6cb..a20c91e16e 100644 --- a/src/pkg/dashboard/stage_tracker_motion_test.go +++ b/src/pkg/dashboard/stage_tracker_motion_test.go @@ -38,7 +38,7 @@ func TestStageTrackerMotionWiring(t *testing.T) { `function stageTrackerNoteMoves(d)`, `function stageTrackerAnimateMoves(root)`, `function stageTrackerMotionEffect(setting, reduced)`, - `stageTrackerNoteMerges(data); stageTrackerNoteOpened(data); stageTrackerNoteMoves(data); }`, + `stageTrackerReconcileMerges(data); stageTrackerNoteOpened(data); stageTrackerNoteMoves(data); }`, `const ctx = { nowMs, stages, moves: _stageTrackerMoves };`, `if (Object.keys(_stageTrackerMoves).length) { stageTrackerAnimateMoves(el); _stageTrackerMoves = {}; }`, `window.matchMedia('(prefers-reduced-motion: reduce)').matches`, From 558ad3942a4605bd5345fafd860cc426b11cfd6d Mon Sep 17 00:00:00 2001 From: mendezr Date: Fri, 30 Oct 2026 19:16:16 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=90=9B=20fix:=20wait=20for=20detached?= =?UTF-8?q?=20merge=20celebration=20landing=20in=20session=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mendezr Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/pkg/dashboard/stage_tracker_merge_session_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_merge_session_test.go b/src/pkg/dashboard/stage_tracker_merge_session_test.go index f2c994d951..6c7624c659 100644 --- a/src/pkg/dashboard/stage_tracker_merge_session_test.go +++ b/src/pkg/dashboard/stage_tracker_merge_session_test.go @@ -6,8 +6,8 @@ import ( ) // Exercise the real reconcile entry point with a shared sessionStorage but -// reset SPA memory, as a reload would. Detached glyph flight itself belongs -// to the companion #15817 change; this pins delivery to that pipeline. +// reset SPA memory, as a reload would. Delivery enters the detached glyph +// pipeline, which counts and plays the merge sound only after landing. func TestStageTrackerMergeSessionNode(t *testing.T) { html := indexHTML(t) script := stageTrackerCelebrateJS(t, html) + stageTrackerCelebrateFixture + ` @@ -27,12 +27,18 @@ tick(0); assert.strictEqual(banners.children.length, 1, 'last row absent, short audit repo still resolves after reload'); assert.strictEqual(_stageTrackerMergeState['o/r/pr#42'], true); assert.strictEqual(_stageTrackerZapped['o/r/pr#42'], true); +assert.strictEqual(flights().length, 1, 'exactly one delivery to the detached celebration pipeline'); +assert.strictEqual(zaps.length, 0, 'sound waits for the bee to land'); +tick(STAGE_TRACKER_CELEBRATE_FLY_MS * 1.5 + 10); +assert.strictEqual(flights().length, 0, 'bee landed'); assert.strictEqual(zaps.length, 1, 'exactly one delivery to the celebration/count pipeline'); stageTrackerReconcileMerges({ items: [], merged: { recent: [{ repo: 'o/r', number: 42 }] } }); reload(); stageTrackerReconcileMerges(merged); tick(0); assert.strictEqual(banners.children.length, 1, 'reload after delivery does not repeat the banner'); +assert.strictEqual(flights().length, 0, 'reload after delivery does not repeat the bee'); +tick(STAGE_TRACKER_CELEBRATE_FLY_MS * 1.5 + 10); assert.strictEqual(zaps.length, 1, 'ledger + audit + reload do not repeat the counter tick'); // Delivered identity outlives the server's recent-history window, even // if a stale open snapshot resurfaces after another reload. From 18dcbc1962b967cbb3ca2e4700a830e7bf67723e Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 18:12:56 -0400 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=90=9B=20fix:=20load=20tracker=20cons?= =?UTF-8?q?tants=20from=20split=20row=20source=20in=20nav=20delta=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nav_count_delta.test.js still read STAGE_TRACKER_ACTED_FILTERS from tracker-row.js, which #15771 moved to tracker-row-acted.js, and did not stub stageTrackerReconcileMerges that renderStageTracker now calls. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/pkg/dashboard/nav_count_delta.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/dashboard/nav_count_delta.test.js b/src/pkg/dashboard/nav_count_delta.test.js index b226c2163e..ce25ebee22 100644 --- a/src/pkg/dashboard/nav_count_delta.test.js +++ b/src/pkg/dashboard/nav_count_delta.test.js @@ -47,6 +47,7 @@ function load() { function fetchBeadSynthStatus() {} function fetchFactHistory() {} function stageTrackerNoteMerges() {} + function stageTrackerReconcileMerges() {} function stageTrackerNoteOpened() {} function stageTrackerNoteMoves() {} function stageTrackerSyncToolbar() {} @@ -78,7 +79,7 @@ function load() { for (const name of names) vm.runInContext(fn(file, name), ctx); } for (const name of ['STAGE_TRACKER_AGE_MS', 'STAGE_TRACKER_SORTS', 'STAGE_TRACKER_ACTED_FILTERS', 'STAGE_TRACKER_PAGE_SIZES', 'STAGE_TRACKER_DEFAULT_PAGE_SIZE', 'STAGE_TRACKER_ATTENTION_STAGES']) { - const declaration = source(name === 'STAGE_TRACKER_ACTED_FILTERS' ? 'tracker-row' : 'tracker-words-stage').match(new RegExp('const ' + name + ' = [^\\n]+')); + const declaration = source(name === 'STAGE_TRACKER_ACTED_FILTERS' ? 'tracker-row-acted' : 'tracker-words-stage').match(new RegExp('const ' + name + ' = [^\\n]+')); assert.ok(declaration, name); vm.runInContext(declaration[0], ctx); } From d49b8467d340ae69dc5b8d61db09f3c668303b5b Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 19:40:52 -0400 Subject: [PATCH 5/5] fix: trim merge-session changelog/docs and dedupe test fixture lines Address review findings on #15892: - changelog fragment and activity-monitor doc describe only what this PR adds (reload-safe once-only delivery via hive.tracker.merge-session.v1, vanished-row short-name resolution, countdown cancel on banner eviction); the countdown bar itself landed in #15880 - doc notes the banner lifetime is twice the configured toast_info_s - drop duplicate jsFunc/matches/contains lines left by the rebase in stage_tracker_cues_test.go - hoist the session PR-key regex into STAGE_TRACKER_MERGE_SESSION_PR_KEY_RE Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- changelog.d/fixed-15828-merge-session-countdown.md | 2 +- src/docs/dashboard-sections/activity-monitor.md | 2 +- src/pkg/dashboard/stage_tracker_cues_test.go | 5 +---- src/pkg/dashboard/static-src/js/tracker-merged.js | 6 ++++-- src/pkg/dashboard/static/index.html | 6 ++++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/changelog.d/fixed-15828-merge-session-countdown.md b/changelog.d/fixed-15828-merge-session-countdown.md index 9a219bb4d2..d056a69090 100644 --- a/changelog.d/fixed-15828-merge-session-countdown.md +++ b/changelog.d/fixed-15828-merge-session-countdown.md @@ -1 +1 @@ -- Activity monitor merge notifications survive reloads without replaying delivered merges, resolve audit events for vanished rows, and show a countdown bar using the configured banner lifetime. +- Activity monitor merge notifications survive reloads without replaying delivered merges, resolve audit events for vanished rows, and cancel their countdown when evicted from the banner stack. diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index 58017f982d..a54de68fbb 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -453,7 +453,7 @@ A thin bar at the top of the tracker — it stays pinned under the card header w **Click the chip** for a popover of the recent merges — number (linked), title, *by hive* / *by @login*, lane, time — and the 30-day total; it is also where a merged row's trace lives once the row has left. When a PR on the list merges its row does **not** simply vanish on the next refresh: it stays pinned for about 3.5 s, its ✓ cell glows amber, the event line reads *Hive: merged #14947 · by hive*, and — in the operator's words — "an animation originates from the item's row where the check mark is and flies up to the top of the browser border; if the Merged pill is visible the animation stops there, if not we just see it go off the screen": a 🐝 (or **+1**, ⚙ → Merges → *Glyph*, `hive.tracker.celebrate_glyph`) rises out of the ✓ cell for ≈2 s on an ease-out with a slight arc, lands on the chip when the chip's box is inside the viewport (the count rolls up like a mileage odometer — each digit that rose slides up through the digits it passes over ≈0.9 s — with a soft scale-pop, and the merge zap, when sound is on, plays as it lands) or exits through the top edge otherwise (the count still rolls). -On a change only the wheels whose digit changed roll (the rightmost always spins a full turn, carry wheels roll too); the others keep their cell. *N today · N this week* roll the same way, drawn plain; a number that falls (today → 0 at midnight), the first draw after a reload (the tab's last values are remembered in `sessionStorage`, so a reload rolls up from them), and reduced motion swap instantly and the drum stays — the odometer look is the resting state, not an effect of the roll ("where is my odometer look and feel?", after #15409 had sized only the flying bee and drawn the roll as a 900 ms overlay over plain text). The pill's width never changes mid-roll (the drum's cells set it). The roll waits for the bee: while a glyph is in the air nothing on the drum moves — not the day/week line, not a total the server has already raised, not a merge over the flight cap — and the moment the last glyph lands (its `animationend`, or a timer at the flight's length when the event never fires) the drum rolls once to the final numbers and the zap plays; several merges in one flight are one roll, not a queue (#15568: "the odometer should roll only after the bee animation finishes so it looks correlated"). It works at any scroll position (`position: fixed`, `pointer-events: none`). At the same moment a **banner** appears at the bottom right — *✓ #15067 merged — fix: enable bulk delegation… (adopted, by hive, 17:42)* — and stays until dismissed or 30 s, stacked (newest at the bottom, at most five) when several merge together, with **Show row** (scrolls to the row and glows it again; once the row has left, says so and opens the list), **Open on GitHub** and **All merges**. +On a change only the wheels whose digit changed roll (the rightmost always spins a full turn, carry wheels roll too); the others keep their cell. *N today · N this week* roll the same way, drawn plain; a number that falls (today → 0 at midnight), the first draw after a reload (the tab's last values are remembered in `sessionStorage`, so a reload rolls up from them), and reduced motion swap instantly and the drum stays — the odometer look is the resting state, not an effect of the roll ("where is my odometer look and feel?", after #15409 had sized only the flying bee and drawn the roll as a 900 ms overlay over plain text). The pill's width never changes mid-roll (the drum's cells set it). The roll waits for the bee: while a glyph is in the air nothing on the drum moves — not the day/week line, not a total the server has already raised, not a merge over the flight cap — and the moment the last glyph lands (its `animationend`, or a timer at the flight's length when the event never fires) the drum rolls once to the final numbers and the zap plays; several merges in one flight are one roll, not a queue (#15568: "the odometer should roll only after the bee animation finishes so it looks correlated"). It works at any scroll position (`position: fixed`, `pointer-events: none`). At the same moment a **banner** appears at the bottom right — *✓ #15067 merged — fix: enable bulk delegation… (adopted, by hive, 17:42)* — and stays until dismissed or for twice the configured `toast_info_s` (30 s at the default), draining a countdown bar along its bottom edge, stacked (newest at the bottom, at most five) when several merge together — a banner pushed out of the stack stops its countdown — with **Show row** (scrolls to the row and glows it again; once the row has left, says so and opens the list), **Open on GitHub** and **All merges**. Merge detection survives a reload: the last observed PR states and the merges already announced are kept in `sessionStorage` (`hive.tracker.merge-session.v1`), so an open → merged transition that straddles a reload is still announced, and each merge is announced exactly once per tab. Several merges in one refresh stagger 200 ms apart with at most three glyphs in flight (the rest bump the count without flying); a merged PR that is filtered out or on another page still counts and still gets its banner. Under reduced motion nothing flies: the glyph fades in place, the count bumps, the row glows, the banners appear without sliding. A PR drawn inline on its issue's row (the usual case — one covering PR, no sub-row) celebrates on that issue row: every row stamps the PR keys it draws (`data-ham-prs`) and the SPA remembers each PR's host row from the last payload, so the flight has somewhere to start from even when the merge also closes the issue. diff --git a/src/pkg/dashboard/stage_tracker_cues_test.go b/src/pkg/dashboard/stage_tracker_cues_test.go index f4ea56b4df..d5c24f5d26 100644 --- a/src/pkg/dashboard/stage_tracker_cues_test.go +++ b/src/pkg/dashboard/stage_tracker_cues_test.go @@ -362,8 +362,6 @@ func stageTrackerCelebrateJS(t *testing.T, html string) string { jsFunc(t, html, "toastCountdownBar"), jsFunc(t, html, "toastCountdownCancel"), jsFunc(t, html, "stageTrackerMergeBanner"), - jsFunc(t, html, "toastCountdownBar"), - jsFunc(t, html, "toastCountdownCancel"), jsFunc(t, html, "stageTrackerMergeBannerDismiss"), jsFunc(t, html, "hamBannerDismiss"), jsFunc(t, html, "hamBannerShowRow"), @@ -376,6 +374,7 @@ func stageTrackerCelebrateJS(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerAfter"), jsFunc(t, html, "stageTrackerTransient"), jsConstLine(t, html, "STAGE_TRACKER_MERGE_SESSION_KEY"), + jsConstLine(t, html, "STAGE_TRACKER_MERGE_SESSION_PR_KEY_RE"), "var _stageTrackerMergeSessionLoaded = false;", jsFunc(t, html, "stageTrackerReconcileMerges"), jsFunc(t, html, "stageTrackerNoteMerges"), @@ -423,8 +422,6 @@ function el(tag, attrs) { get outerHTML() { return '
'; }, querySelector(sel) { return e.querySelectorAll(sel)[0] || null; }, querySelectorAll(sel) { const out = []; const unesc = v => v.replace(/\\(.)/g, '$1'); const m = sel.match(/^\[([\w-]+)="(.*)"\]$/); const word = sel.match(/^\[([\w-]+)~="(.*)"\]\[data-ham-key\]$/); const cls = sel.match(/^\.([\w-]+)/); const capOfRow = sel === '.ham-row[data-ham-key] .ham-seg.cap'; const walk = n => { for (const c of n.children) { if (capOfRow) { if (c.classList.contains('cap') && c.closest('.ham-row') && c.closest('.ham-row').classList.contains('ham-row')) out.push(c); } else if (m && c.attrs[m[1]] === unesc(m[2])) out.push(c); else if (word && c.attrs['data-ham-key'] != null && String(c.attrs[word[1]] || '').split(' ').includes(unesc(word[2]))) out.push(c); else if (!m && !word && cls && c.classList.contains(cls[1]) && (!sel.includes('[data-at]') || c.attrs['data-at'] != null)) out.push(c); walk(c); } }; walk(e); return out; }, - matches() { return false; }, - contains(node) { return node === e || e.children.some(c => c.contains(node)); }, closest(sel) { let n = e; while (n) { if (n.attrs && n.attrs['data-ham-key'] != null) return n; n = n.parentNode; } return null; }, matches() { return false; }, contains(x) { return x === e || e.children.some(c => c.contains(x)); }, }; diff --git a/src/pkg/dashboard/static-src/js/tracker-merged.js b/src/pkg/dashboard/static-src/js/tracker-merged.js index 40715a6a8c..6623b87ffb 100644 --- a/src/pkg/dashboard/static-src/js/tracker-merged.js +++ b/src/pkg/dashboard/static-src/js/tracker-merged.js @@ -55,6 +55,8 @@ } const STAGE_TRACKER_MERGE_SESSION_KEY = 'hive.tracker.merge-session.v1'; + // Shape of a stageTrackerPRKey() key as stored in the session record. + const STAGE_TRACKER_MERGE_SESSION_PR_KEY_RE = /^.+\/pr#[1-9][0-9]*$/; var _stageTrackerMergeSessionLoaded = false; // Persist both the last observation and the delivered keys: saving only // delivered keys loses an open→merged transition across a reload. The @@ -67,11 +69,11 @@ if (saved && saved.state && typeof saved.state === 'object' && !Array.isArray(saved.state)) { const state = {}, delivered = {}; for (const key of Object.keys(saved.state)) { - if (!/^.+\/pr#[1-9][0-9]*$/.test(key) || typeof saved.state[key] !== 'boolean') continue; + if (!STAGE_TRACKER_MERGE_SESSION_PR_KEY_RE.test(key) || typeof saved.state[key] !== 'boolean') continue; state[key] = saved.state[key]; } for (const key of Object.keys(saved.delivered || {})) { - if (/^.+\/pr#[1-9][0-9]*$/.test(key) && saved.delivered[key] === true) delivered[key] = true; + if (STAGE_TRACKER_MERGE_SESSION_PR_KEY_RE.test(key) && saved.delivered[key] === true) delivered[key] = true; } _stageTrackerMergeState = state; _stageTrackerZapped = delivered; diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index b43b846ac6..788e461254 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -22033,6 +22033,8 @@

All labels

} const STAGE_TRACKER_MERGE_SESSION_KEY = 'hive.tracker.merge-session.v1'; + // Shape of a stageTrackerPRKey() key as stored in the session record. + const STAGE_TRACKER_MERGE_SESSION_PR_KEY_RE = /^.+\/pr#[1-9][0-9]*$/; var _stageTrackerMergeSessionLoaded = false; // Persist both the last observation and the delivered keys: saving only // delivered keys loses an open→merged transition across a reload. The @@ -22045,11 +22047,11 @@

All labels

if (saved && saved.state && typeof saved.state === 'object' && !Array.isArray(saved.state)) { const state = {}, delivered = {}; for (const key of Object.keys(saved.state)) { - if (!/^.+\/pr#[1-9][0-9]*$/.test(key) || typeof saved.state[key] !== 'boolean') continue; + if (!STAGE_TRACKER_MERGE_SESSION_PR_KEY_RE.test(key) || typeof saved.state[key] !== 'boolean') continue; state[key] = saved.state[key]; } for (const key of Object.keys(saved.delivered || {})) { - if (/^.+\/pr#[1-9][0-9]*$/.test(key) && saved.delivered[key] === true) delivered[key] = true; + if (STAGE_TRACKER_MERGE_SESSION_PR_KEY_RE.test(key) && saved.delivered[key] === true) delivered[key] = true; } _stageTrackerMergeState = state; _stageTrackerZapped = delivered;