diff --git a/changelog.d/fixed-16485-tracker-row-density.md b/changelog.d/fixed-16485-tracker-row-density.md new file mode 100644 index 0000000000..03f2c69ac9 --- /dev/null +++ b/changelog.d/fixed-16485-tracker-row-density.md @@ -0,0 +1 @@ +- Activity monitor tracker rows are compact again: the stage chevrons sit directly under the title line as a one-line (~20px) strip, the issue title stays inline after its chips instead of dropping to its own line, the row toolbar pills share that first line, and row padding is tightened — roughly 60px per simple row as before the two-line chevron budget ([#16485](https://github.com/hivecommons/hive/issues/16485)). diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 3c54e831bf..c6e73642e0 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -578,7 +578,7 @@ test('unknown tracks show only the canonical column glyph, preserving full focus } }); -test('known and original chevrons keep full long text inside a shared two-line copy with complete hover/focus metadata', () => { +test('known and original chevrons keep full long text inside a shared one-line clamped copy with complete hover/focus metadata', () => { const handle = '@' + 'verylongunbrokenhandle'.repeat(12); const caption = 'Waiting for ' + handle + ' · not observed coding'; const owner = physicalTracks(livePR({ @@ -593,10 +593,10 @@ test('known and original chevrons keep full long text inside a shared two-line c assert.match(known, /ham-chevron-copy ham-track-state">([^]*?)<\/span>/)[1].includes(handle)); const css = fs.readFileSync(path.join(__dirname, 'static-src/css/tracker.css'), 'utf8'); - assert.match(css, /--ham-chevron-text-lines: 2;/); + assert.match(css, /--ham-chevron-text-lines: 1;/); assert.match(css, /\.ham-chevron-copy \{[^}]*-webkit-line-clamp: var\(--ham-chevron-text-lines\);[^}]*white-space: normal; overflow-wrap: anywhere;/); assert.doesNotMatch(css, /\.ham-(?:seg-t|detour)\.ham-has-holder[^}]*white-space: nowrap/); - assert.match(css, /padding: var\(--sp-2\) calc\(var\(--ham-notch\) \+ var\(--sp-2\)\)/); + assert.match(css, /padding: var\(--sp-1\) calc\(var\(--ham-notch\) \+ var\(--sp-2\)\)/); assert.match(css, /\.config-tooltip\.ham-chevron-tip \{[^}]*pointer-events: auto/); assert.match(css, /#activity-monitor-panel \{ --ham-compact-min-width: 60em; \}/); assert.match(css, /\.ham-row > \.ham-strip-row, \.ham-sub > \.ham-strip-row, \.ham-cols > \.ham-strip-row \{ overflow-x: auto; \}/); diff --git a/src/pkg/dashboard/stage_tracker_header_spans.test.js b/src/pkg/dashboard/stage_tracker_header_spans.test.js index f2c3fc1c3b..2bdc9a9dcc 100644 --- a/src/pkg/dashboard/stage_tracker_header_spans.test.js +++ b/src/pkg/dashboard/stage_tracker_header_spans.test.js @@ -126,8 +126,9 @@ test('spans share the physical lane grid, including independent concurrent CI/Re assert.equal(laneCount, physicalCount - 1, 'CSS and actual rendered lane count must agree'); assert.match(rule('.ham-head-cols .ham-seg.ham-head-lead'), /grid-column: 1 \/ var\(--ham-pr-start\)/); assert.match(rule('.ham-head-cols .ham-seg.ham-head-pr'), /grid-column: var\(--ham-pr-start\) \/ -2/); - assert.match(rule('.ham-head-cols .ham-seg.cap'), /grid-column: 1 \/ -1; grid-row: 2/); - assert.match(rule('.ham-head-cols .ham-seg.cap'), /justify-content: flex-end/); + assert.doesNotMatch(html, /\.ham-head-cols \.ham-seg\.cap \{/, 'no separate toolbar line between the title line and the chevrons'); + assert.match(rule('.ham-head-cols .ham-seg.ham-head-pr > .ham-badges'), /margin-left: auto/, 'chips right-anchor on the PR line'); + assert.match(rule('.ham-head-cols .ham-seg.ham-head-pr > .ham-badges'), /justify-content: flex-end/); // Resolve the declared grid lines using the actual header's track count. // Content cannot alter minmax(0,1fr) track widths; covered gaps belong to spans. const start = Number(ctx.stageTrackerHeadColsHtml(['PR'], 'issue', chips).match(/data-ham-pr-start="(\d+)"/)[1]); @@ -145,33 +146,56 @@ test('spans share the physical lane grid, including independent concurrent CI/Re assert.match(ctx.stageTrackerHeadColsHtml(['PR']), /data-ham-pr-start="5"/, 'boundary derives from canonical stages, not a second hard-coded span'); }); -test('chevron height is content-driven (one-line floor, two-line clamp) and the caption stays centred', () => { +test('chevron height is one caption line (compact strip, single-line clamp) and the caption stays centred', () => { const strip = rule('.ham-strip[aria-label="Pipeline progress"]'); const seg = rule('.ham-strip[aria-label="Pipeline progress"] > .ham-seg'); const copy = rule('.ham-chevron-copy'); - assert.match(strip, /grid-auto-rows: minmax\(calc\(var\(--ham-chevron-line-height\) \* 1em \+ 2 \* var\(--sp-2\) \+ 2 \* var\(--line-width\)\), auto\)/, - 'rows size to their tallest caption above a one-line floor'); + assert.match(strip, /grid-auto-rows: minmax\(calc\(var\(--ham-chevron-line-height\) \* 1em \+ 2 \* var\(--sp-1\) \+ 2 \* var\(--line-width\)\), auto\)/, + 'rows size to content above a one-line floor with sp-1 vertical padding (~20px strip)'); + assert.match(seg, /padding: var\(--sp-1\) calc\(var\(--ham-notch\) \+ var\(--sp-2\)\)/, 'sp-2 vertical padding doubled the strip height (hivecommons/hive#16454)'); + assert.match(rule('.ham-strip'), /--ham-chevron-text-lines: 1;/, 'captions are clamped to one line so the strip stays compact'); assert.doesNotMatch(strip, /grid-auto-rows: calc\(var\(--ham-chevron-text-lines\)/, 'no fixed two-line row height around one line of text'); assert.match(seg, /align-self: stretch/); assert.doesNotMatch(seg, /height: 100%/, 'siblings follow the row, the row follows its content'); - assert.match(copy, /max-height: calc\(var\(--ham-chevron-text-lines\) \* var\(--ham-chevron-line-height\) \* 1em\)/, 'the two-line clamp stays'); + assert.match(copy, /max-height: calc\(var\(--ham-chevron-text-lines\) \* var\(--ham-chevron-line-height\) \* 1em\)/, 'the clamp caps the copy at --ham-chevron-text-lines lines'); assert.match(copy, /flex: 0 1 auto/, 'the copy shrink-wraps its text so justify-content: center centres it'); assert.match(copy, /text-align: center/, 'a wrapped second line is centred under the first'); assert.match(rule('.ham-chevron-info.config-info, .ham-chevron-info.ham-chevron-decision'), /align-items: center; justify-content: center/); }); +test('the issue title sits inline after its chips on the first line, not on a line of its own', () => { + const ctx = load(); + const rendered = ctx.stageTrackerRowHtml({ ...issue, number: 16475 }, [], { nowMs: 1, repoChips: {} }); + // One flex container holds icon, repo chip, #ref, agent chip and title. + const main = rendered.match(/
([\s\S]*?)<\/div>/)[1]; + assert.match(main, /ham-kind-ico[\s\S]*ham-repo-chip[\s\S]*ham-ref[\s\S]*#16475[\s\S]*ham-title-tag[\s\S]*class="ham-title"/, + 'kind icon, repo chip, #ref, agent chip and title render in that order in one container'); + assert.doesNotMatch(main, /<(div|p|br)\b/, 'no block element splits the title from its chips'); + const container = rule('.ham-head-main'); + assert.match(container, /display: flex/); + assert.match(container, /flex-wrap: wrap/, 'chips may still wrap when a line is genuinely full'); + const t = rule('.ham-head-main > .ham-title'); + assert.match(t, /flex: 1 1 0/, 'a zero flex-basis keeps the title on the chip line and fills the rest of it (a max-content basis drops the whole title to line 2)'); + assert.match(t, /min-width: 0/); + assert.match(t, /white-space: normal/, 'the title wraps its own words only when there is no room'); + const prRef = rule('.ham-head-cols .ham-seg.ham-head-pr > .ham-pr-ref, .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-line'); + assert.match(prRef, /flex: 1 1 0; min-width: min\(100%, 20em\)/, 'the PR ref shares its line with the right-anchored pills'); + assert.match(rule('.ham-head-pr .ham-pr-title'), /flex: 1 1 0/); +}); + test('long metadata wraps in bounded slots and the narrow layout resets both grid axes', () => { assert.match(rule('.ham-head-cols .ham-seg.ham-head-pr'), /flex-wrap: wrap/); - assert.match(rule('.ham-head-cols .ham-seg.cap .ham-badges'), /flex-wrap: wrap/); - assert.match(rule('.ham-head-cols .ham-seg.cap .ham-badges'), /max-width: 100%/); - assert.match(rule('.ham-head-cols .ham-seg.cap .ham-badges'), /justify-content: flex-end/); + assert.match(rule('.ham-head-cols .ham-seg.ham-head-pr > .ham-badges'), /flex-wrap: wrap/); + assert.match(rule('.ham-head-cols .ham-seg.ham-head-pr > .ham-badges'), /max-width: 100%/); + assert.match(rule('.ham-head-cols .ham-seg.ham-head-pr > .ham-badges'), /justify-content: flex-end/); assert.match(rule('.ham-head-cols .ham-badge'), /white-space: normal; overflow-wrap: anywhere/); - assert.match(html, /\.ham-head-main > \.ham-title, \.ham-head-pr \.ham-pr-title \{ white-space: normal; overflow: visible; overflow-wrap: anywhere; \}/); + assert.match(html, /\.ham-head-main > \.ham-title \{ flex: 1 1 0; min-width: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; \}/); + assert.match(html, /\.ham-head-pr \.ham-pr-title \{ flex: 1 1 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; \}/); assert.match(html, /@media \(max-width: 1100px\) \{[\s\S]*?\.ham-head-cols \.ham-strip > \.ham-seg \{ grid-column: 1 \/ -1; grid-row: auto; padding: 0; \}/); assert.doesNotMatch(html, /\.ham-strip:not\(\.ham-head-cols\)/, 'the old ancestor/element selector mistake must not return'); }); -test('issue-only, linked and PR-only controls occupy one full-row far-right toolbar, independent of title spans', () => { +test('issue-only, linked and PR-only controls ride the title line, right-anchored in the PR span, never a line of their own', () => { for (const [number, label, history, blocked] of [ [15329, 'Let hive decide', 1, false], [16242, '', 0, false], @@ -187,23 +211,30 @@ test('issue-only, linked and PR-only controls occupy one full-row far-right tool ctx.stageTrackerLeadButtonHtml = () => label ? '' : ''; for (const item of [{ ...issue, number, is_tracker: number === 16242 }, { ...issue, number, linked_prs: [pr] }, { ...pr, number }]) { const rendered = ctx.stageTrackerRowHtml(item, [], { nowMs: 1 }); - const toolbar = rendered.match(/
  • ([^]*?)<\/li>/)[1]; + assert.doesNotMatch(rendered, /
  • /, 'the title line has no separate toolbar cell'); + const prCell = rendered.match(/
  • ]*>([^]*?)<\/li>/)[1]; + const toolbar = prCell.match(/([^]*)<\/span>$/); + assert.ok(toolbar, 'chips are the trailing flex item of the PR cell'); + const chipsHtml = toolbar[1]; + if (!item.linked_prs && item.kind === 'issue') assert.match(rendered, /
  • /, 'an issue without PR refs still gets the PR cell for its chips'); if (label) { - assert.ok(toolbar.includes(label)); + assert.ok(chipsHtml.includes(label)); assert.equal(rendered.split(label).length - 1, 1, 'action is not duplicated to fake alignment'); - assert.match(toolbar, /type="button"[^]*data-action="fixtureAction"/); + assert.match(chipsHtml, /type="button"[^]*data-action="fixtureAction"/); } - if (history) assert.match(toolbar, /ham-acted" tabindex="0">history 1/); - if (blocked) assert.match(toolbar, />blockedhistory 1/); + if (blocked) assert.match(chipsHtml, />blocked([^]*?)<\/li>/)[1]; assert.doesNotMatch(lead, /ham-lead-act|ham-acted|>blocked .ham-badges'); + assert.match(toolbar, /position: static/); + assert.match(toolbar, /margin-left: auto/); assert.match(toolbar, /justify-content: flex-end/); - assert.doesNotMatch(toolbar, /position: absolute|left:|right:/); - assert.match(html, /@media \(max-width: 1100px\) \{[^]*?\.ham-head-cols \.ham-seg\.cap \{[^}]*justify-content: flex-end/); + assert.doesNotMatch(toolbar, /position: absolute|[^-]left:|[^-]right:/, "flow layout, never an absolute overlay over the title"); + assert.match(rule('.ham-head-cols .ham-seg.ham-head-pr'), /grid-row: 1/, 'the PR cell, and so its chips, shares the title line'); + assert.doesNotMatch(html, /\.ham-head-cols [^{]*\{[^}]*grid-row: 2/, 'nothing in the title block claims a second grid row'); }); test('12:01 screenshot density: real multi-PR/sub-row structure preserves distinct headers and full-width control ownership', () => { @@ -227,7 +258,8 @@ test('12:01 screenshot density: real multi-PR/sub-row structure preserves distin assert.equal((rendered.match(/class="ham-strip-row ham-head-cols"/g) || []).length, 1 + children.length); for (const header of rendered.matchAll(/
    /g)) { assert.match(header[1], /data-ham-pr-start="4"/); - assert.equal((header[1].match(/class="ham-seg cap"/g) || []).length, 1, 'one separate far-right toolbar per identity'); + assert.equal((header[1].match(/class="ham-badges"/g) || []).length, 1, 'one right-anchored toolbar per identity, on its title line'); + assert.doesNotMatch(header[1], /class="ham-seg cap"/, 'no separate toolbar line'); const lead = header[1].match(/ham-head-lead[^"]*">([^]*?)<\/li>/)[1]; assert.doesNotMatch(lead, /ham-badge-waiting|ham-lead-act|ham-acted/, 'activity/action/history controls never overprint the issue title slot'); } @@ -235,12 +267,12 @@ test('12:01 screenshot density: real multi-PR/sub-row structure preserves distin const start = rendered.indexOf('data-ham-sub-key="pr:' + pr.number + '"'); assert.ok(start >= 0); const sub = rendered.slice(start).split('
  • [\s\S]*?<\/span><\/li><\/ol><\/span><\/div>\s*<\/div>\s*
    /.test(row), 'the chip cell closes the title line, directly above its own strip row'); +assert.ok(/
  • [\s\S]*?<\/span><\/li><\/ol><\/span><\/div>\s*<\/div>\s*
    /.test(row), 'the chip cell closes the title line, directly above its own strip row'); +assert.ok(!row.includes('
  • '), 'no separate toolbar line between the title and the chevrons'); assert.ok(row.indexOf('
  • '), 'the lineage chip rides the PR cell, not the chip cap: ' + head); + 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 @@ -520,7 +522,7 @@ assert.deepStrictEqual(segStates(subs(row)[0]), [B, B, B, D, D, D, 'active cap m // Title line: lead cell (Open..Claimed) and PR cell (PR in progress..Merge gate) each truncate with an ellipsis; the full title is on the element itself. row = stageTrackerRowHtml({ repo: 'acme/console', number: 12, kind: 'issue', title: 'A very long issue title that must not wrap', stage: 10 }, stages, ctx); // No PR to list: the lead cell widens over the empty PR column so a long title has room before it truncates. -assert.ok(/
  • <\/span><\/li>/.test(row), row); +assert.ok(/
  • <\/span><\/li>/.test(row), row); // Sort key: a covered issue counts as far along as its furthest PR. assert.strictEqual(stageTrackerSortKey({ kind: 'issue', stage: 40, linked_prs: [{ number: 1, stage: 30 }, { number: 2, stage: 90 }] }, stages).anchor, 80); // An issue parked on 045 (or a pre-045 085) with no PR sorts at Actionable, not past the merge gate. diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 156832a78b..482254eb9c 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -85,7 +85,7 @@ grid, the slot takes the Merge gate column plus the ✓ cap and right-aligns the chip over the gate. It never wraps with the filter bar, so the chip stays put whatever the toolbar does. */ - .ham-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-5) var(--sp-2); } + .ham-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-4) var(--sp-2); } /* Each entry is fenced by a hairline above it and lights up as a whole on hover, so a tall row (wrapped title, ↳ PR line) still reads as one block: its chip and age can only belong to the strip they sit beside. */ @@ -93,9 +93,12 @@ .ham-row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); border-radius: var(--r-sm); } /* Title line = a ghost strip with the same column widths as the chevrons below: a lead cell spanning Open..Claimed carries the number + title, a - PR cell spanning PR in progress..Merge gate carries "[icon] #N title", - modifiers get a separate, full-width right-anchored toolbar line. The since column is - an empty spacer (the time on step rides the strip row's since cell). + PR cell spanning PR in progress..Merge gate carries "[icon] #N title" + with the modifier chips / action buttons right-anchored on that same + line (margin-left: auto), wrapping under the PR metadata only when + there is no room. No separate toolbar line: the chevrons sit directly + under the title line. The since column is an empty spacer (the time on + step rides the strip row's since cell). Explicit grid spans share the chevrons' tracks, including the two concurrent CI/Review tracks, without content changing their widths. */ .ham-row-head { position: relative; display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-sm); min-width: 0; line-height: 1.3; } @@ -107,15 +110,26 @@ .ham-head-cols .ham-seg.ham-head-pr > .ham-linked-ico { flex: 0 0 auto; } .ham-head-cols .ham-seg.ham-head-pr > .ham-lineage, .ham-head-cols .ham-seg.ham-head-pr > .ham-adopted-from { flex: 0 1 auto; min-width: 0; max-width: 100%; flex-wrap: wrap; } .ham-head-cols .ham-seg.ham-head-pr > .ham-lineage > .ham-author-ico { vertical-align: text-bottom; margin-right: var(--sp-1); } - .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-ref, .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-line { flex: 0 1 auto; } - .ham-head-cols .ham-seg.cap { grid-column: 1 / -1; grid-row: 2; min-width: 0; overflow: visible; align-items: flex-end; justify-content: flex-end; padding: 0; } - .ham-head-cols .ham-seg.cap:has(> .ham-badges:empty) { display: none; } - .ham-head-cols .ham-seg.cap .ham-badges { position: static; flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; } + /* The PR ref shares the first line with the right-anchored pills: it + grows into the free space but keeps a readable floor, so pills wrap + under it only when the line is genuinely full. */ + .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-ref, .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-line { flex: 1 1 0; min-width: min(100%, 20em); } + .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-line > .ham-pr-ref { flex: 1 1 0; min-width: 0; } + .ham-head-cols .ham-seg.ham-head-pr > .ham-badges { position: static; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; min-width: 0; max-width: 100%; } + .ham-head-cols .ham-seg.ham-head-pr > .ham-badges:empty { display: none; } + .ham-head-cols .ham-seg.ham-head-tools { align-items: flex-start; } + .ham-head-cols .ham-seg.ham-head-tools:has(> .ham-badges:empty) { display: none; } .ham-head-cols .ham-badges > :is(button, a) { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .ham-head-cols .ham-badge { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .ham-head-main { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: var(--sp-3); min-width: 0; } .ham-head-main > .ham-badge { flex: 0 1 auto; } - .ham-head-main > .ham-title, .ham-head-pr .ham-pr-title { white-space: normal; overflow: visible; overflow-wrap: anywhere; } + /* The title fills whatever is left of the first line beside its chips + (flex-basis 0) and only wraps its own words when there is no room; + with a max-content basis (flex: 0 1 auto) a wrapping flex container + drops the whole title onto a second line as soon as it cannot fit + entirely, even with half the row free (hivecommons/hive#16454). */ + .ham-head-main > .ham-title { flex: 1 1 0; min-width: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; } + .ham-head-pr .ham-pr-title { flex: 1 1 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; } .ham-head-pr .ham-pr-ref, .ham-head-pr .ham-pr-line { flex-wrap: wrap; overflow: visible; } .ham-pr-ref { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; max-width: 100%; overflow: hidden; color: var(--muted); text-decoration: none; font-size: var(--fs-xs); } .ham-pr-ref:hover { color: var(--text); } @@ -316,7 +330,7 @@ .ham-badge-reroute { color: var(--status-warn); border-color: color-mix(in srgb, var(--status-warn) 55%, transparent); font-weight: var(--fw-medium); display: inline-flex; align-items: center; gap: var(--sp-1); } .ham-badge-reroute .ham-presence-dot { width: 0.5em; height: 0.5em; border-radius: var(--r-pill); background: var(--text-faint); flex: 0 0 auto; } .ham-badge-reroute.ham-reroute-online .ham-presence-dot { background: var(--status-ok); } - .ham-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--ham-visible-columns), minmax(0, 1fr)) 4em; gap: var(--sp-1); min-height: 18px; flex: 1 1 auto; min-width: 0; font-size: var(--fs-xs); --ham-notch: 8px; --ham-visible-columns: 7; --ham-chevron-text-lines: 2; --ham-chevron-line-height: 1.3; } + .ham-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--ham-visible-columns), minmax(0, 1fr)) 4em; gap: var(--sp-1); min-height: 18px; flex: 1 1 auto; min-width: 0; font-size: var(--fs-xs); --ham-notch: 8px; --ham-visible-columns: 7; --ham-chevron-text-lines: 1; --ham-chevron-line-height: 1.3; } .ham-seg { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 0 var(--sp-4) 0 var(--sp-5); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; clip-path: polygon(0 0, calc(100% - var(--ham-notch)) 0, 100% 50%, calc(100% - var(--ham-notch)) 100%, 0 100%, var(--ham-notch) 50%); } /* The concurrent CI / Review lanes are chevrons like every other stage (same clip-path, padding and height — the boxed card opt-out of @@ -388,15 +402,16 @@ .ham-gate-ico { display: inline-flex; align-items: center; margin-right: var(--sp-1); cursor: help; } .ham-gate-ico .ham-ico { width: 12px; height: 12px; } .ham-gate-detail { font-weight: normal; opacity: 0.85; font-variant-numeric: tabular-nums; } - /* All physical chevrons share a two-line text budget, but a row is only - as tall as its longest caption: one line of text → a one-line chevron, - two lines → two (the clamp below caps it there). The grid row sizes - to content with a one-line floor so icon-only cells and siblings - stretch to the row's tallest chevron, never to a fixed box. The - portal tooltip is outside the clipped polygon; keyboard focus - exposes the same full text. */ - .ham-strip[aria-label="Pipeline progress"] { grid-auto-rows: minmax(calc(var(--ham-chevron-line-height) * 1em + 2 * var(--sp-2) + 2 * var(--line-width)), auto); } - .ham-strip[aria-label="Pipeline progress"] > .ham-seg { box-sizing: border-box; align-self: stretch; line-height: var(--ham-chevron-line-height); padding: var(--sp-2) calc(var(--ham-notch) + var(--sp-2)); } + /* Every physical chevron is one caption line tall (--ham-chevron-text-lines: + 1, the clamp below ellipsises the rest): the strip rides directly under + the title line as a ~20px band, the density the tracker had before + hivecommons/hive#16454 doubled it with a two-line budget and sp-2 + vertical padding. The grid row sizes to content with that one-line + floor so icon-only cells and siblings share the row's height, never a + fixed box. The portal tooltip is outside the clipped polygon; keyboard + focus exposes the same full text. */ + .ham-strip[aria-label="Pipeline progress"] { grid-auto-rows: minmax(calc(var(--ham-chevron-line-height) * 1em + 2 * var(--sp-1) + 2 * var(--line-width)), auto); } + .ham-strip[aria-label="Pipeline progress"] > .ham-seg { box-sizing: border-box; align-self: stretch; line-height: var(--ham-chevron-line-height); padding: var(--sp-1) calc(var(--ham-notch) + var(--sp-2)); } .ham-chevron-info.config-info, .ham-chevron-info.ham-chevron-decision { display: flex; align-items: center; justify-content: center; gap: var(--sp-1); width: 100%; height: 100%; min-width: 0; flex-shrink: 1; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; position: static; } .ham-chevron-info.config-info:hover { background: transparent; border: 0; color: inherit; } .ham-chevron-info:focus-visible, .ham-chevron-decision:focus-within { outline: var(--line-width) solid currentColor; outline-offset: var(--sp-1); } @@ -669,7 +684,7 @@ .ham-row { position: relative; } .ham-row:focus-visible { outline: var(--focus-ring-width) solid var(--accent); outline-offset: calc(-1 * var(--focus-ring-width)); border-radius: var(--r-sm); } .ham-row.ham-selected { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset var(--sp-1) 0 0 var(--accent); border-radius: var(--r-sm); } - .ham-row-tools { position: absolute; left: calc(-1 * var(--ham-gutter)); top: var(--sp-5); width: var(--ham-gutter); display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); } + .ham-row-tools { position: absolute; left: calc(-1 * var(--ham-gutter)); top: var(--sp-4); width: var(--ham-gutter); display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); } /* A nested PR sub-row carries its own gutter (checkbox + ⋯), so each PR under an issue is selected and acted on by itself (two PRs under one issue, one decision each — the owner's 2026-10-28 report). The @@ -777,7 +792,6 @@ .ham-head-cols > .ham-strip { display: contents; } .ham-head-cols .ham-strip > .ham-seg { grid-column: 1 / -1; grid-row: auto; padding: 0; } .ham-head-cols .ham-head-lead:empty { display: none; } - .ham-head-cols .ham-seg.cap { grid-column: 1 / -1; min-width: 0; justify-content: flex-end; } .ham-head-cols > .ham-since { display: none; } .ham-row .ham-seg { padding: 0 var(--sp-2) 0 var(--sp-3); } .ham-row .ham-seg.cap { flex-basis: 2em; } 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 204dc3bb21..3d887e7022 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-layout.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-layout.js @@ -1,15 +1,21 @@ // Ghost strip for a title line: the lead cell (Open..Claimed) carries // the item's own number + title, the PR cell (PR in progress..Merge gate) - // the given refs. Modifier chips wrap on their own full-width, - // right-anchored line rather than overflowing the history cap into titles. + // the given refs followed by the modifier chips / action buttons, + // right-anchored on that same line (margin-left: auto). The chips ride + // the title line rather than a second full-width toolbar line, so the + // chevrons sit directly under the title (hivecommons/hive#16454 left a + // one-line band between them); when the PR metadata leaves no room the + // chips wrap under it, content-driven, never a fixed row. A row without + // PR refs still gets the PR cell (ham-head-tools) so its chips sit on + // the title line in the PR span, not on a line of their own. // The since column is an empty spacer here (same width as the strip // row's, which carries the time on step): a wrapped title must not float // the age away from the chevrons it describes. function stageTrackerHeadColsHtml(prRefs, leadHtml, chipsHtml, prTargetKey) { const wide = !(prRefs && prRefs.length); const prStart = STAGE_TRACKER_PATH.indexOf(STAGE_TRACKER_PR_COLUMN) + 1; - return `
    1. ${leadHtml || ''}
    2. ${wide ? '' : `
    3. ${prRefs.join('')}
    4. `}
    5. ${chipsHtml || ''}
    `; + return `
    1. ${leadHtml || ''}
    2. ${wide ? '' : prRefs.join('')}${chipsHtml || ''}
    `; } function stageTrackerSinceHtml(item, nowMs) { diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 46e302a2f5..2a602fae12 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1422,7 +1422,7 @@ grid, the slot takes the Merge gate column plus the ✓ cap and right-aligns the chip over the gate. It never wraps with the filter bar, so the chip stays put whatever the toolbar does. */ - .ham-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-5) var(--sp-2); } + .ham-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-4) var(--sp-2); } /* Each entry is fenced by a hairline above it and lights up as a whole on hover, so a tall row (wrapped title, ↳ PR line) still reads as one block: its chip and age can only belong to the strip they sit beside. */ @@ -1430,9 +1430,12 @@ .ham-row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); border-radius: var(--r-sm); } /* Title line = a ghost strip with the same column widths as the chevrons below: a lead cell spanning Open..Claimed carries the number + title, a - PR cell spanning PR in progress..Merge gate carries "[icon] #N title", - modifiers get a separate, full-width right-anchored toolbar line. The since column is - an empty spacer (the time on step rides the strip row's since cell). + PR cell spanning PR in progress..Merge gate carries "[icon] #N title" + with the modifier chips / action buttons right-anchored on that same + line (margin-left: auto), wrapping under the PR metadata only when + there is no room. No separate toolbar line: the chevrons sit directly + under the title line. The since column is an empty spacer (the time on + step rides the strip row's since cell). Explicit grid spans share the chevrons' tracks, including the two concurrent CI/Review tracks, without content changing their widths. */ .ham-row-head { position: relative; display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-sm); min-width: 0; line-height: 1.3; } @@ -1444,15 +1447,26 @@ .ham-head-cols .ham-seg.ham-head-pr > .ham-linked-ico { flex: 0 0 auto; } .ham-head-cols .ham-seg.ham-head-pr > .ham-lineage, .ham-head-cols .ham-seg.ham-head-pr > .ham-adopted-from { flex: 0 1 auto; min-width: 0; max-width: 100%; flex-wrap: wrap; } .ham-head-cols .ham-seg.ham-head-pr > .ham-lineage > .ham-author-ico { vertical-align: text-bottom; margin-right: var(--sp-1); } - .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-ref, .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-line { flex: 0 1 auto; } - .ham-head-cols .ham-seg.cap { grid-column: 1 / -1; grid-row: 2; min-width: 0; overflow: visible; align-items: flex-end; justify-content: flex-end; padding: 0; } - .ham-head-cols .ham-seg.cap:has(> .ham-badges:empty) { display: none; } - .ham-head-cols .ham-seg.cap .ham-badges { position: static; flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; } + /* The PR ref shares the first line with the right-anchored pills: it + grows into the free space but keeps a readable floor, so pills wrap + under it only when the line is genuinely full. */ + .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-ref, .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-line { flex: 1 1 0; min-width: min(100%, 20em); } + .ham-head-cols .ham-seg.ham-head-pr > .ham-pr-line > .ham-pr-ref { flex: 1 1 0; min-width: 0; } + .ham-head-cols .ham-seg.ham-head-pr > .ham-badges { position: static; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; min-width: 0; max-width: 100%; } + .ham-head-cols .ham-seg.ham-head-pr > .ham-badges:empty { display: none; } + .ham-head-cols .ham-seg.ham-head-tools { align-items: flex-start; } + .ham-head-cols .ham-seg.ham-head-tools:has(> .ham-badges:empty) { display: none; } .ham-head-cols .ham-badges > :is(button, a) { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .ham-head-cols .ham-badge { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .ham-head-main { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: var(--sp-3); min-width: 0; } .ham-head-main > .ham-badge { flex: 0 1 auto; } - .ham-head-main > .ham-title, .ham-head-pr .ham-pr-title { white-space: normal; overflow: visible; overflow-wrap: anywhere; } + /* The title fills whatever is left of the first line beside its chips + (flex-basis 0) and only wraps its own words when there is no room; + with a max-content basis (flex: 0 1 auto) a wrapping flex container + drops the whole title onto a second line as soon as it cannot fit + entirely, even with half the row free (hivecommons/hive#16454). */ + .ham-head-main > .ham-title { flex: 1 1 0; min-width: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; } + .ham-head-pr .ham-pr-title { flex: 1 1 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; } .ham-head-pr .ham-pr-ref, .ham-head-pr .ham-pr-line { flex-wrap: wrap; overflow: visible; } .ham-pr-ref { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; max-width: 100%; overflow: hidden; color: var(--muted); text-decoration: none; font-size: var(--fs-xs); } .ham-pr-ref:hover { color: var(--text); } @@ -1653,7 +1667,7 @@ .ham-badge-reroute { color: var(--status-warn); border-color: color-mix(in srgb, var(--status-warn) 55%, transparent); font-weight: var(--fw-medium); display: inline-flex; align-items: center; gap: var(--sp-1); } .ham-badge-reroute .ham-presence-dot { width: 0.5em; height: 0.5em; border-radius: var(--r-pill); background: var(--text-faint); flex: 0 0 auto; } .ham-badge-reroute.ham-reroute-online .ham-presence-dot { background: var(--status-ok); } - .ham-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--ham-visible-columns), minmax(0, 1fr)) 4em; gap: var(--sp-1); min-height: 18px; flex: 1 1 auto; min-width: 0; font-size: var(--fs-xs); --ham-notch: 8px; --ham-visible-columns: 7; --ham-chevron-text-lines: 2; --ham-chevron-line-height: 1.3; } + .ham-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--ham-visible-columns), minmax(0, 1fr)) 4em; gap: var(--sp-1); min-height: 18px; flex: 1 1 auto; min-width: 0; font-size: var(--fs-xs); --ham-notch: 8px; --ham-visible-columns: 7; --ham-chevron-text-lines: 1; --ham-chevron-line-height: 1.3; } .ham-seg { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 0 var(--sp-4) 0 var(--sp-5); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; clip-path: polygon(0 0, calc(100% - var(--ham-notch)) 0, 100% 50%, calc(100% - var(--ham-notch)) 100%, 0 100%, var(--ham-notch) 50%); } /* The concurrent CI / Review lanes are chevrons like every other stage (same clip-path, padding and height — the boxed card opt-out of @@ -1725,15 +1739,16 @@ .ham-gate-ico { display: inline-flex; align-items: center; margin-right: var(--sp-1); cursor: help; } .ham-gate-ico .ham-ico { width: 12px; height: 12px; } .ham-gate-detail { font-weight: normal; opacity: 0.85; font-variant-numeric: tabular-nums; } - /* All physical chevrons share a two-line text budget, but a row is only - as tall as its longest caption: one line of text → a one-line chevron, - two lines → two (the clamp below caps it there). The grid row sizes - to content with a one-line floor so icon-only cells and siblings - stretch to the row's tallest chevron, never to a fixed box. The - portal tooltip is outside the clipped polygon; keyboard focus - exposes the same full text. */ - .ham-strip[aria-label="Pipeline progress"] { grid-auto-rows: minmax(calc(var(--ham-chevron-line-height) * 1em + 2 * var(--sp-2) + 2 * var(--line-width)), auto); } - .ham-strip[aria-label="Pipeline progress"] > .ham-seg { box-sizing: border-box; align-self: stretch; line-height: var(--ham-chevron-line-height); padding: var(--sp-2) calc(var(--ham-notch) + var(--sp-2)); } + /* Every physical chevron is one caption line tall (--ham-chevron-text-lines: + 1, the clamp below ellipsises the rest): the strip rides directly under + the title line as a ~20px band, the density the tracker had before + hivecommons/hive#16454 doubled it with a two-line budget and sp-2 + vertical padding. The grid row sizes to content with that one-line + floor so icon-only cells and siblings share the row's height, never a + fixed box. The portal tooltip is outside the clipped polygon; keyboard + focus exposes the same full text. */ + .ham-strip[aria-label="Pipeline progress"] { grid-auto-rows: minmax(calc(var(--ham-chevron-line-height) * 1em + 2 * var(--sp-1) + 2 * var(--line-width)), auto); } + .ham-strip[aria-label="Pipeline progress"] > .ham-seg { box-sizing: border-box; align-self: stretch; line-height: var(--ham-chevron-line-height); padding: var(--sp-1) calc(var(--ham-notch) + var(--sp-2)); } .ham-chevron-info.config-info, .ham-chevron-info.ham-chevron-decision { display: flex; align-items: center; justify-content: center; gap: var(--sp-1); width: 100%; height: 100%; min-width: 0; flex-shrink: 1; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; position: static; } .ham-chevron-info.config-info:hover { background: transparent; border: 0; color: inherit; } .ham-chevron-info:focus-visible, .ham-chevron-decision:focus-within { outline: var(--line-width) solid currentColor; outline-offset: var(--sp-1); } @@ -2006,7 +2021,7 @@ .ham-row { position: relative; } .ham-row:focus-visible { outline: var(--focus-ring-width) solid var(--accent); outline-offset: calc(-1 * var(--focus-ring-width)); border-radius: var(--r-sm); } .ham-row.ham-selected { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset var(--sp-1) 0 0 var(--accent); border-radius: var(--r-sm); } - .ham-row-tools { position: absolute; left: calc(-1 * var(--ham-gutter)); top: var(--sp-5); width: var(--ham-gutter); display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); } + .ham-row-tools { position: absolute; left: calc(-1 * var(--ham-gutter)); top: var(--sp-4); width: var(--ham-gutter); display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); } /* A nested PR sub-row carries its own gutter (checkbox + ⋯), so each PR under an issue is selected and acted on by itself (two PRs under one issue, one decision each — the owner's 2026-10-28 report). The @@ -2114,7 +2129,6 @@ .ham-head-cols > .ham-strip { display: contents; } .ham-head-cols .ham-strip > .ham-seg { grid-column: 1 / -1; grid-row: auto; padding: 0; } .ham-head-cols .ham-head-lead:empty { display: none; } - .ham-head-cols .ham-seg.cap { grid-column: 1 / -1; min-width: 0; justify-content: flex-end; } .ham-head-cols > .ham-since { display: none; } .ham-row .ham-seg { padding: 0 var(--sp-2) 0 var(--sp-3); } .ham-row .ham-seg.cap { flex-basis: 2em; } @@ -18541,15 +18555,21 @@

    Where to get help

    // Ghost strip for a title line: the lead cell (Open..Claimed) carries // the item's own number + title, the PR cell (PR in progress..Merge gate) - // the given refs. Modifier chips wrap on their own full-width, - // right-anchored line rather than overflowing the history cap into titles. + // the given refs followed by the modifier chips / action buttons, + // right-anchored on that same line (margin-left: auto). The chips ride + // the title line rather than a second full-width toolbar line, so the + // chevrons sit directly under the title (hivecommons/hive#16454 left a + // one-line band between them); when the PR metadata leaves no room the + // chips wrap under it, content-driven, never a fixed row. A row without + // PR refs still gets the PR cell (ham-head-tools) so its chips sit on + // the title line in the PR span, not on a line of their own. // The since column is an empty spacer here (same width as the strip // row's, which carries the time on step): a wrapped title must not float // the age away from the chevrons it describes. function stageTrackerHeadColsHtml(prRefs, leadHtml, chipsHtml, prTargetKey) { const wide = !(prRefs && prRefs.length); const prStart = STAGE_TRACKER_PATH.indexOf(STAGE_TRACKER_PR_COLUMN) + 1; - return `
    1. ${leadHtml || ''}
    2. ${wide ? '' : `
    3. ${prRefs.join('')}
    4. `}
    5. ${chipsHtml || ''}
    `; + return `
    1. ${leadHtml || ''}
    2. ${wide ? '' : prRefs.join('')}${chipsHtml || ''}
    `; } function stageTrackerSinceHtml(item, nowMs) { diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js b/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js index f3506a6c7f..23487c06f4 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js @@ -5,7 +5,7 @@ if (!dedicatedPreview) throw new Error('Use a dedicated published-preview tab, not the user’s live dashboard'); const tolerance = 1; const failures = []; - const coverage = { issueOnly: 0, linked: 0, prOnly: 0, nested: 0, multiIssue: 0, unknown: 0, queuedApproved: 0, wrapped: 0, singleLineRows: 0, wrappedRows: 0, controls: 0, controlTargets: 0, hitTested: 0, currentRows: 0, preparation: 0, superseded: 0, states: {} }; + const coverage = { issueOnly: 0, linked: 0, prOnly: 0, nested: 0, multiIssue: 0, unknown: 0, queuedApproved: 0, wrapped: 0, singleLineRows: 0, clampedRows: 0, controls: 0, controlTargets: 0, hitTested: 0, currentRows: 0, preparation: 0, superseded: 0, states: {} }; const near = (a, b) => Math.abs(a - b) <= tolerance; const visible = el => el && el.getClientRects().length && getComputedStyle(el).display !== 'none'; const rect = el => el.getBoundingClientRect(); @@ -67,7 +67,10 @@ const strip = row.querySelector(':scope > .ham-strip-row > ol[aria-label="Pipeline progress"]'); if (!visible(header) || !visible(strip)) continue; const lead = header.querySelector('.ham-head-lead'); - const pr = header.querySelector('.ham-head-pr'); + // A row without PR refs still has the PR cell (ham-head-tools) as the + // home of its chips; only a cell with refs counts as PR metadata here. + const prCell = header.querySelector('.ham-head-pr'); + const pr = prCell && !prCell.classList.contains('ham-head-tools') ? prCell : null; const badges = header.querySelector('.ham-badges'); const columns = [...strip.children]; // The renderer emits this boundary from its private canonical lane path. @@ -82,10 +85,9 @@ if ([...row.querySelectorAll(':scope > .ham-current-stage, :scope > .ham-human-context')] .some(context => /superseded/i.test(context.textContent))) coverage.superseded++; if (row.matches('.ham-row') && row.querySelectorAll(':scope > .ham-sub').length > 1) coverage.multiIssue++; - // Height is deliberately absent from the cross-row signature: a row is - // only as tall as its longest caption (one or two lines), so rows differ - // in height by design. Within-row uniformity and the content-driven - // height contract are asserted separately below. + // Height is deliberately absent from the cross-row signature; within-row + // uniformity and the one-line height contract are asserted separately + // below. const signature = columns.map(cell => ({ left: rect(cell).left - rect(strip).left, width: rect(cell).width })); const stripLeft = rect(strip.parentElement).left; // Recorded preparation roots retain the existing rail gutter. Compare @@ -112,10 +114,20 @@ if (pr) { assert(near(rect(pr).left, rect(columns[prStart]).left), name + 'PR starts at PR in progress'); assert(near(rect(pr).right, rect(columns[lastLane]).right), name + 'PR ends at Merge gate'); - if (visible(badges) && badges.children.length) { - assert(rect(badges).top >= rect(pr).bottom - tolerance, name + 'badges below PR metadata'); + } + if (visible(badges) && badges.children.length) { + // Chips ride the PR line (or wrap under its metadata), never a + // line of their own between the title block and the chevrons. + assert(rect(badges).top >= rect(prCell).top - tolerance && rect(badges).bottom <= rect(prCell).bottom + tolerance, name + 'badges inside the PR cell'); + const metadata = [...prCell.children].filter(child => child !== badges && visible(child)); + if (metadata.length) { + const metaTop = Math.min(...metadata.map(child => rect(child).top)); + assert(rect(badges).bottom > metaTop + tolerance, name + 'badges share the PR metadata line or wrap under it, never a line above'); + } else { + assert(near(rect(badges).top, rect(header).top), name + 'badges on the title line'); } } + assert(near(rect(strip.parentElement).top - rect(header).bottom, rowGap), name + 'chevrons sit directly under the title block (row gap only)'); } else if (pr && visible(lead)) { assert(rect(pr).top >= rect(lead).bottom - tolerance, name + 'narrow PR below issue'); } @@ -133,13 +145,22 @@ if (badges.children.length) { assert(visible(badges), name + 'nonempty action/history toolbar is not hidden'); coverage.controls++; + // The chips are the trailing, right-anchored flex item of the PR + // cell: they end where the PR span ends (Merge gate), sit beside + // the issue metadata rather than under it, and never overprint the + // PR metadata they follow (wrapping under it when space runs out). const toolbar = badges.parentElement; - const headerStrip = header.querySelector('.ham-strip'); - const expectedRight = matchMedia('(min-width: 1101px)').matches ? rect(headerStrip).right : rect(header).right; - assert(near(rect(toolbar).right, expectedRight), name + 'full-row toolbar reaches the far right'); - assert(near(rect(badges).right, expectedRight), name + 'controls are right-anchored, not in an issue-side column'); - assert(rect(toolbar).top >= rect(lead).bottom - tolerance, name + 'toolbar does not intersect issue metadata'); - if (pr) assert(rect(toolbar).top >= rect(pr).bottom - tolerance, name + 'toolbar does not intersect PR metadata'); + const desktop = matchMedia('(min-width: 1101px)').matches; + const expectedRight = desktop ? rect(toolbar).right : rect(header).right; + assert(near(rect(badges).right, expectedRight), name + 'controls are right-anchored at the end of the PR span, not in an issue-side column'); + if (desktop) assert(rect(badges).left >= rect(lead).right - tolerance, name + 'toolbar does not intersect issue metadata'); + else assert(rect(toolbar).top >= rect(lead).bottom - tolerance, name + 'narrow toolbar below issue metadata'); + for (const child of toolbar.children) { + if (child === badges || !visible(child)) continue; + const box = rect(child), chips = rect(badges); + const apart = box.right <= chips.left + tolerance || box.left >= chips.right - tolerance || box.bottom <= chips.top + tolerance || box.top >= chips.bottom - tolerance; + assert(apart, name + 'toolbar does not intersect PR metadata: ' + JSON.stringify({ child: child.className, box, chips })); + } for (const control of badges.querySelectorAll('button, a, [tabindex]')) { if (!control.closest('.config-tooltip')) await inspectControl(control, toolbar, name); } @@ -153,10 +174,10 @@ } const heights = columns.map(cell => rect(cell).height); assert(Math.max(...heights) - Math.min(...heights) <= tolerance, name + 'all physical chevrons have uniform height'); - // Content-driven height: the row is exactly as tall as its longest - // caption (one or two text lines plus the chevron's own padding and - // border), with a one-line floor for icon-only rows — never a fixed - // two-line box around one line of text. + // Compact height: captions are clamped to one line, so every row is + // exactly one text line plus the chevron's own padding and border + // (~20px) — the pre-hivecommons/hive#16454 density. Icon-only rows + // share the same one-line floor. const lineWidth = parseFloat(getComputedStyle(strip).getPropertyValue('--line-width')) || 0; const cellBudget = (cell, lines, border) => { const style = getComputedStyle(cell); @@ -172,10 +193,11 @@ expectedHeight = Math.max(expectedHeight, cellBudget(cell, lines)); } } - assert(near(Math.max(...heights), expectedHeight), name + 'chevron height is content-driven (' + (rowLines || 1) + ' text line(s) + padding), not a fixed two-line box: ' + - JSON.stringify({ measured: Math.max(...heights), expected: expectedHeight, lines: rowLines })); - if (rowLines === 1) coverage.singleLineRows++; - if (rowLines === 2) coverage.wrappedRows++; + assert(rowLines <= 1, name + 'captions are clamped to a single line: ' + JSON.stringify({ lines: rowLines })); + assert(near(Math.max(...heights), expectedHeight), name + 'chevron height is one text line + padding, not a two-line box: ' + + JSON.stringify({ measured: Math.max(...heights), expected: expectedHeight })); + coverage.singleLineRows++; + if (strip.querySelector('.ham-chevron-copy') && [...strip.querySelectorAll('.ham-chevron-copy')].some(c => visible(c) && c.scrollHeight > rect(c).height + tolerance)) coverage.clampedRows++; const ci = strip.querySelector('[data-track="ci"]'); const review = strip.querySelector('[data-track="review"]'); const current = columns.filter(cell => !cell.classList.contains('cap') && @@ -225,8 +247,8 @@ const lineHeight = parseFloat(style.lineHeight); const bounds = rect(copy); assert(style.whiteSpace === 'normal' && style.overflowWrap === 'anywhere', name + 'text wraps, including unbroken handles'); - assert(bounds.height <= lineHeight * 2 + tolerance, name + 'maximum two visible text lines'); - if (bounds.height > lineHeight + tolerance) coverage.wrapped++; + assert(bounds.height <= lineHeight + tolerance, name + 'maximum one visible text line'); + if (copy.scrollHeight > bounds.height + tolerance) coverage.wrapped++; assert(bounds.left >= rect(cell).left + parseFloat(getComputedStyle(cell).paddingLeft) - tolerance, name + 'text clears the left chevron notch'); assert(bounds.right <= rect(cell).right - parseFloat(getComputedStyle(cell).paddingRight) + tolerance, name + 'text clears the right chevron point'); // Centred as before the two-line budget: the glyphs sit centred in @@ -271,8 +293,8 @@ for (const state of ['queued', 'unknown', 'assigned', 'approved', 'waiting', 'failing', 'passing', 'running']) { assert(coverage.states[state] > 0, 'preview must exercise current-head activity state ' + state); } - assert(coverage.unknown > 0 && coverage.queuedApproved > 0 && coverage.wrapped > 0 && coverage.controls > 0, 'preview must include unknown, queued-CI/approved-review, long wrapped text and action/history controls'); - assert(coverage.singleLineRows > 0 && coverage.wrappedRows > 0, 'preview must include both a one-line-caption row (one-line-tall chevrons) and a two-line-caption row (two-line-tall chevrons)'); + assert(coverage.unknown > 0 && coverage.queuedApproved > 0 && coverage.wrapped > 0 && coverage.controls > 0, 'preview must include unknown, queued-CI/approved-review, long clamped text and action/history controls'); + assert(coverage.singleLineRows > 0 && coverage.clampedRows > 0, 'preview must include a row whose caption overflows its one-line clamp (long text stays a one-line chevron)'); assert(coverage.controlTargets > 0 && coverage.controlTargets === coverage.hitTested, 'every relevant header control must be hit-tested, never skipped as offscreen'); if (failures.length) throw new Error(JSON.stringify({ viewport: innerWidth, coverage, failures })); return { viewport: innerWidth, coverage, failures };