From cb6594e7e253687a22e189a6decb91017f79d07a Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 7 Nov 2026 19:59:24 -0700 Subject: [PATCH 1/3] dashboard: landscape-phone tier for the Activity monitor On a landscape phone (coarse pointer, <=1024px wide, <=500px tall) the Activity monitor now reuses the compact filter bar from #17159, hides the .ham-cols column header so the sticky stack is the bar alone (44px), and caps merge banners to one with a +N more pill. Before this the toolbar, labels, sticky bar and column header consumed ~215px of a 390px-tall viewport and no row was visible. The phone chrome probe covers the landscape tier as well: sticky stack <=100px, column header hidden, <=1 visible banner, >=2 rows starting inside the viewport. Portrait phone and desktop are unchanged (1280 DOM rects identical). Fixes #17166 Part of #17158 Signed-off-by: Andrew Anderson --- .../added-activity-monitor-landscape-phone.md | 1 + .../dashboard-sections/activity-monitor.md | 2 +- src/pkg/dashboard/stage_tracker_cues_test.go | 8 ++++ .../dashboard/static-src/css/responsive.css | 21 ++++++++ .../dashboard/static-src/js/tracker-merged.js | 27 ++++++++--- src/pkg/dashboard/static/index.html | 48 ++++++++++++++++--- .../testdata/tracker-phone-chrome.js | 38 +++++++++++---- 7 files changed, 123 insertions(+), 22 deletions(-) create mode 100644 changelog.d/added-activity-monitor-landscape-phone.md diff --git a/changelog.d/added-activity-monitor-landscape-phone.md b/changelog.d/added-activity-monitor-landscape-phone.md new file mode 100644 index 0000000000..7f62ac197c --- /dev/null +++ b/changelog.d/added-activity-monitor-landscape-phone.md @@ -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). diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index 79dd05318f..b2acc1c2c3 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -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. diff --git a/src/pkg/dashboard/stage_tracker_cues_test.go b/src/pkg/dashboard/stage_tracker_cues_test.go index b0fd6c99b2..025fc98159 100644 --- a/src/pkg/dashboard/stage_tracker_cues_test.go +++ b/src/pkg/dashboard/stage_tracker_cues_test.go @@ -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"), @@ -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"), @@ -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'); diff --git a/src/pkg/dashboard/static-src/css/responsive.css b/src/pkg/dashboard/static-src/css/responsive.css index 843619c00f..a295a1fb0b 100644 --- a/src/pkg/dashboard/static-src/css/responsive.css +++ b/src/pkg/dashboard/static-src/css/responsive.css @@ -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. */ diff --git a/src/pkg/dashboard/static-src/js/tracker-merged.js b/src/pkg/dashboard/static-src/js/tracker-merged.js index 55a3b498bb..22490ef178 100644 --- a/src/pkg/dashboard/static-src/js/tracker-merged.js +++ b/src/pkg/dashboard/static-src/js/tracker-merged.js @@ -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; } } @@ -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); @@ -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'); diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 3d5bea1c5c..235d9e903a 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -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. */ @@ -25656,6 +25677,10 @@

All labels

// 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; } } @@ -26495,14 +26520,25 @@

All labels

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); @@ -26511,7 +26547,7 @@

