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 = '279fb551572a2ce471e3495dd406f1f1a3de109d';
const TRUSTED_SCRIPTS_TREE = '9204e9706f4019d5be4010ae939812f00133a146';
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-monitor-phone-filter-bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The Hive activity monitor on a phone replaces its 13-control toolbar and label chips with a sticky compact filter bar (All / PRs / Issues, Needs attention, Waiting on you, ⋯ Filters) that opens the full toolbar in a modal sheet, so the first row is visible without scrolling; desktop is unchanged (#17159, part of #17158).
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 @@ -123,6 +123,8 @@ Filters run on the cached browser payload and persist across reloads, except the

**+N more** opens *All labels*, with every label and count, type-to-filter, toggles and **Clear**. Selected labels are promoted into the visible row. **Clear filters** appears whenever the view is narrowed.

**On a phone** (the `.modal-sheet` tier: ≤640px wide, or a coarse pointer up to 820px) the toolbar and label chips are not drawn above the list. The sticky bar carries a compact filter row instead — *All / PRs / Issues*, *⚠ Needs attention*, *👤 Waiting on you* (with its count) and **⋯ Filters** — beside the Merged pill, so the first row starts within about 100px of the section header. **⋯ Filters** opens a full-screen sheet holding the complete toolbar (Repo, search, Since, Author, Decisions, Sort, Group, Per page, sound) and the label chips; its badge counts the filters set in the sheet. Filters apply as you change them and stay applied when the sheet closes (**Done**, ✕, Esc or the backdrop). Desktop layout is unchanged.

Default sort is furthest along first; covered issues rank by their furthest-along PR. Within each column, attention rows precede plain rows, then held/draft rows and PRs standing for closed issues. Within a tier, longest waiting comes first, then repository and number. The same ordering applies to nested PRs and the server payload, so chat `/prs` and the hub agree. `deferred_modifiers` never promote a row.

**Sort** also offers longest waiting (tier, then wait), newest and number (no tiers). The arrow reverses column/age/repo/number keys, never attention tiers: “Attention-first within each column; arrow flips age order.” Pages offer **25 / 50 / 100** rows (default 50) and **Prev / Next**, with counts above and below.
Expand Down
24 changes: 24 additions & 0 deletions src/pkg/dashboard/static-src/css/responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@
.hive-dialog.modal-sheet > .hive-dialog-buttons { flex: 0 0 auto; margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.hive-dialog.modal-sheet > .hive-dialog-buttons .hv-btn { min-height: var(--modal-sheet-close-size); }
.hive-dialog.modal-sheet .modal-sheet-close { display: inline-flex; }
/* Activity monitor on a phone (#17159): the 13-control toolbar and
the label chips hide; the sticky bar carries the compact chips
(kind / needs attention / waiting on you / ⋯ Filters) beside the
Merged pill, and the meta line keeps only "showing N of M". The
sticky bar grows to tap height, so the column header below it
follows through --ham-sticky-bar-h. Lines naming .ham-sticky must
stay free of literal colours (stage_tracker_actor_icon_test.go). */
#activity-monitor-section { --ham-sticky-bar-h: calc(var(--tap-target) + 2 * var(--sp-1)); }
#activity-monitor-section .section-body > .ham-toolbar, #activity-monitor-section .section-body > .ham-labels { display: none; }
#activity-monitor-meta > :not(.ham-count) { display: none; }
/* The card body's overflow:hidden makes it the sticky containing
scroller; with only the meta line above the bar, sticky top would
push the bar down over the first row. overflow:clip clips without
creating a scroller, so the bar sticks to the viewport instead. */
#activity-monitor-section .dash-card-body { overflow: clip; }
.ham-sticky { justify-content: flex-start; gap: var(--sp-2); padding-left: max(var(--sp-2), var(--safe-area-left)); padding-right: max(var(--sp-2), var(--safe-area-right)); }
.ham-sticky .ham-merged-sub { display: none; }
.ham-sticky .ham-merged-count, .ham-sticky .ham-queue-chip { flex: 0 0 auto; min-height: var(--tap-target); }
.ham-compact { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; gap: var(--sp-2); }
.ham-compact-scroll { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ham-compact-scroll::-webkit-scrollbar { display: none; }
.ham-compact .ham-chips { display: inline-flex; flex: 0 0 auto; }
.ham-compact .ham-chip { flex: 0 0 auto; min-height: var(--tap-target); font-size: var(--fs-sm); white-space: nowrap; }
.ham-compact-more[data-ham-active] { background: var(--panel-strong); color: var(--text); border-color: var(--line-strong); }
}
@media (max-width: 768px) {
body {
Expand Down
17 changes: 17 additions & 0 deletions src/pkg/dashboard/static-src/css/tracker.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@
.ham-sound-file input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ham-sound-help { font-size: var(--fs-xs); margin: var(--sp-0); }
.ham-sound-volume-value { color: var(--text); font-variant-numeric: tabular-nums; }
/* Phone compact filter bar + Filters sheet (#17159). .ham-compact lives
on the sticky bar and is shown only in responsive.css's phone tier;
the sheet receives the toolbar and label chips as-is (same ids and
hamFilter actions), one control per line at tap height. Desktop
never shows either. */
.ham-compact { display: none; }
.ham-filter-sheet-body { white-space: normal; }
.ham-filter-sheet .ham-toolbar { flex-direction: column; align-items: stretch; gap: var(--sp-3); margin: 0; }
.ham-filter-sheet .ham-toolbar .ham-chips { display: flex; }
.ham-filter-sheet .ham-toolbar .ham-chips .ham-chip { flex: 1 1 0; }
.ham-filter-sheet .ham-chip { min-height: var(--tap-target); font-size: var(--fs-sm); }
.ham-filter-sheet .ham-repo-filter { display: flex; justify-content: space-between; gap: var(--sp-3); min-height: var(--tap-target); white-space: nowrap; }
.ham-filter-sheet .ham-select { flex: 1 1 auto; max-width: none; min-height: var(--tap-target); font-size: var(--fs-touch); }
.ham-filter-sheet .ham-input { flex: none; width: 100%; box-sizing: border-box; min-height: var(--tap-target); font-size: var(--fs-touch); }
.ham-filter-sheet .ham-dir { min-width: var(--tap-target); }
.ham-filter-sheet .ham-sound { margin-left: 0; }
.ham-filter-sheet .ham-labels { margin: var(--sp-3) 0 0; gap: var(--sp-2); }
.ham-labels { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-bottom: var(--sp-3); }
.ham-labels:empty { display: none; }
.ham-label-chip { font-family: var(--font-mono); }
Expand Down
16 changes: 16 additions & 0 deletions src/pkg/dashboard/static-src/html/tracker.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ <h2 class="config-title" id="activity-monitor-settings-title">Hive activity moni
<div class="ham-meta" id="activity-monitor-meta" aria-live="polite"></div>
<div class="ham-selbar" id="activity-monitor-selbar" role="toolbar" aria-label="Selected rows" hidden></div>
<div class="ham-sticky" id="activity-monitor-sticky">
<!-- Phone-only compact filter bar (#17159): the toolbar above is
hidden under the .modal-sheet tier and these chips take over;
⋯ Filters moves the toolbar and label chips into a sheet
(openStageTrackerFilterSheet). Desktop never shows this. -->
<div class="ham-compact" id="activity-monitor-compact" role="toolbar" aria-label="Quick filters">
<span class="ham-compact-scroll">
<span class="ham-chips" role="group" aria-label="Item kind">
<button type="button" class="ham-chip" data-action="hamFilter" data-arg0="kind" data-arg1="all" aria-pressed="true">All</button>
<button type="button" class="ham-chip" data-action="hamFilter" data-arg0="kind" data-arg1="pr" aria-pressed="false">PRs</button>
<button type="button" class="ham-chip" data-action="hamFilter" data-arg0="kind" data-arg1="issue" aria-pressed="false">Issues</button>
</span>
<button type="button" class="ham-chip" id="activity-monitor-compact-attention" data-action="hamFilter" data-arg0="attention" data-arg1="toggle" aria-pressed="false" title="Only items that need attention: stalled, held, blocked, needs-human, needs-decision, needs-rebase">⚠ Needs attention</button>
<button type="button" class="ham-chip ham-chip--waiting" id="activity-monitor-compact-waiting" data-action="hamFilter" data-arg0="waitingOnYou" data-arg1="toggle" aria-pressed="false" title="Only items parked on you">👤 Waiting on you<span class="ham-chip-n" hidden>0</span></button>
</span>
<button type="button" class="ham-chip ham-compact-more" id="activity-monitor-filters" data-action="openStageTrackerFilterSheet" aria-haspopup="dialog" aria-expanded="false" title="Repo, search, since, author, decisions, sort, group, per page and labels">⋯ Filters<span class="ham-chip-n" hidden>0</span></button>
</div>
<span class="ham-sticky-live" id="activity-monitor-merged-live" role="status" aria-live="polite"></span>
<button type="button" class="ham-chip ham-merged-count" id="activity-monitor-merged" data-action="hamMergedToggle" data-stop="1" aria-haspopup="dialog" aria-expanded="false" aria-controls="activity-monitor-merged-pop" title="Merged: 0 all time"><svg class="ham-merged-ico" viewBox="0 0 18 12" focusable="false" aria-hidden="true"><ellipse class="oc-version-bee-wing" cx="7" cy="3.6" rx="3" ry="1.5" transform="rotate(-18 7 3.6)"/><ellipse class="oc-version-bee-wing" cx="11" cy="3.4" rx="3" ry="1.5" transform="rotate(18 11 3.4)"/><ellipse class="oc-version-bee-body" cx="9.2" cy="7" rx="5.8" ry="3.3"/><path class="oc-version-bee-stripe" d="M7.2 4.2v5.6M10 3.8v6.4"/><circle class="oc-version-bee-head" cx="15" cy="7" r="1.7"/></svg>Merged <span class="ham-merged-n">0</span><span class="ham-merged-sub">0 today · 0 this week</span></button>
<div class="ham-merged-pop" id="activity-monitor-merged-pop" role="dialog" aria-label="Recent merges" hidden></div>
Expand Down
53 changes: 53 additions & 0 deletions src/pkg/dashboard/static-src/js/tracker-filter-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,59 @@
if (dir) { dir.textContent = f.dir === 'asc' ? '↑' : '↓'; dir.setAttribute('title', (f.dir === 'asc' ? 'Ascending — click for descending' : 'Descending — click for ascending') + STAGE_TRACKER_DIR_TIER_NOTE); }
const reset = document.getElementById('activity-monitor-reset');
if (reset) reset.hidden = !stageTrackerFilterActive(f);
stageTrackerSyncCompact(f);
}
// The phone compact bar (#17159) mirrors the kind / attention /
// waiting chips and counts the filters the sheet holds on ⋯ Filters.
function stageTrackerSyncCompact(f) {
const bar = document.getElementById('activity-monitor-compact');
if (!bar) return;
bar.querySelectorAll('.ham-chip[data-arg0="kind"]').forEach(b => b.setAttribute('aria-pressed', b.dataset.arg1 === f.kind ? 'true' : 'false'));
const att = document.getElementById('activity-monitor-compact-attention');
if (att) att.setAttribute('aria-pressed', f.attention ? 'true' : 'false');
const wait = document.getElementById('activity-monitor-compact-waiting');
if (wait) wait.setAttribute('aria-pressed', f.waitingOnYou ? 'true' : 'false');
const more = document.getElementById('activity-monitor-filters');
const n = more && more.querySelector('.ham-chip-n');
if (n) { const count = stageTrackerSheetFilterCount(f); n.textContent = String(count); n.hidden = !count; more.toggleAttribute('data-ham-active', count > 0); }
}
// ⋯ Filters: the toolbar and the label chips move, as they are, into a
// .hive-dialog.modal-sheet (same ids, same hamFilter actions, so every
// render keeps syncing them) and move back home when the sheet closes
// (Esc / ✕ / backdrop / Done via hiveWireDialog).
var _stageTrackerFilterSheetReturnFocus = null;
function openStageTrackerFilterSheet() {
if (document.getElementById('activity-monitor-filters-overlay')) return;
const toolbar = document.getElementById('activity-monitor-toolbar');
const labels = document.getElementById('activity-monitor-labels');
if (!toolbar) return;
_stageTrackerFilterSheetReturnFocus = document.activeElement;
const overlay = document.createElement('div');
overlay.id = 'activity-monitor-filters-overlay';
overlay.className = 'hive-dialog-overlay';
hiveRememberModalOpen(overlay);
overlay.innerHTML = `<div class="hive-dialog ham-filter-sheet" role="dialog" aria-modal="true" aria-labelledby="activity-monitor-filters-title">
<div id="activity-monitor-filters-title" class="hive-dialog-title">Filters</div>
<div class="hive-dialog-body modal-scroll ham-filter-sheet-body"></div>
<div class="hive-dialog-buttons"><button type="button" class="hv-btn btn-primary hive-dialog-btn primary">Done</button></div>
</div>`;
const body = overlay.querySelector('.ham-filter-sheet-body');
const homes = [toolbar, labels].filter(Boolean).map(node => {
const home = document.createComment('ham-filter-sheet-home');
node.parentNode.insertBefore(home, node);
body.appendChild(node);
return { node, home };
});
document.body.appendChild(overlay);
const more = document.getElementById('activity-monitor-filters');
if (more) more.setAttribute('aria-expanded', 'true');
hiveWireDialog(overlay, () => {
homes.forEach(({ node, home }) => { if (home.parentNode) { home.parentNode.insertBefore(node, home); home.remove(); } });
if (more) more.setAttribute('aria-expanded', 'false');
const ret = _stageTrackerFilterSheetReturnFocus;
_stageTrackerFilterSheetReturnFocus = null;
if (ret && ret.focus && document.contains(ret)) setTimeout(() => ret.focus({ preventScroll: true }), 0);
}, undefined, '.primary', null, close => close());
}

function stageTrackerLabelChipHtml(c) {
Expand Down
8 changes: 8 additions & 0 deletions src/pkg/dashboard/static-src/js/tracker-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@
return f.kind !== 'all' || !!f.repo || !!f.q || f.labels.length > 0 || f.needsHuman || f.onHold || f.waitingOnYou || f.age !== 'any' || f.author !== 'any' || f.attention || f.acted !== 'any';
}

// How many narrowing filters the phone Filters sheet holds are set:
// everything stageTrackerFilterActive counts except the kind /
// attention / waiting-on-you chips, which sit on the compact bar.
function stageTrackerSheetFilterCount(f) {
f = stageTrackerNormalizeFilter(f);
return (f.repo ? 1 : 0) + (f.q ? 1 : 0) + (f.age !== 'any' ? 1 : 0) + (f.author !== 'any' ? 1 : 0) + (f.acted !== 'any' ? 1 : 0) + f.labels.length + (f.needsHuman ? 1 : 0) + (f.onHold ? 1 : 0);
}

// Does one item pass the narrowing filters? ctx.nowMs anchors the age
// test; ctx.stages supplies the dwell for the "stale" age.
function stageTrackerMatches(item, f, ctx) {
Expand Down
3 changes: 3 additions & 0 deletions src/pkg/dashboard/static-src/js/tracker-waiting.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
}
const chip = document.getElementById('activity-monitor-waiting');
if (chip) chip.textContent = w.count ? 'Waiting on you (' + w.count + ')' : 'Waiting on you';
const compact = document.getElementById('activity-monitor-compact-waiting');
const compactN = compact && compact.querySelector('.ham-chip-n');
if (compactN) { compactN.textContent = String(w.count); compactN.hidden = !w.count; }
stageTrackerWaitingToast(w, nowMs);
}

Expand Down
Loading
Loading