From a2449196b8b5f90b6696ab448adb8950d58d0c24 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 18:25:31 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(dashboard):=20keep=20PR=20ro?= =?UTF-8?q?ws=20visible=20when=20their=20drawn=5Funder=20parent=20is=20fil?= =?UTF-8?q?tered=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A PR that closes several issues is drawn only under the issue named in drawn_under; the other issues show an 'under #M' chip. When that issue was filtered out or paged away, the PR had no strip anywhere. Rows now adopt such PRs: the first listed issue covering one draws it and later ones chip to that row. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../fixed-drawn-under-filtered-parent.md | 1 + .../stage_tracker_actor_icon_test.go | 32 +++++++++++++++++++ src/pkg/dashboard/static/index.html | 29 +++++++++++++++-- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 changelog.d/fixed-drawn-under-filtered-parent.md diff --git a/changelog.d/fixed-drawn-under-filtered-parent.md b/changelog.d/fixed-drawn-under-filtered-parent.md new file mode 100644 index 0000000000..3dddd4269a --- /dev/null +++ b/changelog.d/fixed-drawn-under-filtered-parent.md @@ -0,0 +1 @@ +- Dashboard stage tracker: a PR whose drawn_under issue is filtered out or on another page is now drawn under a listed issue instead of disappearing (#15116). diff --git a/src/pkg/dashboard/stage_tracker_actor_icon_test.go b/src/pkg/dashboard/stage_tracker_actor_icon_test.go index e515f4e7db..2a9cf73c20 100644 --- a/src/pkg/dashboard/stage_tracker_actor_icon_test.go +++ b/src/pkg/dashboard/stage_tracker_actor_icon_test.go @@ -140,6 +140,38 @@ assert.deepStrictEqual(stageTrackerLinkedSorted(issue(14911, [lp(14921, 14910)]) `) } +// A PR drawn under an issue that is filtered out or on another page is drawn +// under the first listed issue that covers it instead of vanishing. +func TestStageTrackerLinkedDrawnUnderHiddenParentJS(t *testing.T) { + html := indexHTML(t) + runStageTrackerRowActionsScript(t, stageTrackerRowsPreludeJS(t, html)+"\n"+stageTrackerActorIconJS(t, html)+jsFunc(t, html, "stageTrackerAdoptOrphanPRs")+stageTrackerRowsFixtureJS+` +const since = new Date(now - 3600000).toISOString(); +const lp = (n, under) => ({ number: n, title: 'fix', url: 'https://x/' + n, author: 'hive-bot', author_kind: 'hive', stage: 70, stage_since: since, drawn_under: under }); +const issue = (n, prs) => ({ repo: 'hivecommons/hive', number: n, kind: 'issue', title: 'Issue ' + n, url: 'https://x/' + n, stage: 40, stage_since: since, caption: 'open PR covers it', linked_prs: prs }); +const hasPR = (row, n) => row.includes('#' + n) && !row.includes('under #'); + +// The owner (#14910) is not on the page: #14911 draws the PR itself. +let rows = stageTrackerAdoptOrphanPRs([issue(14911, [lp(14921, 14910)])]); +let html1 = stageTrackerRowHtml(rows[0], stages, ctx); +assert.ok(hasPR(html1, 14921), 'the PR is drawn when its owner is hidden: ' + html1); +assert.deepStrictEqual(stageTrackerLinkedElsewhere(rows[0]), []); + +// Two listed issues cover it: only the first draws it, the other chips to it. +rows = stageTrackerAdoptOrphanPRs([issue(14911, [lp(14921, 14910)]), issue(14912, [lp(14921, 14910)])]); +assert.strictEqual(rows[0].linked_prs[0].drawn_under, 0); +assert.strictEqual(rows[1].linked_prs[0].drawn_under, 14911); + +// The owner is listed: nothing changes, and inputs are never mutated. +const owner = issue(14910, [lp(14921, 14910)]), other = issue(14911, [lp(14921, 14910)]); +rows = stageTrackerAdoptOrphanPRs([owner, other]); +assert.strictEqual(rows[0], owner); +assert.strictEqual(rows[1], other); +rows = stageTrackerAdoptOrphanPRs([other, null]); +assert.strictEqual(other.linked_prs[0].drawn_under, 14910); +assert.strictEqual(rows[1], null); +`) +} + // The "Merged today" counter lives in the column header, over the Merge // gate and ✓ columns (not in the filter chip bar), so a merge token's flight // from a row's ✓ cell is short and ends above the gate. It is one node for diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 6d8aaea5bc..23f6b8b217 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -15231,6 +15231,30 @@