All labels

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'); diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js b/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js index 5504e73cdd..628b666a15 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js @@ -4,8 +4,11 @@ // between the section header and the first row stays short enough that a // row is visible without scrolling (a fixture row is a whole work-item // cluster, so a tall first row only has to show its header line), and the -// β‹― Filters sheet carries the full toolbar and returns it on close. Desktop and landscape return a -// skip marker; they are covered elsewhere. Restores scroll positions. +// β‹― Filters sheet carries the full toolbar and returns it on close. On a +// landscape phone (the responsive.css landscape tier) the same compact bar +// is the whole sticky stack (column header hidden), merge banners are +// capped to one and at least two rows start inside the viewport. Desktop +// returns a skip marker. Restores scroll positions. (async ({ dedicatedPreview = false } = {}) => { if (!dedicatedPreview) throw new Error('Use a dedicated published-preview tab, not the user’s live dashboard'); const phoneMaxWidth = 640; @@ -16,8 +19,9 @@ const rect = el => el.getBoundingClientRect(); const visible = el => !!(el && el.getClientRects().length && getComputedStyle(el).display !== 'none'); const frames = async (n) => { for (let i = 0; i < n; i++) await new Promise(requestAnimationFrame); }; - if (innerWidth > phoneMaxWidth) return { skipped: 'not a phone-width viewport', viewport: innerWidth }; - if (innerWidth > innerHeight) return { skipped: 'landscape phone is covered by its own tier probe', viewport: innerWidth }; + const landscape = matchMedia('(max-width: 1024px) and (max-height: 500px) and (orientation: landscape) and (pointer: coarse)').matches; + if (!landscape && innerWidth > phoneMaxWidth) return { skipped: 'not a phone-width viewport', viewport: innerWidth }; + const tier = landscape ? 'landscape phone' : 'portrait phone'; const section = document.getElementById('activity-monitor-section'); const header = section && section.querySelector('.dash-card-header'); @@ -33,10 +37,10 @@ const toolbar = document.getElementById('activity-monitor-toolbar'); const labels = document.getElementById('activity-monitor-labels'); const more = document.getElementById('activity-monitor-filters'); - assert(visible(compact), 'compact filter bar is shown on a portrait phone'); - assert(toolbar && !visible(toolbar), 'full toolbar is hidden behind the Filters sheet on a portrait phone'); - assert(labels && !visible(labels), 'label chips are hidden behind the Filters sheet on a portrait phone'); - assert(visible(more), 'β‹― Filters button is shown on a portrait phone'); + assert(visible(compact), 'compact filter bar is shown on a ' + tier); + assert(toolbar && !visible(toolbar), 'full toolbar is hidden behind the Filters sheet on a ' + tier); + assert(labels && !visible(labels), 'label chips are hidden behind the Filters sheet on a ' + tier); + assert(visible(more), 'β‹― Filters button is shown on a ' + tier); const chips = compact ? [...compact.querySelectorAll('.ham-chip')] : []; assert(chips.length >= 5, 'compact bar carries kind, needs-attention and waiting-on-you chips'); for (const chip of chips) { @@ -68,8 +72,24 @@ if (sticky) { measurements.stickyHeight = Math.round(rect(sticky).height); const cols = panel.querySelector('.ham-cols'); - measurements.colsHeight = cols ? Math.round(rect(cols).height) : 0; + measurements.colsHeight = cols && visible(cols) ? Math.round(rect(cols).height) : 0; assert(measurements.stickyHeight + measurements.colsHeight <= 100, 'sticky bar plus column header stays within 100px'); + if (landscape) assert(!cols || !visible(cols), 'column header is hidden on a landscape phone'); + } + if (landscape) { + assert(typeof stageTrackerMergeBannerCap === 'function' && stageTrackerMergeBannerCap() === 1, 'merge banners are capped to one on a landscape phone'); + const banners = [...document.querySelectorAll('.merge-banner')].filter(visible); + assert(banners.length <= 1, 'at most one merge banner is visible on a landscape phone'); + if (sticky && rows.length) { + // Rows are taller than a landscape phone; the contract is that + // rows start inside the viewport once the bar is at the top. + sticky.scrollIntoView({ block: 'start', behavior: 'instant' }); + await frames(3); + measurements.rowsStartingInViewport = rows.filter(row => { const box = rect(row); return box.top >= navbar - 1 && box.top < innerHeight; }).length; + assert(measurements.rowsStartingInViewport >= 2, 'at least two rows start inside the viewport on a landscape phone (' + measurements.rowsStartingInViewport + ')'); + header.scrollIntoView({ block: 'start', behavior: 'instant' }); + await frames(2); + } } assert(typeof openStageTrackerFilterSheet === 'function', 'openStageTrackerFilterSheet is wired'); From cf7869b978c804f4d60cffac41be4f5dc2b1d969 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 7 Nov 2026 20:05:28 -0700 Subject: [PATCH 2/3] dashboard: extract the landscape banner cap helpers in the countdown test stageTrackerMergeBannerLayout now calls stageTrackerMergeBannerCap, so the node test that lifts the banner functions out of tracker-merged.js needs the Matches/Cap helpers and the landscape consts too. Signed-off-by: Andrew Anderson --- .../dashboard/stage_tracker_merge_banner_countdown.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pkg/dashboard/stage_tracker_merge_banner_countdown.test.js b/src/pkg/dashboard/stage_tracker_merge_banner_countdown.test.js index 1764060427..4d353b1350 100644 --- a/src/pkg/dashboard/stage_tracker_merge_banner_countdown.test.js +++ b/src/pkg/dashboard/stage_tracker_merge_banner_countdown.test.js @@ -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'), @@ -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'), From 24e30150fd6f3bef88df2343ee71c6fc9105be90 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 7 Nov 2026 20:24:17 -0700 Subject: [PATCH 3/3] dashboard: landscape probe measures row share instead of a second row on 360px-tall phones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At 740Γ—360 the fixture's first work-item cluster is taller than the viewport so no second row can start inside it; assert that rows fill at least half of the viewport below the navbar and keep the two-row check for the epic's 844Γ—390 reference height. Signed-off-by: Andrew Anderson --- .../webstatic/testdata/tracker-phone-chrome.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js b/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js index 628b666a15..de2a45fad9 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js @@ -14,6 +14,8 @@ const phoneMaxWidth = 640; const maxChromePx = 160; const minRowPeekPx = 120; + const minLandscapeRowShare = 50; + const referenceLandscapeHeight = 390; const failures = []; const assert = (ok, label) => { if (!ok) failures.push(label); }; const rect = el => el.getBoundingClientRect(); @@ -81,12 +83,18 @@ const banners = [...document.querySelectorAll('.merge-banner')].filter(visible); assert(banners.length <= 1, 'at most one merge banner is visible on a landscape phone'); if (sticky && rows.length) { - // Rows are taller than a landscape phone; the contract is that - // rows start inside the viewport once the bar is at the top. + // A fixture row is a whole work-item cluster, taller than a landscape + // phone; the contract is that with the bar at the top, rows (not + // chrome) fill most of the viewport and, at the epic's reference + // 844Γ—390, a second row starts inside it. sticky.scrollIntoView({ block: 'start', behavior: 'instant' }); await frames(3); measurements.rowsStartingInViewport = rows.filter(row => { const box = rect(row); return box.top >= navbar - 1 && box.top < innerHeight; }).length; - assert(measurements.rowsStartingInViewport >= 2, 'at least two rows start inside the viewport on a landscape phone (' + measurements.rowsStartingInViewport + ')'); + const rowArea = rows.reduce((sum, row) => { const box = rect(row); return sum + Math.max(0, Math.min(box.bottom, innerHeight) - Math.max(box.top, navbar)); }, 0); + measurements.rowShare = Math.round(100 * rowArea / (innerHeight - navbar)); + assert(measurements.rowsStartingInViewport >= 1, 'a row starts inside the viewport on a landscape phone with the bar at the top'); + assert(measurements.rowShare >= minLandscapeRowShare, 'rows fill at least ' + minLandscapeRowShare + '% of the landscape viewport below the navbar (' + measurements.rowShare + '%)'); + if (innerHeight >= referenceLandscapeHeight) assert(measurements.rowsStartingInViewport >= 2, 'at least two rows start inside the viewport on a landscape phone (' + measurements.rowsStartingInViewport + ')'); header.scrollIntoView({ block: 'start', behavior: 'instant' }); await frames(2); }