From b5f1170019244aa8fe7f448e155b2d479112feb3 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 3 Nov 2026 19:11:20 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20dashboard:=20restore=20compa?= =?UTF-8?q?ct=20tracker=20rows=20(one-line=20chevrons,=20inline=20title)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tracker rows in the Activity Monitor doubled in height after the layout restore (#16454) and acceptance stabilisation (#16461): - the row toolbar (hold / Let hive decide pills) was a separate full-width grid line between the title and the chevrons, reading as a 30-40px blank band; it now trails the PR cell on the title line; - chevrons carried a two-line caption budget, sp-2 vertical padding and a matching grid-auto-rows floor (24-48px); captions are clamped to one line with ellipsis and sp-1 padding (~20px), the pre-#16454 density; - the issue title had a max-content flex basis inside a wrapping .ham-head-main, so it dropped to its own line whenever it could not fit entirely; it now fills the rest of the chip line (flex: 1 1 0) and wraps only its own words. The PR ref does the same with a 20em floor so pills stay on the first line; - row padding sp-5 -> sp-4. Simple rows measure 59px (was 71-99px) at 1440x1200@1; 16 rows fit in the viewport where 8 did. Tests and the tracker-header-geometry probe are retargeted to the one-line contract; a node test pins the inline title. Fixes #16485 Signed-off-by: Andrew Anderson --- .../fixed-16485-tracker-row-density.md | 1 + .../dashboard/stage_tracker_activity.test.js | 6 +- .../stage_tracker_header_spans.test.js | 86 +++++++++++++------ src/pkg/dashboard/static-src/css/tracker.css | 56 +++++++----- .../static-src/js/tracker-row-layout.js | 12 ++- src/pkg/dashboard/static/index.html | 68 +++++++++------ .../testdata/tracker-header-geometry.js | 74 ++++++++++------ 7 files changed, 199 insertions(+), 104 deletions(-) create mode 100644 changelog.d/fixed-16485-tracker-row-density.md 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('
  • toolbar line); the chips now trail the PR cell (ham-head-pr / ham-head-tools) on the title line. Signed-off-by: Andrew Anderson --- src/pkg/dashboard/stage_tracker_ui_rows_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_ui_rows_test.go b/src/pkg/dashboard/stage_tracker_ui_rows_test.go index 625e2d013b..59f466e8a8 100644 --- a/src/pkg/dashboard/stage_tracker_ui_rows_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_rows_test.go @@ -29,10 +29,12 @@ assert.ok(row.includes('30m'), row); // The age and the chip belong to the strip they describe, not to a title line // that may wrap: the since text closes the strip row (an empty spacer keeps // the title line's width) and the chip is the last thing in the title line's -// ghost strip, right above the strip's cap. +// ghost strip — trailing the PR cell (ham-head-tools when there is no PR), +// right-anchored on the title line, never a toolbar line of its own. assert.ok(row.indexOf('30m') > row.indexOf('aria-label="Pipeline progress"'), 'since sits on the strip row, in line with the chevrons'); assert.ok(/aria-label="Pipeline progress">[\s\S]*?<\/ol>\s*30m<\/span>\s*<\/div>/.test(row), 'the strip row ends with the since cell'); -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(/
  • [\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.