Repository navigation
🐛 fix: preserve merge notifications across reloads - #15892
Conversation
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: #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 <mendezr@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
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>
There was a problem hiding this comment.
Read the source diff against v5 (tracker-merged.js, tracker-filter-render.js, the Go/Node fixtures) and the bundle hunks in static/index.html. The logic looks correct to me.
Verified
- Exactly-once across reload:
stageTrackerReconcileMerges(static-src/js/tracker-merged.js:61-84) restores both_stageTrackerMergeStateand_stageTrackerZapped.stageTrackerNewlyMerged(:52-55) needsprev[k] === false, so a key saved as merged is never re-announced, andstageTrackerNoteMergesfiltersfreshthrough_stageTrackerZapped(:100), so a delivered open→merged is not replayed. First visit still has_stageTrackerMergeState === null(tracker-actions.js:2233), so history seeds silently as before. - Restore is defensive: keys are validated against
^.+\/pr#[1-9][0-9]*$, non-boolean states dropped, parse/storage errors swallowed (:70-80). Writes go throughtry/catchtoo (:83). - Short-alias resolution from
prev(:11-16) uses the same collision rule as the items loop (:24), so an ambiguous short name still resolves to''and is left alone —TestStageTrackerMergeSoundWiringstill asserts that case. - Every bundle hunk in
static/index.htmlcorresponds 1:1 to astatic-srchunk;toastCountdownCancelexists (tooltips-dialogs.js:782). - The
nav_count_delta.test.js:82fix (tracker-row→tracker-row-acted) is the cause of thebuild-and-testred currently showing on unrelated v5 PRs (e.g. #15820): on v5 headSTAGE_TRACKER_ACTED_FILTERSlives instatic-src/js/tracker-row-acted.js:2. Worth landing for that alone.
Low, non-blocking: stage_tracker_cues_test.go:365-366 adds jsFunc(t, html, "toastCountdownBar") / "toastCountdownCancel" which are already listed two lines above (:362-363), and :426-427 adds matches()/contains() to the el() stub while the next line (:429) already defines both. Harmless to Node (duplicate function declarations and duplicate object keys are legal), but it reads as a rebase artefact — drop one copy if you touch the file again.
Body vs diff: the "contain the bar inside the banner" / tracker.css part of the summary is already on v5 (the toastCountdownBar(el, stageTrackerMergeBannerMs(), …) call is context, not an addition, and this PR touches no CSS). What this PR adds on the banner side is only the toastCountdownCancel on stack eviction (:983). Not a problem, just noting the body predates the rebase.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the diff at 8b41f4e against tracker-merged.js, tracker-actions.js, tooltips-dialogs.js and the generated index.html. Looks correct to me.
What I verified
- Exactly-once across reloads works by construction.
stageTrackerNewlyMerged(tracker-merged.js:54) only reportsnext[k] === true && prev[k] === false. A first visit has an emptyprev, so history seeds silently; after a reload the restoredfalseentry makes an open→merged transition fresh, and the restored_stageTrackerZapped(filtered at:100) keeps already-delivered keys from replaying. Both halves have to be persisted for this to hold, which is whatstageTrackerReconcileMerges(:59-83) does — saving onlydeliveredwould have lost the transition, as the comment says. - Restored keys are validated against
/^.+\/pr#[1-9][0-9]*$/and boolean-typed before use (:70-75); a corrupt or disabledsessionStoragefalls through to the in-memory path. The write at:82is also try-wrapped. stageTrackerMergeState(d, prev)(:7-16) teachesbyShortfrom previous keys using the same single-match/ambiguity rule (''on conflict) the items loop already applies, so a vanished row's short-name audit event still resolves.stageTrackerMergingHoldRelease(:242) now routes through the reconcile wrapper so the hold-release path persists too.- Helpers exist:
toastCountdownBar/toastCountdownCancel(tooltips-dialogs.js:741,:782),stageTrackerMergeBannerMs(tracker-actions.js:1753),var _stageTrackerZapped(tracker-actions.js:2234), all compiled intostatic/index.html. Thestatic-srcand generatedindex.htmlcopies of the new function are byte-identical, and eviction at:983cancels the countdown before removing the oldest banner.
Body vs diff: the Summary says the change also "contain[s] the bar inside the banner", but no CSS file is in this diff. That is because v5 already carries it after the rebase onto #15817/#15830 — tracker.css:576 has position: relative; overflow: hidden on .merge-banner and :577 styles .merge-banner .toast-bar. So the claim is true of the result, just not of this diff; nothing missing.
Minor, not a defect: _stageTrackerMergeState carries every key stageTrackerCarryOpen keeps, so the sessionStorage blob grows for the tab's lifetime. It is per-tab, cleared when the tab closes, and the key is versioned (.v1), so this is fine for now.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
docs-currency (read at head a4be93f, merge-base 726de3c)
-
Changelog fragment and PR title/body claim countdown-bar work this diff does not contain.
changelog.d/fixed-15828-merge-session-countdown.md:1says merge notifications "show a countdown bar using the configured banner lifetime", and the PR title/body say "show countdown" / "Route merge banners through the shared countdown … contain the bar inside the banner". At merge-base,stageTrackerMergeBanneralready callstoastCountdownBar(el, stageTrackerMergeBannerMs(), …)(static-src/js/tracker-merged.js:949),stageTrackerMergeBannerDismissalready callstoastCountdownCancel(el)(:954), andtracker.css:576-577already contains the bar — all landed in #15880 (changelog.d/fixed-15880.md: "merge banners drain the toast countdown bar"). The only countdown change in this diff is thetoastCountdownCancel(box.children[0])on stack eviction (tracker-merged.jshunk @@ -945). Please trim the fragment (and title) to what this PR adds: reload-safe exactly-once merge notifications, vanished-row short-name resolution, and countdown cancel on banner eviction — otherwise the release notes list the same fix twice. -
(advisory, out-of-scope)
src/docs/dashboard-sections/activity-monitor.md:456still says the banner "stays until dismissed or 30 s" (lifetime is configurable since #15824), and the newhive.tracker.merge-session.v1sessionStorage key is undocumented while the doc names its sibling keys (:151,:456). A one-line note that merge banners are delivered once across a reload would keep the page current.
— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
There was a problem hiding this comment.
Style/conventions review (head a4be93f, read against merge-base 726de3c)
-
PR body + changelog claim already-landed work. The summary says this PR "route[s] merge banners through the shared countdown … and contain[s] the bar inside the banner", and
changelog.d/fixed-15828-merge-session-countdown.md:1says merges now "show a countdown bar using the configured banner lifetime". At merge-base,static-src/js/tracker-merged.js:949already callstoastCountdownBar(el, stageTrackerMergeBannerMs(), …),:954already callstoastCountdownCancel(el)instageTrackerMergeBannerDismiss, andstatic-src/css/tracker.css:576already hasposition: relative; overflow: hidden;on.merge-banner. The only countdown change in this diff is the eviction cancel (tracker-merged.js:983at head). Please trim the changelog fragment and PR summary to what this diff adds: session-persisted merge state/delivered keys, short-repo resolution from the previous observation, and cancelling the countdown on stack eviction. -
Rebase leftovers duplicate lines in the test helper.
src/pkg/dashboard/stage_tracker_cues_test.go:365-366re-addjsFunc(t, html, "toastCountdownBar")/"toastCountdownCancel"that already appear at:362-363(the function source is concatenated twice into every Node script).:426-427addmatches()/contains()to the fake-DOM object literal while the identical pair still exists at:429. Drop the second copies.
Minor: the key regex /^.+\/pr#[1-9][0-9]*$/ is written twice in stageTrackerReconcileMerges (tracker-merged.js:70,74); a single named const would keep the two validations from drifting.
— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
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>
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Summary
#15817 (merged) supplied the detached-row bee flight/odometer sequencing; this PR supplies reload-safe exactly-once delivery of merge notifications (including merges arriving via
recently_mergedreconcile, covered by the new test).Tests
make dashboard-genandgofmt -lon the changed Go tests (no formatting findings).— hive: backend=pi model=openai-codex/gpt-6.1-sol
Closes #15828
🐝 Hive Agent:
contributor| SHA:5a39a58b3Supersedes #15854 (adopted contributor PR by @mendezr, author offline): rebased onto
v5resolving the conflicts with #15817/#15830 intracker.css,tracker-filter-render.js,tracker-merged.jsand the generatedindex.html. The rebased range could not be pushed back to the fork — it carries v5 workflow commits and the App token has noworkflowspermission — so the work is re-homed here with the original commits, authorship and sign-off intact.