Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-15451-tracker-row-pill-helper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- fix(dashboard): share the PR link → lineage → base-pill assembly between tracker row renderers; correct the tracker.css shrink-priority comment (#15447, #15451)
2 changes: 2 additions & 0 deletions src/pkg/dashboard/stage_tracker_motion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ func TestStageTrackerMotionRowStamp(t *testing.T) {
jsConstBlock(t, html, "STAGE_TRACKER_ICONS"),
stageTrackerActedJS(t, html),
jsFunc(t, html, "stageTrackerSubRowHtml"),
jsFunc(t, html, "stageTrackerPRPillsHtml"),
jsFunc(t, html, "stageTrackerLinkedPRItem"),
jsFunc(t, html, "stageTrackerLinkedPROpen"),
jsFunc(t, html, "stageTrackerNestedOpenPRs"),
Expand Down Expand Up @@ -572,6 +573,7 @@ func TestStageTrackerMotionPreviewSample(t *testing.T) {
jsFunc(t, html, "stageTrackerSinceHtml"),
stageTrackerActedJS(t, html),
jsFunc(t, html, "stageTrackerSubRowHtml"),
jsFunc(t, html, "stageTrackerPRPillsHtml"),
jsFunc(t, html, "stageTrackerLinkedPRItem"),
jsFunc(t, html, "stageTrackerLinkedPROpen"),
jsFunc(t, html, "stageTrackerNestedOpenPRs"),
Expand Down
1 change: 1 addition & 0 deletions src/pkg/dashboard/stage_tracker_repo_grouping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func stageTrackerRepoGroupingHarness(t *testing.T, html string) string {
jsFunc(t, html, "stageTrackerHeadColsHtml"),
jsFunc(t, html, "stageTrackerSinceHtml"),
jsFunc(t, html, "stageTrackerSubRowHtml"),
jsFunc(t, html, "stageTrackerPRPillsHtml"),
jsFunc(t, html, "stageTrackerLinkedPRItem"),
jsFunc(t, html, "stageTrackerLinkedPROpen"),
jsFunc(t, html, "stageTrackerNestedOpenPRs"),
Expand Down
1 change: 1 addition & 0 deletions src/pkg/dashboard/stage_tracker_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func stageTrackerRowsPreludeJS(t *testing.T, html string) string {
jsFunc(t, html, "stageTrackerHeadColsHtml"),
jsFunc(t, html, "stageTrackerSinceHtml"),
jsFunc(t, html, "stageTrackerSubRowHtml"),
jsFunc(t, html, "stageTrackerPRPillsHtml"),
jsFunc(t, html, "stageTrackerAgoText"),
jsConstBlock(t, html, "STAGE_TRACKER_LINEAGE_REASON_TIP"),
jsFunc(t, html, "stageTrackerLineageText"),
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/dashboard/static-src/css/tracker.css
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
.ham-head-cols .ham-seg.ham-head-lead { flex: 0 0 calc((100% - 4em - 6 * var(--sp-1)) / 2 + 2 * var(--sp-1)); padding: 0 var(--sp-6) 0 0; }
.ham-head-cols .ham-seg.ham-head-lead.ham-head-wide { flex: 1 1 0; }
/* The PR cell is one line: connector, author icon + #N + title, lineage
chip and base pill sit side by side; the title gives way first (then
the lineage chip), the pills and the connector never shrink
chip and base pill sit side by side; the lineage chip gives way first
(flex-shrink 2), then the title (1), the pills and the connector never shrink
(hivecommons/hive "consolidate from 3 lines of text to 1"). */
.ham-head-cols .ham-seg.ham-head-pr { flex: 1 1 0; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: var(--sp-2); min-width: 0; overflow: hidden; }
.ham-head-cols .ham-seg.ham-head-pr > .ham-linked-ico, .ham-head-cols .ham-seg.ham-head-pr > .ham-badge { flex: 0 0 auto; }
Expand Down
9 changes: 6 additions & 3 deletions src/pkg/dashboard/static-src/js/tracker-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,10 @@
ctx.nowMs = typeof nowMs === 'number' ? nowMs : Date.now();
return stageTrackerLeadActionHtml(item, ctx);
}
// PR link, then the lineage chip (null = none), then the base pill.
function stageTrackerPRPillsHtml(ref, lineage, baseRef) {
return ref + (lineage == null ? '' : ' ' + lineage) + (baseRef ? ` <span class="ham-badge">${esc(baseRef)}</span>` : '');
}
function stageTrackerSubRowHtml(lp, issue, stages, nowMs, ctx) {
const pr = stageTrackerLinkedPRItem(issue, lp);
const superseded = typeof stageTrackerLinkedSupersededText === 'function' ? stageTrackerLinkedSupersededText(lp, issue) : '';
Expand All @@ -1016,8 +1020,7 @@
const lineage = superseded ? '' : ((typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(pr, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(pr, nowMs) : ''));
const chip = ctx && ctx.repoChips ? stageTrackerRepoChipHtml(pr.repo, ctx) : '';
if (chip) ref = `<span class="ham-pr-line">${chip}${ref}</span>`;
if (lineage) ref += ' ' + lineage;
if (lp.base_ref) ref += ` <span class="ham-badge">${esc(lp.base_ref)}</span>`;
ref = stageTrackerPRPillsHtml(ref, lineage || null, lp.base_ref);
ref = STAGE_TRACKER_LINKED_GLYPH + ref;
if (superseded) {
// The adopted original: one dimmed line, no chevron track, no row
Expand Down Expand Up @@ -1240,7 +1243,7 @@
// One covering PR: a single entry whose strip the PR's stage drives.
const lp = linked[0];
const who = (lp.author_kind || 'hive') + (lp.author ? ' · @' + lp.author : '');
prRefs = [STAGE_TRACKER_LINKED_GLYPH + stageTrackerPRRef(lp.number, lp.url, lp.author_kind || '', lp.author, lp.title, (lp.title ? lp.title + '\n' : '') + 'Author: ' + who + ' · ' + stageTrackerLinkedTip(item, lp.number, ctx)) + (lp.lineage && typeof stageTrackerLineageChipHtml === 'function' ? ' ' + stageTrackerLineageChipHtml(lp, nowMs) : '') + (lp.base_ref ? ` <span class="ham-badge">${esc(lp.base_ref)}</span>` : '')];
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)), lp.lineage && typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(lp, nowMs) : null, lp.base_ref)];
shown = Object.assign({}, item, { via_pr: true, stage: lp.stage || 40, 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,
human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', head: lp.head || '', decision_needed: lp.decision_needed || null, hold: lp.hold || null, adoption: lp.adoption || null, stage_actor: lp.stage_actor || item.stage_actor || null, claimant: lp.claimant || null, presence: lp.presence || null, rework: lp.rework || null, merge_gate: lp.merge_gate || null, merge_train: lp.merge_train || null, decided: lp.decided || item.decided || null });
} else if (linked.length) {
Expand Down
13 changes: 8 additions & 5 deletions src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1435,8 +1435,8 @@
.ham-head-cols .ham-seg.ham-head-lead { flex: 0 0 calc((100% - 4em - 6 * var(--sp-1)) / 2 + 2 * var(--sp-1)); padding: 0 var(--sp-6) 0 0; }
.ham-head-cols .ham-seg.ham-head-lead.ham-head-wide { flex: 1 1 0; }
/* The PR cell is one line: connector, author icon + #N + title, lineage
chip and base pill sit side by side; the title gives way first (then
the lineage chip), the pills and the connector never shrink
chip and base pill sit side by side; the lineage chip gives way first
(flex-shrink 2), then the title (1), the pills and the connector never shrink
(hivecommons/hive "consolidate from 3 lines of text to 1"). */
.ham-head-cols .ham-seg.ham-head-pr { flex: 1 1 0; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: var(--sp-2); min-width: 0; overflow: hidden; }
.ham-head-cols .ham-seg.ham-head-pr > .ham-linked-ico, .ham-head-cols .ham-seg.ham-head-pr > .ham-badge { flex: 0 0 auto; }
Expand Down Expand Up @@ -16573,6 +16573,10 @@ <h3 class="faq-group-title">Where to get help</h3>
ctx.nowMs = typeof nowMs === 'number' ? nowMs : Date.now();
return stageTrackerLeadActionHtml(item, ctx);
}
// PR link, then the lineage chip (null = none), then the base pill.
function stageTrackerPRPillsHtml(ref, lineage, baseRef) {
return ref + (lineage == null ? '' : ' ' + lineage) + (baseRef ? ` <span class="ham-badge">${esc(baseRef)}</span>` : '');
}
function stageTrackerSubRowHtml(lp, issue, stages, nowMs, ctx) {
const pr = stageTrackerLinkedPRItem(issue, lp);
const superseded = typeof stageTrackerLinkedSupersededText === 'function' ? stageTrackerLinkedSupersededText(lp, issue) : '';
Expand All @@ -16584,8 +16588,7 @@ <h3 class="faq-group-title">Where to get help</h3>
const lineage = superseded ? '' : ((typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(pr, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(pr, nowMs) : ''));
const chip = ctx && ctx.repoChips ? stageTrackerRepoChipHtml(pr.repo, ctx) : '';
if (chip) ref = `<span class="ham-pr-line">${chip}${ref}</span>`;
if (lineage) ref += ' ' + lineage;
if (lp.base_ref) ref += ` <span class="ham-badge">${esc(lp.base_ref)}</span>`;
ref = stageTrackerPRPillsHtml(ref, lineage || null, lp.base_ref);
ref = STAGE_TRACKER_LINKED_GLYPH + ref;
if (superseded) {
// The adopted original: one dimmed line, no chevron track, no row
Expand Down Expand Up @@ -16808,7 +16811,7 @@ <h3 class="faq-group-title">Where to get help</h3>
// One covering PR: a single entry whose strip the PR's stage drives.
const lp = linked[0];
const who = (lp.author_kind || 'hive') + (lp.author ? ' · @' + lp.author : '');
prRefs = [STAGE_TRACKER_LINKED_GLYPH + stageTrackerPRRef(lp.number, lp.url, lp.author_kind || '', lp.author, lp.title, (lp.title ? lp.title + '\n' : '') + 'Author: ' + who + ' · ' + stageTrackerLinkedTip(item, lp.number, ctx)) + (lp.lineage && typeof stageTrackerLineageChipHtml === 'function' ? ' ' + stageTrackerLineageChipHtml(lp, nowMs) : '') + (lp.base_ref ? ` <span class="ham-badge">${esc(lp.base_ref)}</span>` : '')];
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)), lp.lineage && typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(lp, nowMs) : null, lp.base_ref)];
shown = Object.assign({}, item, { via_pr: true, stage: lp.stage || 40, 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,
human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', head: lp.head || '', decision_needed: lp.decision_needed || null, hold: lp.hold || null, adoption: lp.adoption || null, stage_actor: lp.stage_actor || item.stage_actor || null, claimant: lp.claimant || null, presence: lp.presence || null, rework: lp.rework || null, merge_gate: lp.merge_gate || null, merge_train: lp.merge_train || null, decided: lp.decided || item.decided || null });
} else if (linked.length) {
Expand Down
Loading