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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/added-activity-monitor-landscape-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The Hive activity monitor on a landscape phone (≤500px tall, coarse pointer) uses the compact filter bar, hides the column header so the sticky stack is a single bar, and shows at most one merge banner, so rows are visible instead of chrome; portrait and desktop are unchanged (#17166, part of #17158).
2 changes: 1 addition & 1 deletion src/docs/dashboard-sections/activity-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ 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.
**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). **On a landscape phone** (coarse pointer, ≤1024px wide and ≤500px tall) the same compact bar is used, the column header is hidden so the sticky stack is the bar alone, and merge banners are capped to one with a *+N more* pill. 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.

Expand Down
8 changes: 8 additions & 0 deletions src/pkg/dashboard/stage_tracker_cues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ func stageTrackerCelebrateJS(t *testing.T, html string) string {
jsConstLine(t, html, "STAGE_TRACKER_MERGE_BANNER_MAX"),
jsConstLine(t, html, "STAGE_TRACKER_MERGE_BANNER_PHONE_MAX"),
jsConstLine(t, html, "STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY"),
jsConstLine(t, html, "STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_MAX"),
jsConstLine(t, html, "STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY"),
jsConstLine(t, html, "STAGE_TRACKER_SOUND_MAX_PLAYS"),
jsFunc(t, html, "stageTrackerCelebrateSetting"),
jsFunc(t, html, "stageTrackerSetCelebrate"),
Expand Down Expand Up @@ -378,7 +380,9 @@ func stageTrackerCelebrateJS(t *testing.T, html string) string {
jsFunc(t, html, "toastCountdownCancel"),
jsFunc(t, html, "stageTrackerMergeBanner"),
jsFunc(t, html, "stageTrackerMergeBannerList"),
jsFunc(t, html, "stageTrackerMergeBannerMatches"),
jsFunc(t, html, "stageTrackerMergeBannerIsPhone"),
jsFunc(t, html, "stageTrackerMergeBannerCap"),
jsFunc(t, html, "stageTrackerMergeBannerLayout"),
jsFunc(t, html, "stageTrackerMergeBannerDismiss"),
jsFunc(t, html, "hamBannerOpenLink"),
Expand Down Expand Up @@ -727,6 +731,10 @@ stageTrackerMergeBannerDismiss(phone[4]); tick(180 * 1.5 + 1);
assert.strictEqual(shown().length, STAGE_TRACKER_MERGE_BANNER_PHONE_MAX, 'a dismissal reveals the next oldest'); assert.strictEqual(banners.querySelector('.merge-banner-more').textContent, '+1 more');
stageTrackerMergeBannerDismiss(phone[3]); tick(180 * 1.5 + 1);
assert.strictEqual(hid().length, 0); assert.strictEqual(banners.querySelector('.merge-banner-more'), null, 'no pill once everything fits');
// Landscape phone: one banner at a time, the rest behind the pill.
window.matchMedia = q => ({ matches: q === STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY });
stageTrackerMergeBannerLayout(banners);
assert.strictEqual(shown().length, STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_MAX, 'a landscape phone shows one banner'); assert.strictEqual(banners.querySelector('.merge-banner-more').textContent, '+2 more');
delete window.matchMedia;
stageTrackerMergeBannerLayout(banners); assert.strictEqual(hid().length, 0, 'a desktop hides nothing');
console.log('ok');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ const src = [
pick(/const STAGE_TRACKER_MERGE_BANNER_MAX = [^\n]*\n/, 'STAGE_TRACKER_MERGE_BANNER_MAX'),
pick(/const STAGE_TRACKER_MERGE_BANNER_PHONE_MAX = [^\n]*\n/, 'STAGE_TRACKER_MERGE_BANNER_PHONE_MAX'),
pick(/const STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY = [^\n]*\n/, 'STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY'),
pick(/const STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_MAX = [^\n]*\n/, 'STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_MAX'),
pick(/const STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY = [^\n]*\n/, 'STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY'),
pick(/function toastCountdownBar\(el, ms, onExpire\) \{[\s\S]*?\n \}\n/, 'toastCountdownBar'),
pick(/function toastCountdownCancel\(el\) \{[\s\S]*?\n \}\n/, 'toastCountdownCancel'),
pick(/function stageTrackerMergeBannerNumber\(b\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBannerNumber'),
Expand All @@ -82,6 +84,8 @@ const src = [
pick(/function stageTrackerMergeBannerText\(b, nowMs\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBannerText'),
pick(/function stageTrackerMergeBanner\(b\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBanner'),
pick(/function stageTrackerMergeBannerList\(box\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBannerList'),
pick(/function stageTrackerMergeBannerMatches\(query\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBannerMatches'),
pick(/function stageTrackerMergeBannerCap\(\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBannerCap'),
pick(/function stageTrackerMergeBannerIsPhone\(\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBannerIsPhone'),
pick(/function stageTrackerMergeBannerLayout\(box\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBannerLayout'),
pick(/function stageTrackerMergeBannerDismiss\(el\) \{[\s\S]*?\n \}\n/, 'stageTrackerMergeBannerDismiss'),
Expand Down
21 changes: 21 additions & 0 deletions src/pkg/dashboard/static-src/css/responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,27 @@
textarea {
font-size: var(--fs-touch) !important;
}
/* Activity monitor on a landscape phone (#17166): ~390px of height.
The toolbar and label chips collapse into the compact filter bar
exactly as on a portrait phone (#17159), the column header hides
so the sticky stack is the bar alone (≤100px); the notch is
already honoured by this tier's body padding. 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; }
#activity-monitor-section .dash-card-body { overflow: clip; }
#activity-monitor-panel .ham-cols { display: none; }
.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); }
}
/* Touch phones use one full-screen chat layout in either orientation.
Desktop docking/resizing controls do not apply to this layout. */
Expand Down
27 changes: 21 additions & 6 deletions src/pkg/dashboard/static-src/js/tracker-merged.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@
// are visible at once; the older ones wait behind a "+N more" pill.
const STAGE_TRACKER_MERGE_BANNER_PHONE_MAX = 3;
const STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY = '(max-width: 480px)';
// A landscape phone (responsive.css's landscape tier) has ~390px of
// height; one banner at a time, the rest behind the pill (#17166).
const STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_MAX = 1;
const STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY = '(max-width: 1024px) and (max-height: 500px) and (orientation: landscape) and (pointer: coarse)';
function stageTrackerCelebrateSetting() {
try { return localStorage.getItem(STAGE_TRACKER_CELEBRATE_KEY) !== '0'; } catch { return true; }
}
Expand Down Expand Up @@ -1231,14 +1235,25 @@
function stageTrackerMergeBannerList(box) {
return Array.prototype.filter.call(box.children, c => c.classList && c.classList.contains('merge-banner'));
}
function stageTrackerMergeBannerMatches(query) {
return typeof window !== 'undefined' && typeof window.matchMedia === 'function' && !!window.matchMedia(query).matches;
}
function stageTrackerMergeBannerIsPhone() {
return typeof window !== 'undefined' && typeof window.matchMedia === 'function' && !!window.matchMedia(STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY).matches;
return stageTrackerMergeBannerMatches(STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY);
}
// Pure: how many banners may show at once for the current viewport.
function stageTrackerMergeBannerCap() {
if (stageTrackerMergeBannerMatches(STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY)) return STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_MAX;
if (stageTrackerMergeBannerIsPhone()) return STAGE_TRACKER_MERGE_BANNER_PHONE_MAX;
return Infinity;
}
// Crossing the phone breakpoint (a rotation, a resized window) re-lays
// the stack so hidden banners come back or the pill appears.
// Crossing the phone or landscape breakpoint (a rotation, a resized
// window) re-lays the stack so hidden banners come back or the pill appears.
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
const mq = window.matchMedia(STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY);
if (mq && typeof mq.addEventListener === 'function') mq.addEventListener('change', () => stageTrackerMergeBannerLayout(document.getElementById('merge-banners')));
for (const query of [STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY, STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY]) {
const mq = window.matchMedia(query);
if (mq && typeof mq.addEventListener === 'function') mq.addEventListener('change', () => stageTrackerMergeBannerLayout(document.getElementById('merge-banners')));
}
}
// Pure-ish: on a phone keep the newest PHONE_MAX banners visible and hide
// the older ones behind a "+N more" pill (which opens the Merged list);
Expand All @@ -1247,7 +1262,7 @@
function stageTrackerMergeBannerLayout(box) {
if (!box) return;
const banners = stageTrackerMergeBannerList(box);
const cap = stageTrackerMergeBannerIsPhone() ? STAGE_TRACKER_MERGE_BANNER_PHONE_MAX : Infinity;
const cap = stageTrackerMergeBannerCap();
const hiddenCount = Math.max(0, banners.length - cap);
banners.forEach((el, i) => { if (i < hiddenCount) el.setAttribute('hidden', ''); else el.removeAttribute('hidden'); });
let more = box.querySelector('.merge-banner-more');
Expand Down
48 changes: 42 additions & 6 deletions src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6593,6 +6593,27 @@
textarea {
font-size: var(--fs-touch) !important;
}
/* Activity monitor on a landscape phone (#17166): ~390px of height.
The toolbar and label chips collapse into the compact filter bar
exactly as on a portrait phone (#17159), the column header hides
so the sticky stack is the bar alone (≤100px); the notch is
already honoured by this tier's body padding. 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; }
#activity-monitor-section .dash-card-body { overflow: clip; }
#activity-monitor-panel .ham-cols { display: none; }
.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); }
}
/* Touch phones use one full-screen chat layout in either orientation.
Desktop docking/resizing controls do not apply to this layout. */
Expand Down Expand Up @@ -25656,6 +25677,10 @@ <h2 class="config-title" id="activity-monitor-labels-title">All labels</h2>
// are visible at once; the older ones wait behind a "+N more" pill.
const STAGE_TRACKER_MERGE_BANNER_PHONE_MAX = 3;
const STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY = '(max-width: 480px)';
// A landscape phone (responsive.css's landscape tier) has ~390px of
// height; one banner at a time, the rest behind the pill (#17166).
const STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_MAX = 1;
const STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY = '(max-width: 1024px) and (max-height: 500px) and (orientation: landscape) and (pointer: coarse)';
function stageTrackerCelebrateSetting() {
try { return localStorage.getItem(STAGE_TRACKER_CELEBRATE_KEY) !== '0'; } catch { return true; }
}
Expand Down Expand Up @@ -26495,14 +26520,25 @@ <h2 class="config-title" id="activity-monitor-labels-title">All labels</h2>
function stageTrackerMergeBannerList(box) {
return Array.prototype.filter.call(box.children, c => c.classList && c.classList.contains('merge-banner'));
}
function stageTrackerMergeBannerMatches(query) {
return typeof window !== 'undefined' && typeof window.matchMedia === 'function' && !!window.matchMedia(query).matches;
}
function stageTrackerMergeBannerIsPhone() {
return typeof window !== 'undefined' && typeof window.matchMedia === 'function' && !!window.matchMedia(STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY).matches;
return stageTrackerMergeBannerMatches(STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY);
}
// Pure: how many banners may show at once for the current viewport.
function stageTrackerMergeBannerCap() {
if (stageTrackerMergeBannerMatches(STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY)) return STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_MAX;
if (stageTrackerMergeBannerIsPhone()) return STAGE_TRACKER_MERGE_BANNER_PHONE_MAX;
return Infinity;
}
// Crossing the phone breakpoint (a rotation, a resized window) re-lays
// the stack so hidden banners come back or the pill appears.
// Crossing the phone or landscape breakpoint (a rotation, a resized
// window) re-lays the stack so hidden banners come back or the pill appears.
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
const mq = window.matchMedia(STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY);
if (mq && typeof mq.addEventListener === 'function') mq.addEventListener('change', () => stageTrackerMergeBannerLayout(document.getElementById('merge-banners')));
for (const query of [STAGE_TRACKER_MERGE_BANNER_PHONE_QUERY, STAGE_TRACKER_MERGE_BANNER_LANDSCAPE_QUERY]) {
const mq = window.matchMedia(query);
if (mq && typeof mq.addEventListener === 'function') mq.addEventListener('change', () => stageTrackerMergeBannerLayout(document.getElementById('merge-banners')));
}
}
// Pure-ish: on a phone keep the newest PHONE_MAX banners visible and hide
// the older ones behind a "+N more" pill (which opens the Merged list);
Expand All @@ -26511,7 +26547,7 @@ <h2 class="config-title" id="activity-monitor-labels-title">All labels</h2>
function stageTrackerMergeBannerLayout(box) {
if (!box) return;
const banners = stageTrackerMergeBannerList(box);
const cap = stageTrackerMergeBannerIsPhone() ? STAGE_TRACKER_MERGE_BANNER_PHONE_MAX : Infinity;
const cap = stageTrackerMergeBannerCap();
const hiddenCount = Math.max(0, banners.length - cap);
banners.forEach((el, i) => { if (i < hiddenCount) el.setAttribute('hidden', ''); else el.removeAttribute('hidden'); });
let more = box.querySelector('.merge-banner-more');
Expand Down
Loading
Loading