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
2 changes: 1 addition & 1 deletion .github/scripts/integration-governance.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const MAX_COMMITS = 1000;
const MAX_AUTHOR_BATCH = 50;
// This literal is inside the enrolled .github closure. A caller-supplied
// preparedBy.sourceSHA must never choose a new executable verifier tree.
const TRUSTED_SCRIPTS_TREE = '8cf9edcab6cfbe4e8a847b03209cbca0c604889f';
const TRUSTED_SCRIPTS_TREE = 'c6b5ba0094fcd1304b391315b196b44f4cc77633';
const SOURCE = 'https://github.com/kubernetes-sigs/kubebuilder-release-tools/tree/012269a88fa4c034a0acf1ba84c26b195c0dbab4';
const sha = value => crypto.createHash('sha256').update(value).digest('hex');
const git = (args, cwd = process.cwd()) =>
Expand Down
1 change: 1 addition & 0 deletions changelog.d/added-activity-phone-progress-pill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Dashboard: on phones the Activity monitor row shows a stage-coloured "Step 7/8 · Merge queue · 2h" progress pill in place of the chevron strip; tapping it opens the full strip in a sheet, and the sticky column header is hidden with the strip (hivecommons/hive#17160).
2 changes: 2 additions & 0 deletions src/docs/dashboard-sections/activity-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ The reason, actor, nudges, repository, flags and recent stage hops live on the `

Reduced-motion preferences disable animation; needs-human remains steadily red. Icons do not rotate. Movement animation and the newer working cues have their own settings/reference below.

**On a phone** (≤640px, or a touch screen up to 820px) the eight chevrons do not fit a row, so each row shows a single **progress pill** in their place — `Step 7/8 · Merge queue · 2h`: the lit chevron's position counted as drawn (CI and Review are two steps; a nested PR row counts only its own PR columns), its word and the time on step. The pill takes the strip's colour: amber for a steady or working stage, green once merged, the amber→red needs-human tint when a person must move. The sticky column header is hidden with the strip. Tapping the pill opens the full chevron strip, the `since` age, the current-stage caption and the lit chevron's hover text in a full-screen sheet (✕, Esc or *Close*); the strip scrolls sideways inside the sheet if it has to. When a row moves between refreshes the pill flashes once instead of the chevron-to-chevron movement animation. At 1280 and in phone landscape wider than 820px the strip is drawn exactly as before ([#17160](https://github.com/hivecommons/hive/issues/17160)).

### Payload freshness and stage-engine reference

The view is fed by `GET /api/stage-tracker`. Without a stage or journal entry an item is in the Open column; a not-yet-placed item can read **New** as described [below](#new-row-000-new-the-pre-stage-state). Scanner buckets can place unlabeled claimed→020, in-progress→030 and covered→040 work.
Expand Down
36 changes: 34 additions & 2 deletions src/pkg/dashboard/stage_tracker_activity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,40 @@ test('known and original chevrons keep full long text inside a shared one-line c
assert.doesNotMatch(css, /\.ham-(?:seg-t|detour)\.ham-has-holder[^}]*white-space: nowrap/);
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; \}/);
// Phone tier (hivecommons/hive#17160): the strip no longer scrolls
// sideways; it is hidden behind the progress pill, which opens it in a
// sheet. Outside the tier the pill has no box, so 1280 is untouched.
assert.doesNotMatch(css, /--ham-compact-min-width/);
assert.match(css, /^\s*\.ham-pill \{ display: none; \}/m);
assert.match(css, /@media \(max-width: 640px\), \(\(pointer: coarse\) and \(max-width: 820px\)\) \{\s*\.ham-cols \{ display: none; \}\s*\.ham-row > \.ham-strip-row > \.ham-strip, \.ham-sub > \.ham-strip-row > \.ham-strip,/);
assert.match(css, /\.ham-pill \{ display: inline-flex;[^}]*min-height: var\(--control-compact-min-h\);[^}]*font-size: var\(--fs-sm\);/);
assert.match(css, /\.ham-pill::before \{ content: ""; position: absolute; inset: calc\(\(var\(--control-compact-min-h\) - var\(--tap-target\)\) \/ 2\) 0; \}/);
assert.match(css, /\.ham-pill\[data-motion="needs-human"\] \{ background: color-mix\(in srgb, var\(--amber\) 45%, var\(--red\)\);/);
});

test('phone progress pill names the step, stage and age and opens the strip sheet (#17160)', () => {
const layout = fs.readFileSync(path.join(root, 'tracker-row-layout.js'), 'utf8');
const pillHtml = new Function('esc', 'stageTrackerSegments', 'stageTrackerShortAgo', globals + `
const STAGE_TRACKER_MOTION_STATIC = 'static', STAGE_TRACKER_MOTION_HUMAN = 'needs-human';
function stageTrackerMotion(item) { return (item.modifiers || []).includes('needs-human') ? STAGE_TRACKER_MOTION_HUMAN : STAGE_TRACKER_MOTION_STATIC; }
function stageTrackerItemKey(it) { return it.repo + '/' + it.kind + '#' + it.number; }
function stageTrackerOpenSince() { return { ms: 0 }; }
` + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(layout, 'stageTrackerSinceHtml') + fn(strip, 'stageTrackerPillHtml') + ';return stageTrackerPillHtml;')(esc, segments, ms => Math.round(ms / 3600000) + 'h');
const pillStages = [{ number: 80, short: 'Merge queue' }, { number: 30, short: 'PR in progress' }, { number: 85, short: 'Needs human decision', branch_from: 80 }].concat(stages.filter(st => st.number !== 85));
const since = new Date(now - 2 * 3600 * 1000).toISOString();
const pill = pillHtml(livePR({ repo: 'org/repo', number: 7, stage: 85, display_column: 80, stage_since: since, modifiers: ['needs-human'] }), pillStages, null, now, {});
assert.match(pill, /^<button type="button" class="ham-pill" data-motion="needs-human" data-action="stageTrackerPillSheet" data-arg0="org\/repo\/pr#7" data-stop="1" aria-label="Step 7\/8 · Needs human decision · 2h — show pipeline steps">/);
assert.match(pill, /<span class="ham-pill-step">Step 7\/8<\/span><span class="ham-pill-label">Needs human decision<\/span><span class="ham-pill-since">2h<\/span><\/button>$/, 'column 50 counts as two chevrons (CI, Review), so the merge queue is step 7 of 8');
const sub = pillHtml(livePR({ repo: 'org/repo', number: 8, stage: 30, display_column: 30, stage_since: since }), pillStages, { from: 30 }, now, {});
assert.match(sub, /data-motion="static"[^>]*>.*Step 1\/5</, 'a nested PR row counts only its own chevrons');
const reviewing = pillHtml(livePR({ repo: 'org/repo', number: 9, review_activity: activity('reviewing', 'Review working', true) }), pillStages, null, now, {});
assert.match(reviewing, /Step 6\/8</, 'only Review running lights the second column-50 chevron');
assert.equal(pillHtml(livePR({ repo: 'org/repo', number: 10, stage: 30, superseded: { closer_pr: 11 } }), pillStages, null, now, {}), '', 'a superseded original has no pill');
const render = fs.readFileSync(path.join(root, 'tracker-row-render.js'), 'utf8');
assert.match(render, /\$\{stageTrackerSinceHtml\(shown, nowMs\)\}\$\{typeof stageTrackerPillHtml === 'function' \? stageTrackerPillHtml\(shown, stages, range, nowMs, ctx\) : ''\}\s*<\/div>/, 'the row pill sits in the strip row after the since age');
assert.match(layout, /\$\{stageTrackerSinceHtml\(pr, nowMs\)\}\$\{typeof stageTrackerPillHtml === 'function' \? stageTrackerPillHtml\(pr, stages, \{ from: STAGE_TRACKER_PR_COLUMN \}, nowMs, ctx\) : ''\}/, 'the nested PR pill is scoped to the PR columns');
const motion = fs.readFileSync(path.join(root, 'tracker-motion.js'), 'utf8');
assert.match(fn(motion, 'stageTrackerAnimateMove'), /typeof strip.getClientRects === 'function' && !strip.getClientRects\(\).length[^]*?'ham-pill-moved'[^]*?return true;/, 'a hidden strip plays the move cue on the pill instead of the overlay');
});

test('a 071/072 row with a pushed or checking head keeps its running CI track lit (#16552)', () => {
Expand Down
42 changes: 38 additions & 4 deletions src/pkg/dashboard/static-src/css/tracker.css
Original file line number Diff line number Diff line change
Expand Up @@ -923,11 +923,45 @@
.ham-cols .ham-seg { padding: 0 var(--sp-2) 0 var(--sp-3); }
.ham-cols .ham-seg.cap { flex-basis: 2em; }
}
@media (max-width: 640px) {
#activity-monitor-panel { --ham-compact-min-width: 60em; }
.ham-row > .ham-strip-row, .ham-sub > .ham-strip-row, .ham-cols > .ham-strip-row { overflow-x: auto; }
.ham-row > .ham-strip-row > .ham-strip, .ham-sub > .ham-strip-row > .ham-strip, .ham-cols > .ham-strip-row > .ham-strip { min-width: var(--ham-compact-min-width); }
/* Phone progress pill (hivecommons/hive#17160). Outside the phone tier
the pill does not exist for layout: the strip, its anim layer and the
sticky column header are exactly what they are at 1280. Inside it the
chevron strip, the since-age and .ham-cols are hidden and the pill
("Step 7/9 · Merge queue · 2h", stage-coloured, ≥ --tap-target tall)
stands in; tapping it opens the full strip in a modal sheet. */
.ham-pill { display: none; }
@media (max-width: 640px), ((pointer: coarse) and (max-width: 820px)) {
.ham-cols { display: none; }
.ham-row > .ham-strip-row > .ham-strip, .ham-sub > .ham-strip-row > .ham-strip,
.ham-row > .ham-strip-row > .ham-since, .ham-sub > .ham-strip-row > .ham-since,
.ham-row > .ham-strip-row > .ham-anim-layer, .ham-sub > .ham-strip-row > .ham-anim-layer { display: none; }
.ham-row > .ham-strip-row, .ham-sub > .ham-strip-row { overflow: hidden; min-width: 0; }
.ham-pill { display: inline-flex; position: relative; align-items: center; gap: var(--sp-2); max-width: 100%; min-height: var(--control-compact-min-h); padding: var(--sp-1) var(--sp-3); border: 0; border-radius: var(--r-pill); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.2; text-align: left; cursor: pointer; background: var(--amber); color: var(--surface-0); -webkit-tap-highlight-color: transparent; }
/* The box stays at the compact control height so a nested-PR row fits a 667px phone; the hit
area is padded out to the tap target. */
.ham-pill::before { content: ""; position: absolute; inset: calc((var(--control-compact-min-h) - var(--tap-target)) / 2) 0; }
.ham-pill > span { min-width: 0; white-space: nowrap; }
.ham-pill .ham-pill-step { flex: 0 0 auto; opacity: .85; font-variant-numeric: tabular-nums; }
.ham-pill .ham-pill-label { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.ham-pill .ham-pill-since { flex: 0 0 auto; opacity: .85; font-variant-numeric: tabular-nums; }
.ham-pill .ham-pill-label::before, .ham-pill .ham-pill-since::before { content: "· "; opacity: .7; }
.ham-pill[data-motion="static"] { background: color-mix(in srgb, var(--amber) 70%, var(--panel)); }
.ham-pill[data-motion="needs-human"] { background: color-mix(in srgb, var(--amber) 45%, var(--red)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 55%, transparent); }
.ham-pill[data-motion="merged"] { background: var(--green); }
.ham-pill:focus-visible { outline: 2px solid var(--focus-ring, var(--accent)); outline-offset: 2px; }
.ham-pill.ham-pill-moved { animation: ham-pill-moved .45s ease-out 1; }
}
@keyframes ham-pill-moved { 0% { transform: scale(.94); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
/* The sheet opened from the pill carries a copy of the row's strip; the
phone rules above hide a strip that sits in a row, so this one is put
back and scrolls sideways when eight chevrons outgrow the sheet. */
.ham-pill-sheet .ham-pill-sheet-strip { overflow-x: auto; padding-bottom: var(--sp-2); }
.ham-pill-sheet .ham-strip-row { display: flex; align-items: center; gap: var(--sp-2); min-width: 32em; overflow: visible; }
.ham-pill-sheet .ham-strip-row > .ham-strip, .ham-pill-sheet .ham-strip-row > .ham-since { display: flex; }
.ham-pill-sheet .ham-strip-row > .ham-strip { display: grid; }
.ham-pill-sheet .ham-pill-sheet-caption { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--text); }
.ham-pill-sheet .ham-pill-sheet-tip { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--text-muted); white-space: pre-line; }
@media (prefers-reduced-motion: reduce) { .ham-pill.ham-pill-moved { animation: none; } }
/* Movement animation: when an item's lit chevron changes column between
two refreshes, the chosen effect (settings gear → Movement animation)
plays once on that row. Overlays live in .ham-anim-layer, an absolute
Expand Down
13 changes: 13 additions & 0 deletions src/pkg/dashboard/static-src/js/tracker-motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,19 @@
if (!fn || !strip || from === to) return false;
const dest = strip.children[to], src = strip.children[from];
if (!dest || !src || dest.classList.contains('blank')) return false;
// Phone tier (hivecommons/hive#17160): the strip is display:none and
// the progress pill stands in for it, so the overlay has no geometry
// to play against. One flash on the pill is the whole cue; the
// chevrons already show the new state when the sheet opens. Guarded
// for the test stub strip, which has no getClientRects.
if (typeof strip.getClientRects === 'function' && !strip.getClientRects().length) {
const pill = strip.parentElement && strip.parentElement.querySelector ? strip.parentElement.querySelector(':scope > .ham-pill') : null;
if (pill) {
pill.classList.add('ham-pill-moved');
stageTrackerAfter(pill, 'animationend', STAGE_TRACKER_MOVE_MS, () => pill.classList.remove('ham-pill-moved'));
}
return true;
}
stageTrackerAnimLayer(strip).innerHTML = '';
const plan = stageTrackerMovePlan(effect, stageTrackerAnimScale(strip));
strip.dataset.hamPhase = 'flash';
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/static-src/js/tracker-row-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
<div class="ham-strip-row">
${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(pr, stages, ctx) : ''}
<ol class="ham-strip" aria-label="Pipeline progress"${stageTrackerMoveAttrs(stageTrackerItemKey(pr), ctx)}>${stageTrackerStripItems(pr, stages, { from: STAGE_TRACKER_PR_COLUMN }, nowMs, ctx)}</ol>
${stageTrackerSinceHtml(pr, nowMs)}
${stageTrackerSinceHtml(pr, nowMs)}${typeof stageTrackerPillHtml === 'function' ? stageTrackerPillHtml(pr, stages, { from: STAGE_TRACKER_PR_COLUMN }, nowMs, ctx) : ''}
</div>
${humanNote}${stageTrackerCurrentStageHtml(pr, stages, { from: STAGE_TRACKER_PR_COLUMN })}${typeof stageTrackerPreparationCommentHtml === 'function' ? stageTrackerPreparationCommentHtml(pr, noteCtx, subKey) : typeof stageTrackerEventHtml === 'function' ? stageTrackerEventHtml(subKey, noteCtx) : ''}${typeof stageTrackerExecutionHtml === 'function' ? stageTrackerExecutionHtml(pr) : ''}
</div>`;
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/static-src/js/tracker-row-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<div class="ham-strip-row">
${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(item, stages, ctx) : ''}
<ol class="ham-strip" aria-label="Pipeline progress"${stageTrackerMoveAttrs(stageTrackerItemKey(item), ctx)}>${stageTrackerStripItems(shown, stages, range, nowMs, ctx)}</ol>
${stageTrackerSinceHtml(shown, nowMs)}
${stageTrackerSinceHtml(shown, nowMs)}${typeof stageTrackerPillHtml === 'function' ? stageTrackerPillHtml(shown, stages, range, nowMs, ctx) : ''}
</div>${humanNote}${stageTrackerCurrentStageHtml(shown, stages, range, nowMs)}${typeof stageTrackerPreparationCommentHtml === 'function' ? stageTrackerPreparationCommentHtml(shown, noteCtx, rowKey) : typeof stageTrackerEventHtml === 'function' ? stageTrackerEventHtml(rowKey, noteCtx) : ''}${typeof stageTrackerExecutionHtml === 'function' ? stageTrackerExecutionHtml(shown) : ''}${typeof stageTrackerReviewNotesHtml === 'function' ? stageTrackerReviewNotesHtml(item, ctx) : ''}${subs}
</div>`;
}
Expand Down
Loading
Loading