Skip to content

πŸ› dashboard: merged toast shows the PR number - #15279

Merged
clubanderson merged 2 commits into
v5from
fix/merged-toast-number
Oct 29, 2026
Merged

clubanderson merged 2 commits into
v5from
fix/merged-toast-number

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15277

Symptom: Activity Monitor merge toasts read βœ“ # merged β€” title and "Open on GitHub" present, number missing (seen for the containment and never-adopt merges).

Root cause: stageTrackerMergeBanner rendered #${esc(info.number)}; info.number is a Number and esc() returns '' for any non-string. The node-harness test stubbed esc as String(s)…, which hid it.

Fix:

  • Pure stageTrackerMergeBannerNumber(b): number as a string from number / pr_number / nested pr.number, else the GitHub URL (/pull/N), else the repo/pr#N key; '' when none.
  • Head reads #15122 merged; with no number anywhere it reads merged β€” never a bare #. "Open on GitHub" is built from the same resolved number.
  • Test stub esc now mirrors the page's; new cases: number only in nested pr, only in URL, empty field β†’ head #15122 merged and the link targets the same PR; no number β†’ no bare #.
  • changelog.d/fixed-merged-toast-number.md.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15219 πŸ› fix: preserve human and owner PRs during delegated decisions same files src/pkg/dashboard/static/index.html
#15186 πŸ› Activity Monitor: one coherent post-decision state for Let hive decide rows; 060 reviewed in CI / Review same files src/pkg/dashboard/static/index.html
#15104 πŸ› Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/pkg/dashboard/stage_tracker_cues_test.go
src/pkg/dashboard/static/index.html
#15253 πŸ› decision toast: issue decisions no longer read as 'approved for merge' same files src/pkg/dashboard/static/index.html
#15281 ✨ tracker: rework pickup signal on the waiting-on chip same files src/pkg/dashboard/static/index.html
#15134 πŸ› Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/pkg/dashboard/static/index.html

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the change against the tree, not just the diff. Looks correct to me.

Root cause confirmed. esc() at src/pkg/dashboard/static/index.html:39773-39774 returns '' for any non-string, and stageTrackerCelebrateMerges (index.html:19698) passes number as a Number, so #${esc(info.number)} at index.html:19816 drew a bare #. The old test stub (stage_tracker_cues_test.go:243, String(s).replace…) did not reproduce that; the new stub mirrors the page, and the new assertions (#1, nested pr.number, URL-only, empty field, no number) would fail against the old banner.

Adjacent fix is warranted. The "Recent merges" popover at index.html:19465-19470 had the same latent blank: txt.today/week/total30d/count are numeric (index.html:19401) and e.number goes through esc() unwrapped. The PR body doesn't mention this part, but it is the same mechanism and the esc(String(…)) pattern already used at index.html:36479 and 54685.

Minor, not a defect: in stageTrackerMergeBanner the recent lookup (index.html:19800) still keys on b.number, so a banner whose number lives only in pr.number/url won't pick up the ledger's title/merged_by. It still links and reads #N merged, which is what the issue asks for.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the tree, not just the diff β€” this looks correct to me.

  • Root cause verified: esc() at src/pkg/dashboard/static/index.html:39774 returns '' for any non-string, and the live caller at index.html:19698-19699 passes number as a Number(...), so the old #${esc(info.number)} could only ever render #. The old test stub (stage_tracker_cues_test.go:243) used String(s), which is exactly why the harness never caught it; mirroring the page's esc in the stub is the right fix.
  • Preview path checked: STAGE_TRACKER_CELEBRATE_TEST_KEY = 'preview/pr#0' (index.html:20309) with number: 0 β€” the new key fallback matches /pr#0 but Number('0') > 0 is false, so the test banner reads merged (test) with no bare #, and no URL is fabricated for it (!info.preview guard kept).
  • The merged-list popover rows (index.html:19443-19449) now wrap e.number, e.repo and the counts in String(), which fixes the same class of drop in the "Recent merges" list β€” a small scope extension beyond the toast, but same bug, same file.

No findings.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

The merge banner rendered #${esc(info.number)} with a Number; the page's
esc() returns '' for any non-string, so the head read a bare "# merged".
Resolve the number as a string (field, nested pr record, GitHub URL, key),
never render a bare "#", and make the node harness's esc stub mirror the
real one so the case is covered.

Fixes #15277

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…n-string drop)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/merged-toast-number branch from 4b9d5c8 to 262cd10 Compare October 29, 2026 03:50

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the fix against the page, not just the diff β€” looks correct to me.

Root cause confirmed. esc() at src/pkg/dashboard/static/index.html:39826 is if (typeof s !== 'string') return '';, and the live caller stageTrackerCelebrateMerges (index.html:19736) passes number as a Number(...), so #${esc(info.number)} really did render # with nothing after it. The old test stub (stage_tracker_cues_test.go:243, String(s).replace…) would never have caught it; the new stub mirrors the page's behaviour, so the regression test now fails without the fix.

Fallback chain checked. stageTrackerMergeBannerNumber β†’ number / pr_number / pr.number β†’ /pull/N in the URL β†’ /pr#N in the key β†’ ''. The preview banner (index.html:20355, key preview/pr#0, number: 0) now resolves to '' and reads merged (test) instead of #0 merged (test) β€” a small, sensible change in the test-celebration head, worth knowing about but not a defect. The "Open on GitHub" link is now built from the same resolved number, so head and link cannot disagree.

The String(...) wrapping in the recent-merges popover (:19501–:19507) fixes the same class of bug for today/week/total30d/count, which were also numeric and would have rendered empty.

No findings. (I can't run go test on this host; the node harness assertions read correctly against the page.)

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@clubanderson
clubanderson merged commit 98636a7 into v5 Oct 29, 2026
81 of 83 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/merged-toast-number branch October 29, 2026 04:04
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#15279262cd10` sha256:2b252835606b4e3f42129bb919780e8fe49b12622e2609013b3b47bdce09137a β€” download from the dashboard or `hivectl review evidence #15279`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/M Denotes a PR that changes 30-99 lines, ignoring generated files. stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dashboard: merged toast title shows a bare "#" instead of the PR number

1 participant