diff --git a/changelog.d/changed-activity-monitor-base-pill-by-repo-chip.md b/changelog.d/changed-activity-monitor-base-pill-by-repo-chip.md new file mode 100644 index 0000000000..59402ac43c --- /dev/null +++ b/changelog.d/changed-activity-monitor-base-pill-by-repo-chip.md @@ -0,0 +1 @@ +- Activity Monitor rows now draw a PR's base-branch pill (`v5`, `main`) right after the repo chip at the head of the row, before the issue number, instead of in the right-hand modifier cluster; the pill names its PR on hover ("PR #N targets v5") and rows with no linked PR show none. ([#16620](https://github.com/hivecommons/hive/issues/16620)) diff --git a/src/pkg/dashboard/stage_tracker_header_spans.test.js b/src/pkg/dashboard/stage_tracker_header_spans.test.js index 2bdc9a9dcc..7994a82e8e 100644 --- a/src/pkg/dashboard/stage_tracker_header_spans.test.js +++ b/src/pkg/dashboard/stage_tracker_header_spans.test.js @@ -28,7 +28,7 @@ function load() { stageTrackerIcon: (kind, cls) => ``, stageTrackerRepoChipHtml: () => '', stageTrackerTooltip: () => 'tooltip', - stageTrackerPRPillsHtml: ref => `${ref}base v5`, + stageTrackerPRPillsHtml: ref => `${ref}`, stageTrackerActedBadgeHtml: () => '', stageTrackerChipsHtml: () => chips, stageTrackerMoveAttrs: () => '', @@ -42,7 +42,7 @@ function load() { vm.runInContext(pick(new RegExp('const ' + name + ' = [^\\n]*'), name), ctx); } for (const name of ['stageTrackerHeadColsHtml', 'stageTrackerHeaderHtml', 'stageTrackerRowHtml', 'stageTrackerSubRowHtml', - 'stageTrackerPRRef', 'stageTrackerPRIssueSlot', 'stageTrackerTitleHtml', 'stageTrackerSplitTitleTag']) { + 'stageTrackerPRRef', 'stageTrackerPRIssueSlot', 'stageTrackerTitleHtml', 'stageTrackerSplitTitleTag', 'stageTrackerBasePillHtml']) { vm.runInContext(fn(name), ctx); } return ctx; diff --git a/src/pkg/dashboard/stage_tracker_human_attention.test.js b/src/pkg/dashboard/stage_tracker_human_attention.test.js index 31a3812cf3..14808199cd 100644 --- a/src/pkg/dashboard/stage_tracker_human_attention.test.js +++ b/src/pkg/dashboard/stage_tracker_human_attention.test.js @@ -38,7 +38,7 @@ function load() { }); for (const name of ['stageTrackerLinkedSuperseder', 'stageTrackerLinkedSupersededGone', 'stageTrackerLinkedSupersededText', 'stageTrackerLinkedSupersededTip']) vm.runInContext(fn('tracker-words-gate', name), c); for (const name of ['stageTrackerItemKey', 'stageTrackerPRKey', 'stageTrackerRowPRKeys']) vm.runInContext(fn('tracker-merged', name), c); - for (const name of ['stageTrackerLinkedPRItem', 'stageTrackerLinkedPROpen', 'stageTrackerLinkedDrawnHere', 'stageTrackerLinkedSorted', 'stageTrackerHeadColsHtml', 'stageTrackerSubRowHtml']) vm.runInContext(fn('tracker-row-layout', name), c); + for (const name of ['stageTrackerLinkedPRItem', 'stageTrackerLinkedPROpen', 'stageTrackerLinkedDrawnHere', 'stageTrackerLinkedSorted', 'stageTrackerHeadColsHtml', 'stageTrackerSubRowHtml', 'stageTrackerBasePillHtml']) vm.runInContext(fn('tracker-row-layout', name), c); vm.runInContext(fn('tracker-row-render', 'stageTrackerRowHtml'), c); vm.runInContext(fn('tracker-filter', 'stageTrackerPRIssueSlot'), c); vm.runInContext(source('tracker-human-attention'), c); diff --git a/src/pkg/dashboard/stage_tracker_motion_test.go b/src/pkg/dashboard/stage_tracker_motion_test.go index 4303ddbc9a..2ff3753df8 100644 --- a/src/pkg/dashboard/stage_tracker_motion_test.go +++ b/src/pkg/dashboard/stage_tracker_motion_test.go @@ -456,6 +456,7 @@ func TestStageTrackerMotionRowStamp(t *testing.T) { stageTrackerActedJS(t, html), jsFunc(t, html, "stageTrackerSubRowHtml"), jsFunc(t, html, "stageTrackerPRPillsHtml"), + jsFunc(t, html, "stageTrackerBasePillHtml"), jsFunc(t, html, "stageTrackerLinkedPRItem"), jsFunc(t, html, "stageTrackerLinkedPROpen"), jsFunc(t, html, "stageTrackerNestedOpenPRs"), @@ -590,6 +591,7 @@ func TestStageTrackerMotionPreviewSample(t *testing.T) { stageTrackerActedJS(t, html), jsFunc(t, html, "stageTrackerSubRowHtml"), jsFunc(t, html, "stageTrackerPRPillsHtml"), + jsFunc(t, html, "stageTrackerBasePillHtml"), jsFunc(t, html, "stageTrackerLinkedPRItem"), jsFunc(t, html, "stageTrackerLinkedPROpen"), jsFunc(t, html, "stageTrackerNestedOpenPRs"), diff --git a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js index 5fabcc1322..f7a0b9a932 100644 --- a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js +++ b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js @@ -52,7 +52,7 @@ function load() { for (const name of ['stageTrackerTrainIconHtml', 'stageTrackerTrainAccentClass', 'stageTrackerOrdinal']) vm.runInContext(fn('tracker-words-core', name), ctx); for (const name of ['stageTrackerLinkedSuperseder', 'stageTrackerLinkedSupersededGone', 'stageTrackerLinkedSupersededText', 'stageTrackerLinkedSupersededTip']) vm.runInContext(fn('tracker-words-gate', name), ctx); for (const name of ['stageTrackerPRKey', 'stageTrackerItemKey', 'stageTrackerRowPRKeys']) vm.runInContext(fn('tracker-merged', name), ctx); - for (const name of ['stageTrackerLinkedPRItem', 'stageTrackerLinkedPROpen', 'stageTrackerLinkedDrawnHere', 'stageTrackerLinkedSorted', 'stageTrackerAdoptOrphanPRs', 'stageTrackerHeadColsHtml', 'stageTrackerSubRowHtml']) vm.runInContext(fn('tracker-row-layout', name), ctx); + for (const name of ['stageTrackerLinkedPRItem', 'stageTrackerLinkedPROpen', 'stageTrackerLinkedDrawnHere', 'stageTrackerLinkedSorted', 'stageTrackerAdoptOrphanPRs', 'stageTrackerHeadColsHtml', 'stageTrackerSubRowHtml', 'stageTrackerBasePillHtml']) vm.runInContext(fn('tracker-row-layout', name), ctx); vm.runInContext(fn('tracker-row-render', 'stageTrackerRowHtml'), ctx); for (const name of ['stageTrackerPreparationWord', 'stageTrackerPreparationAge', 'stageTrackerPreparationChipHtml']) vm.runInContext(fn('tracker-queue', name), ctx); for (const name of ['stageTrackerSort', 'stageTrackerPage', 'stageTrackerPRIssueSlot']) vm.runInContext(fn('tracker-filter', name), ctx); diff --git a/src/pkg/dashboard/stage_tracker_repo_grouping_test.go b/src/pkg/dashboard/stage_tracker_repo_grouping_test.go index be70f59325..6ba3f52f2c 100644 --- a/src/pkg/dashboard/stage_tracker_repo_grouping_test.go +++ b/src/pkg/dashboard/stage_tracker_repo_grouping_test.go @@ -172,6 +172,7 @@ func stageTrackerRepoGroupingHarness(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerSinceHtml"), jsFunc(t, html, "stageTrackerSubRowHtml"), jsFunc(t, html, "stageTrackerPRPillsHtml"), + jsFunc(t, html, "stageTrackerBasePillHtml"), jsFunc(t, html, "stageTrackerLinkedPRItem"), jsFunc(t, html, "stageTrackerLinkedPROpen"), jsFunc(t, html, "stageTrackerNestedOpenPRs"), diff --git a/src/pkg/dashboard/stage_tracker_single_note.test.js b/src/pkg/dashboard/stage_tracker_single_note.test.js index 408c03f461..81c541de56 100644 --- a/src/pkg/dashboard/stage_tracker_single_note.test.js +++ b/src/pkg/dashboard/stage_tracker_single_note.test.js @@ -53,7 +53,7 @@ function load() { vm.runInContext(fn('tracker-words-stage', 'stageTrackerStageName'), c); for (const name of ['stageTrackerLinkedSuperseder', 'stageTrackerLinkedSupersededGone', 'stageTrackerLinkedSupersededText', 'stageTrackerLinkedSupersededTip']) vm.runInContext(fn('tracker-words-gate', name), c); for (const name of ['stageTrackerItemKey', 'stageTrackerPRKey', 'stageTrackerRowPRKeys']) vm.runInContext(fn('tracker-merged', name), c); - for (const name of ['stageTrackerLinkedPRItem', 'stageTrackerLinkedPROpen', 'stageTrackerLinkedDrawnHere', 'stageTrackerLinkedSorted', 'stageTrackerHeadColsHtml', 'stageTrackerSubRowHtml']) vm.runInContext(fn('tracker-row-layout', name), c); + for (const name of ['stageTrackerLinkedPRItem', 'stageTrackerLinkedPROpen', 'stageTrackerLinkedDrawnHere', 'stageTrackerLinkedSorted', 'stageTrackerHeadColsHtml', 'stageTrackerSubRowHtml', 'stageTrackerBasePillHtml']) vm.runInContext(fn('tracker-row-layout', name), c); vm.runInContext(fn('tracker-row-render', 'stageTrackerRowHtml'), c); vm.runInContext(fn('tracker-filter', 'stageTrackerPRIssueSlot'), c); vm.runInContext(source('tracker-motion'), c); diff --git a/src/pkg/dashboard/stage_tracker_ui_prelude_test.go b/src/pkg/dashboard/stage_tracker_ui_prelude_test.go index 0bd1189921..039227d542 100644 --- a/src/pkg/dashboard/stage_tracker_ui_prelude_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_prelude_test.go @@ -134,6 +134,7 @@ func stageTrackerRowsPreludeJS(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerSinceHtml"), jsFunc(t, html, "stageTrackerSubRowHtml"), jsFunc(t, html, "stageTrackerPRPillsHtml"), + jsFunc(t, html, "stageTrackerBasePillHtml"), jsFunc(t, html, "stageTrackerAgoText"), jsConstBlock(t, html, "STAGE_TRACKER_LINEAGE_REASON_TIP"), jsFunc(t, html, "stageTrackerLineageText"), diff --git a/src/pkg/dashboard/stage_tracker_ui_rows_test.go b/src/pkg/dashboard/stage_tracker_ui_rows_test.go index 6797a4091d..6a23eb6605 100644 --- a/src/pkg/dashboard/stage_tracker_ui_rows_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_rows_test.go @@ -461,7 +461,15 @@ assert.ok(!row.includes('ham-issue-refs-chip'), 'closing link draws no refs chip row = stageTrackerRowHtml({ repo: 'acme/console', number: 9, kind: 'issue', title: 'Tracker', stage: 40, claim_reference: true, is_tracker: true, children: { total: 3, completed: 1 }, linked_prs: [{ number: 203, title: 'Draft work', stage: 10, base_ref: 'v6' }] }, stages, ctx); assert.ok(row.includes('refs'), 'issue refs chip: ' + row); assert.ok(row.includes('tracker 1/3'), 'tracker progress: ' + row); -assert.ok(row.includes('v6'), 'covering PR base: ' + row); +// The base pill sits at the row head by the repo chip, before the issue #N, +// with the PR it describes in its tooltip — not in the PR column's cluster. +assert.ok(row.includes('v6'), 'covering PR base pill: ' + row); +assert.ok(row.indexOf('ham-base-pill') < row.indexOf('>#9'), 'base pill precedes the issue ref: ' + row); +assert.ok(!row.includes('v6'), 'base no longer a right-hand badge: ' + row); +assert.ok(!row.slice(row.indexOf('ham-head-pr'), row.indexOf('ham-since')).includes('>v6<'), 'base absent from the PR column: ' + row); +// No PR, no pill; a PR row carries its own base. +assert.ok(!stageTrackerRowHtml({ repo: 'acme/console', number: 10, kind: 'issue', title: 'Bare', stage: 10 }, stages, ctx).includes('ham-base-pill'), 'no PR → no base pill'); +assert.ok(stageTrackerRowHtml({ repo: 'acme/console', number: 204, kind: 'pr', title: 'Own row', stage: 60, base_ref: 'v5' }, stages, ctx).includes('v5'), 'PR row base pill'); // 040 shares the PR in progress column with 030; the chevron tooltip names the real stage. row = stageTrackerRowHtml({ repo: 'acme/console', number: 9, kind: 'issue', title: 'Ordering drifts', stage: 40, linked_prs: [{ number: 103, title: 'Backport', author_kind: 'clanker', stage: 30 }, { number: 102, title: 'Fix it', url: 'u', author_kind: 'human', stage: 70, stage_since: new Date(now - 3600000).toISOString(), modifiers: ['needs-rebase'], caption: 'Rebasing onto main' }] }, stages, ctx); @@ -493,23 +501,24 @@ sr = subs(row); const cell = (head.match(/
  • ]*>([\s\S]*?)<\/li>/) || [])[1] || ''; assert.ok(cell, 'sub-row header has one PR cell: ' + head); assert.ok(!/v5')]; - assert.ok(order.every((i, k) => i >= 0 && (k === 0 || i > order[k - 1])), 'connector, PR link, lineage chip, base pill in that order as siblings: ' + cell); - assert.ok(cell.indexOf('v5') > cell.indexOf('', cell.indexOf('v5'), cell.indexOf(' i >= 0 && (k === 0 || i > order[k - 1])), 'connector, base pill, PR link, lineage chip in that order as siblings: ' + cell); + assert.ok(!cell.includes('v5'), 'the base is no longer a trailing badge: ' + cell); assert.ok(/]*title="docs: remove duplicate README run routes · /.test(cell), 'the PR link hover starts with the full title: ' + cell); assert.ok(!head.includes('ham-lineage" title') || head.indexOf('ham-lineage') < head.indexOf(''), 'the lineage chip rides the PR cell ahead of the modifier chips, not the chip toolbar: ' + head); assert.strictEqual((head.match(/ham-lineage/g) || []).length, 1, 'the lineage chip is drawn once'); } // The same order on an issue row with a single covering PR: lineage chip -// before the base pill, both after the PR link. +// after the PR link; the base pill leads the row by the repo chip instead. row = stageTrackerRowHtml({ repo: 'acme/console', number: 9, kind: 'issue', title: 'One PR', stage: 40, linked_prs: [{ number: 15343, title: 'T', stage: 50, base_ref: 'v5', lineage: { kind: 'adopted', from_number: 15226 } }] }, stages, ctx); { const cell = prCell(row); - assert.ok(cell.indexOf('v5'), 'PR link, lineage, base pill: ' + cell); + assert.ok(cell.indexOf('v5'), 'PR link, lineage; no base pill in the PR cell: ' + cell); + assert.ok(row.indexOf('v5') < row.indexOf('>#9'), 'base pill ahead of the issue ref: ' + row); } // An incomplete lineage has no chip and must not add an extra separator. row = stageTrackerRowHtml({ repo: 'acme/console', number: 9, kind: 'issue', title: 'Empty lineage', stage: 40, linked_prs: [{ number: 15343, title: 'T', stage: 50, base_ref: 'v5', lineage: { kind: 'adopted' } }] }, stages, ctx); -assert.match(prCell(row), /<\/a> v5<\/span>/, 'empty lineage leaves one separator before the base pill'); +assert.match(prCell(row), /<\/a>/, 'empty lineage leaves no stray separator after the PR link'); assert.ok(!prCell(row).includes('ham-lineage'), 'empty lineage renders no chip'); row = stageTrackerRowHtml({ repo: 'acme/console', number: 10, kind: 'issue', stage: 30 }, stages, ctx); assert.deepStrictEqual(segStates(row), [D, D, D, 'active', T, T, 'todo cap'], 'kick running, no PR yet: the issue lights PR in progress and draws the steps ahead'); diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 0e16ece3c5..cc2af4a9ee 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -178,6 +178,8 @@ .ham-repo-tint-4 { --ham-repo-tint: var(--ham-repo-tint-4); } .ham-repo-tint-5 { --ham-repo-tint: var(--ham-repo-tint-5); } .ham-repo-chip.ham-repo-primary { --ham-repo-tint: var(--text-muted); } + /* The PR's base branch: same height and type as the repo chip it follows, muted border, no tint. */ + .ham-base-pill { flex: 0 0 auto; display: inline-block; font: inherit; font-family: var(--font-mono); font-size: var(--fs-2xs); line-height: 1.5; padding: 0 var(--sp-2); border-radius: var(--r-sm); border: var(--line-width) solid var(--line-subtle); color: var(--text-faint); white-space: nowrap; max-width: 9em; overflow: hidden; text-overflow: ellipsis; vertical-align: baseline; } .ham-pr-line { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; max-width: 100%; overflow: hidden; } /* Group-by-repo header row: sticky under the column header while its rows scroll, caret toggle, chip, owner/repo, counts, and a mini diff --git a/src/pkg/dashboard/static-src/js/tracker-row-layout.js b/src/pkg/dashboard/static-src/js/tracker-row-layout.js index b4a6b966a6..b9180ec911 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-layout.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-layout.js @@ -219,9 +219,18 @@ ctx.rows = typeof _stageTrackerRows !== 'undefined' ? _stageTrackerRows : null; return stageTrackerLeadActionHtml(item, ctx, subRows); } - // PR link, then the lineage chip (null = none), then the base pill. - function stageTrackerPRPillsHtml(ref, lineage, baseRef) { - return ref + (lineage == null ? '' : ' ' + lineage) + (baseRef ? ` ${esc(baseRef)}` : ''); + // PR link, then the lineage chip (null = none). The base pill sits by + // the repo chip at the row's head (stageTrackerBasePillHtml), not here. + function stageTrackerPRPillsHtml(ref, lineage) { + return ref + (lineage == null ? '' : ' ' + lineage); + } + // Pure: the PR's base branch as a quiet sibling of the repo chip — + // `[hive][v5] #16603 …` — so the target reads with the repo, not in the + // right-hand modifier cluster. '' when the row has no PR (or no base). + function stageTrackerBasePillHtml(baseRef, prNumber) { + if (!baseRef) return ''; + const tip = (Number(prNumber) ? 'PR #' + Number(prNumber) + ' targets ' : 'Targets ') + baseRef; + return `${esc(baseRef)}`; } function stageTrackerSubRowHtml(lp, issue, stages, nowMs, ctx) { const pr = stageTrackerLinkedPRItem(issue, lp); @@ -233,9 +242,9 @@ // A superseded original wears neither pill — it closes as superseded, // not as the closer of anything. const lineage = superseded ? '' : ((typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(pr, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(pr, nowMs) : '')); - const chip = ctx && ctx.repoChips ? stageTrackerRepoChipHtml(pr.repo, ctx) : ''; + const chip = (ctx && ctx.repoChips ? stageTrackerRepoChipHtml(pr.repo, ctx) : '') + stageTrackerBasePillHtml(lp.base_ref, pr.number); if (chip) ref = `${chip}${ref}`; - ref = stageTrackerPRPillsHtml(ref, !superseded && typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null), lp.base_ref); + ref = stageTrackerPRPillsHtml(ref, !superseded && typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null)); ref = STAGE_TRACKER_LINKED_GLYPH + ref; if (superseded) { // The adopted original: one muted line, no chevron track, no row diff --git a/src/pkg/dashboard/static-src/js/tracker-row-render.js b/src/pkg/dashboard/static-src/js/tracker-row-render.js index 8a24fb30e1..ea32ee88a7 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-render.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-render.js @@ -93,9 +93,11 @@ const nowMs = Number(ctx.nowMs) || Date.now(); const isIssue = item.kind === 'issue'; const title = item.title || ''; - let prRefs = [], shown = item, range = null, subs = '', subRows = null, prTargetKey = ''; + let prRefs = [], shown = item, range = null, subs = '', subRows = null, prTargetKey = '', basePill = ''; if (isIssue) { const linked = stageTrackerLinkedSorted(item, stages); + // The primary (first-sorted) PR's base; an issue with no PR shows none. + if (linked.length) basePill = stageTrackerBasePillHtml(linked[0].base_ref, linked[0].number); if (linked.length === 1) { // One covering PR: a single entry whose strip the PR's stage drives. const lp = linked[0]; @@ -103,7 +105,7 @@ prTargetKey = stageTrackerItemKey(pr); const who = (lp.author_kind || 'hive') + (lp.author ? ' · @' + lp.author : ''); const lineage = (lp.lineage && typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(lp, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(lp, nowMs) : ''); - prRefs = [STAGE_TRACKER_LINKED_GLYPH + stageTrackerPRPillsHtml(stageTrackerPRRef(lp.number, lp.url, lp.author_kind || '', lp.author, lp.title, (lp.title ? lp.title + '\n' : '') + 'Author: ' + who + ' · ' + stageTrackerLinkedTip(item, lp.number, ctx)), typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null), lp.base_ref)]; + prRefs = [STAGE_TRACKER_LINKED_GLYPH + stageTrackerPRPillsHtml(stageTrackerPRRef(lp.number, lp.url, lp.author_kind || '', lp.author, lp.title, (lp.title ? lp.title + '\n' : '') + 'Author: ' + who + ' · ' + stageTrackerLinkedTip(item, lp.number, ctx)), typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null))]; shown = Object.assign({}, item, { via_pr: true, stage: stageTrackerLeadStage(lp), stage_since: lp.stage_since || item.stage_since, modifiers: lp.modifiers || item.modifiers, deferred_modifiers: lp.deferred_modifiers || item.deferred_modifiers || [], caption: lp.caption || item.caption, reason: lp.reason || item.reason, preparation: lp.preparation || null, ci_activity: lp.ci_activity || null, review_activity: lp.review_activity || null, code_activity: lp.code_activity || null, display_column: lp.display_column || 0, terminal_merge: !!lp.terminal_merge, merged_by: lp.merged_by || '', @@ -129,8 +131,10 @@ // as one (hivecommons/hive#15232) — and the PR stays in the PR column // rather than taking the issue slot. A not-planned close adds a chip // saying the PR may be moot. - // The repo chip (when on) leads the row, before the issue slot's #N. - const chip = ctx.repoChips ? stageTrackerRepoChipHtml(item.repo, ctx) : ''; + // The repo chip (when on) leads the row, before the issue slot's #N; + // the PR's base pill follows it as a quieter sibling. + if (!isIssue) basePill = stageTrackerBasePillHtml(item.base_ref, item.number); + const chip = (ctx.repoChips ? stageTrackerRepoChipHtml(item.repo, ctx) : '') + basePill; let leadHtml; if (isIssue) { leadHtml = `
    diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 67eca47315..c6d55193e0 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1518,6 +1518,8 @@ .ham-repo-tint-4 { --ham-repo-tint: var(--ham-repo-tint-4); } .ham-repo-tint-5 { --ham-repo-tint: var(--ham-repo-tint-5); } .ham-repo-chip.ham-repo-primary { --ham-repo-tint: var(--text-muted); } + /* The PR's base branch: same height and type as the repo chip it follows, muted border, no tint. */ + .ham-base-pill { flex: 0 0 auto; display: inline-block; font: inherit; font-family: var(--font-mono); font-size: var(--fs-2xs); line-height: 1.5; padding: 0 var(--sp-2); border-radius: var(--r-sm); border: var(--line-width) solid var(--line-subtle); color: var(--text-faint); white-space: nowrap; max-width: 9em; overflow: hidden; text-overflow: ellipsis; vertical-align: baseline; } .ham-pr-line { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; max-width: 100%; overflow: hidden; } /* Group-by-repo header row: sticky under the column header while its rows scroll, caret toggle, chip, owner/repo, counts, and a mini @@ -19424,9 +19426,18 @@

    Where to get help

    ctx.rows = typeof _stageTrackerRows !== 'undefined' ? _stageTrackerRows : null; return stageTrackerLeadActionHtml(item, ctx, subRows); } - // PR link, then the lineage chip (null = none), then the base pill. - function stageTrackerPRPillsHtml(ref, lineage, baseRef) { - return ref + (lineage == null ? '' : ' ' + lineage) + (baseRef ? ` ${esc(baseRef)}` : ''); + // PR link, then the lineage chip (null = none). The base pill sits by + // the repo chip at the row's head (stageTrackerBasePillHtml), not here. + function stageTrackerPRPillsHtml(ref, lineage) { + return ref + (lineage == null ? '' : ' ' + lineage); + } + // Pure: the PR's base branch as a quiet sibling of the repo chip — + // `[hive][v5] #16603 …` — so the target reads with the repo, not in the + // right-hand modifier cluster. '' when the row has no PR (or no base). + function stageTrackerBasePillHtml(baseRef, prNumber) { + if (!baseRef) return ''; + const tip = (Number(prNumber) ? 'PR #' + Number(prNumber) + ' targets ' : 'Targets ') + baseRef; + return `${esc(baseRef)}`; } function stageTrackerSubRowHtml(lp, issue, stages, nowMs, ctx) { const pr = stageTrackerLinkedPRItem(issue, lp); @@ -19438,9 +19449,9 @@

    Where to get help

    // A superseded original wears neither pill — it closes as superseded, // not as the closer of anything. const lineage = superseded ? '' : ((typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(pr, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(pr, nowMs) : '')); - const chip = ctx && ctx.repoChips ? stageTrackerRepoChipHtml(pr.repo, ctx) : ''; + const chip = (ctx && ctx.repoChips ? stageTrackerRepoChipHtml(pr.repo, ctx) : '') + stageTrackerBasePillHtml(lp.base_ref, pr.number); if (chip) ref = `${chip}${ref}`; - ref = stageTrackerPRPillsHtml(ref, !superseded && typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null), lp.base_ref); + ref = stageTrackerPRPillsHtml(ref, !superseded && typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null)); ref = STAGE_TRACKER_LINKED_GLYPH + ref; if (superseded) { // The adopted original: one muted line, no chevron track, no row @@ -19697,9 +19708,11 @@

    Where to get help

    const nowMs = Number(ctx.nowMs) || Date.now(); const isIssue = item.kind === 'issue'; const title = item.title || ''; - let prRefs = [], shown = item, range = null, subs = '', subRows = null, prTargetKey = ''; + let prRefs = [], shown = item, range = null, subs = '', subRows = null, prTargetKey = '', basePill = ''; if (isIssue) { const linked = stageTrackerLinkedSorted(item, stages); + // The primary (first-sorted) PR's base; an issue with no PR shows none. + if (linked.length) basePill = stageTrackerBasePillHtml(linked[0].base_ref, linked[0].number); if (linked.length === 1) { // One covering PR: a single entry whose strip the PR's stage drives. const lp = linked[0]; @@ -19707,7 +19720,7 @@

    Where to get help

    prTargetKey = stageTrackerItemKey(pr); const who = (lp.author_kind || 'hive') + (lp.author ? ' · @' + lp.author : ''); const lineage = (lp.lineage && typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(lp, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(lp, nowMs) : ''); - prRefs = [STAGE_TRACKER_LINKED_GLYPH + stageTrackerPRPillsHtml(stageTrackerPRRef(lp.number, lp.url, lp.author_kind || '', lp.author, lp.title, (lp.title ? lp.title + '\n' : '') + 'Author: ' + who + ' · ' + stageTrackerLinkedTip(item, lp.number, ctx)), typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null), lp.base_ref)]; + prRefs = [STAGE_TRACKER_LINKED_GLYPH + stageTrackerPRPillsHtml(stageTrackerPRRef(lp.number, lp.url, lp.author_kind || '', lp.author, lp.title, (lp.title ? lp.title + '\n' : '') + 'Author: ' + who + ' · ' + stageTrackerLinkedTip(item, lp.number, ctx)), typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null))]; shown = Object.assign({}, item, { via_pr: true, stage: stageTrackerLeadStage(lp), stage_since: lp.stage_since || item.stage_since, modifiers: lp.modifiers || item.modifiers, deferred_modifiers: lp.deferred_modifiers || item.deferred_modifiers || [], caption: lp.caption || item.caption, reason: lp.reason || item.reason, preparation: lp.preparation || null, ci_activity: lp.ci_activity || null, review_activity: lp.review_activity || null, code_activity: lp.code_activity || null, display_column: lp.display_column || 0, terminal_merge: !!lp.terminal_merge, merged_by: lp.merged_by || '', @@ -19733,8 +19746,10 @@

    Where to get help

    // as one (hivecommons/hive#15232) — and the PR stays in the PR column // rather than taking the issue slot. A not-planned close adds a chip // saying the PR may be moot. - // The repo chip (when on) leads the row, before the issue slot's #N. - const chip = ctx.repoChips ? stageTrackerRepoChipHtml(item.repo, ctx) : ''; + // The repo chip (when on) leads the row, before the issue slot's #N; + // the PR's base pill follows it as a quieter sibling. + if (!isIssue) basePill = stageTrackerBasePillHtml(item.base_ref, item.number); + const chip = (ctx.repoChips ? stageTrackerRepoChipHtml(item.repo, ctx) : '') + basePill; let leadHtml; if (isIssue) { leadHtml = `