From cfa932611272a26a8f8d3ca64d2b473245335bc1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 20 Nov 2026 12:13:31 -0700 Subject: On a phone a live stream's message box stays on screen. "I tried to scroll down to see the bottom of the comments, but because the comments are in their own scroll context, the page wouldn't scroll even when I got to the bottom of the comments, so they were cut off at the bottom of the screen" (Adam, 2026-11-20). The chat was a fixed 60vh under the player, so the newest lines and the message box ran off the bottom of the screen, and the chat kept a swipe that reached its end to itself (overscroll-behavior: contain). The chat now takes the room left under the stream, down to the nav, so the message box and the newest line above it show without scrolling the page; it is measured again when the screen changes size (the keyboard). A long description leaves it a floor of 170px and the page scrolls. The chat no longer holds a scroll at its end either. live-stream-test checks the box sits over the nav, with a few lines and with 3000px of chat; features-smoke passes. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01VMan6Upic5L6MMJzkTn8zg --- tools/live-stream-test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tools/live-stream-test.js') diff --git a/tools/live-stream-test.js b/tools/live-stream-test.js index 56dcb71..cf5e056 100644 --- a/tools/live-stream-test.js +++ b/tools/live-stream-test.js @@ -224,6 +224,30 @@ try { const rowSel = '.live-message[data-key="' + chat.id + '"]'; check('comments use the group-chat bubble and shared composer', await page.$(rowSel + ' .chat-bubble') && await page.$('.live-page coinos-text#msg-draft')); check('...drawn plain on a phone, no bubble walls', await page.evaluate((q) => { const b = document.querySelector(q); return b && getComputedStyle(b).borderStyle === 'none' && getComputedStyle(b).display === 'block'; }, rowSel + ' .chat-bubble')); + // the message box is on screen without scrolling the page: the chat takes + // the room left under the stream, down to the nav (it was a fixed 60vh and + // the card ran off the bottom, where a swipe inside the chat couldn't + // bring it up) + { + const fit = await page.evaluate(() => { + window.scrollTo(0, 0); + const r = (q) => document.querySelector(q)?.getBoundingClientRect(); + const box = r('.live-page coinos-text#msg-draft'), nav = r('.app-bottom-nav'), chat = document.querySelector('.live-page .live-chat'); + return { box: box && Math.round(box.bottom), nav: nav ? Math.round(nav.top) : innerHeight, chat: chat.clientHeight, behaviour: getComputedStyle(chat).overscrollBehaviorY }; + }); + check('on a phone the message box sits on screen, over the nav', fit.box && fit.box <= fit.nav && fit.chat >= 120, JSON.stringify(fit)); + check('...and the chat no longer holds a scroll that reaches its end', fit.behaviour === 'auto'); + // a wall of chat: the box stays where it is, the newest line just above it + await page.addStyleTag({ content: '.live-page .live-chat::before{content:"";flex:none;height:3000px}' }).then((el) => el.evaluate((n) => { n.id = 'tall-chat'; })); + await page.evaluate(() => { const c = document.querySelector('.live-page .live-chat'); c.scrollTop = c.scrollHeight; }); + const tall = await page.evaluate(() => { + const r = (q) => document.querySelector(q)?.getBoundingClientRect(); + const c = document.querySelector('.live-page .live-chat'), last = c.lastElementChild.getBoundingClientRect(), nav = r('.app-bottom-nav'); + return { box: Math.round(r('.live-page coinos-text#msg-draft').bottom), nav: nav ? Math.round(nav.top) : innerHeight, last: Math.round(last.bottom), chatBottom: Math.round(c.getBoundingClientRect().bottom), pageY: window.scrollY }; + }); + check('...with a long chat too, the newest line showing above it', tall.box <= tall.nav && tall.last <= tall.chatBottom + 1 && tall.pageY === 0, JSON.stringify(tall)); + await page.evaluate(() => document.getElementById('tall-chat')?.remove()); + } check('another client’s e-only reaction arrives on the comment', await waitFor(id => document.querySelector('.live-message[data-key="'+id+'"] .chat-reacts')?.textContent.includes('👍'), 6000, chat.id)); check('per-comment zap receipts show under the bubble', await waitFor(id => document.querySelector('.live-message[data-key="'+id+'"] .zap-tally')?.textContent.includes('5'), 6000, chat.id)); await page.click(rowSel + ' .chat-bubble'); -- cgit v1.2.3