diff --git a/public/live.css b/public/live.css index 0aa9a975..42214fa4 100644 --- a/public/live.css +++ b/public/live.css @@ -917,13 +917,24 @@ gap: 4px; overflow: visible; } - /* Row 1: controls + scope + LCD, all in one line */ + /* #1221: LCD clock shares row with playback controls (not floating + * bottom-right). Scope buttons wrap to row 2; timeline to row 3. + * LCD is scaled ~70% of desktop so it fits next to the touch-target + * buttons without clipping at 375px viewport. */ .vcr-controls { order: 1; flex-shrink: 0; gap: 4px; } - .vcr-scope-btns { order: 2; flex-shrink: 0; gap: 1px; } - .vcr-lcd { order: 3; display: flex; margin-left: auto; min-width: 90px; padding: 2px 6px; } - .vcr-lcd-canvas { width: 100px; height: 22px; } + .vcr-lcd { + order: 2; + margin-left: auto; + min-width: 70px; + padding: 2px 4px; + flex-shrink: 0; + } + .vcr-lcd-canvas { width: 78px; height: 18px; } + .vcr-lcd-mode { font-size: 0.55rem; letter-spacing: 1px; } + .vcr-lcd-pkts { font-size: 0.5rem; letter-spacing: 1px; } + .vcr-scope-btns { order: 3; flex-shrink: 0; gap: 1px; } .vcr-mode { display: none; } - /* Row 2: timeline takes full width */ + /* Timeline takes full width on its own row */ .vcr-timeline-container { order: 4; width: 100%; flex: none; height: 20px; } /* #207 — 44px touch targets for VCR buttons */ .vcr-btn { padding: 4px 8px; font-size: 0.75rem; min-height: 44px; min-width: 44px; } diff --git a/test-e2e-playwright.js b/test-e2e-playwright.js index 9ba793b0..521d4423 100644 --- a/test-e2e-playwright.js +++ b/test-e2e-playwright.js @@ -2974,6 +2974,42 @@ async function run() { `URL should not navigate away, got ${page.url()} (was ${urlBefore})`); }); + // Issue #1221: VCR LED clock must sit in-row with VCR playback controls + // (same flex container) and must be fully visible — not clipped — on a + // 375x800 mobile viewport. It must also be visibly smaller than desktop. + await test('#1221 VCR LED clock in-row with controls and unclipped on mobile', async () => { + await page.setViewportSize({ width: 375, height: 800 }); + await page.goto(BASE + '/#/live', { waitUntil: 'domcontentloaded' }); + await page.waitForSelector('#vcrBar', { timeout: 10000 }); + await page.waitForSelector('#vcrLcdCanvas', { timeout: 10000 }); + const m = await page.evaluate(() => { + const bar = document.getElementById('vcrBar'); + const lcd = document.querySelector('.vcr-lcd'); + const ctrl = document.querySelector('.vcr-controls'); + const lcdR = lcd.getBoundingClientRect(); + const ctrlR = ctrl.getBoundingClientRect(); + return { + lcdInBar: bar.contains(lcd), + sharedParent: lcd.parentElement === ctrl.parentElement, + lcd: { left: lcdR.left, right: lcdR.right, top: lcdR.top, bottom: lcdR.bottom, width: lcdR.width }, + ctrl: { top: ctrlR.top, bottom: ctrlR.bottom }, + vw: window.innerWidth, vh: window.innerHeight, + }; + }); + assert(m.lcdInBar, '#1221: LCD clock must live inside .vcr-bar'); + assert(m.sharedParent, '#1221: LCD clock and .vcr-controls must share a parent (one flex row container)'); + assert(m.lcd.left >= 0, `#1221: LCD clipped on left (left=${m.lcd.left})`); + assert(m.lcd.right <= m.vw, `#1221: LCD clipped on right (right=${m.lcd.right}, vw=${m.vw})`); + assert(m.lcd.top >= 0, `#1221: LCD clipped on top (top=${m.lcd.top})`); + assert(m.lcd.bottom <= m.vh, `#1221: LCD clipped on bottom (bottom=${m.lcd.bottom}, vh=${m.vh})`); + // In-row check: LCD and controls must vertically overlap (same row in the flex layout). + const overlaps = !(m.lcd.bottom <= m.ctrl.top || m.lcd.top >= m.ctrl.bottom); + assert(overlaps, `#1221: LCD not in same row as controls (lcd y=[${m.lcd.top},${m.lcd.bottom}], ctrl y=[${m.ctrl.top},${m.ctrl.bottom}])`); + // Mobile scale: LCD must be smaller than desktop baseline (.vcr-lcd min-width is 110px on desktop). + assert(m.lcd.width < 100, `#1221: LCD should be scaled down on mobile (got ${m.lcd.width}px, expected <100)`); + await page.setViewportSize({ width: 1280, height: 800 }); + }); + await browser.close(); // Summary