diff options
| author | Adam Soltys <[email protected]> | 2026-10-17 05:12:10 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-17 05:12:10 -0700 |
| commit | 90e1fade3b5041a3db3353569ef49ecff441fee3 (patch) | |
| tree | 278d7863682494a6f910aeac51b481f44b4727f6 /tools | |
| parent | fa3ce973a66a2044c8cc9ac383928d70eb32e3d0 (diff) | |
| download | coinosv3-90e1fade3b5041a3db3353569ef49ecff441fee3.tar.gz coinosv3-90e1fade3b5041a3db3353569ef49ecff441fee3.zip | |
The video pager never puts up a stand-in still: a clip joins the carousel only once its own first frame is on its slide.
Where the server had no first frame for a clip, its slide showed the post's still (a kept frame or the post's picture) and swapped it for the clip's first frame when one came — often a different picture, and the swap jarred (Adam, 2026-10-17: "i don't want to show posters and then switch to the first frame because sometimes the poster and first frame were not the same and that was jarring. could we just always wait until we have a non-black frame before including the video in the pager?"). Now such a clip gets no picture at all and waits out of the carousel until its first frame is drawn from its cached opening as the clip ahead; one with no frame to be had stays out. The clip tapped to open the pager is unchanged.
tools/pager-first-frame-test.js: the clip without a server frame has no stand-in and waits out of the carousel, then gets its drawn frame. pager-ready-gate, pager-no-poster, pager-eager, pager-loading and pager-swipe-fly pass.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013ZDf1cyCQLkfjftYhymZAg
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/pager-first-frame-test.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/pager-first-frame-test.js b/tools/pager-first-frame-test.js index f88a074..6507607 100644 --- a/tools/pager-first-frame-test.js +++ b/tools/pager-first-frame-test.js @@ -2,8 +2,8 @@ // before the reader gets there: the server's (vmedia first.jpg — frame 0 at // full size, any host), put on the slide once fetched and decoded; where the // server has none, the next clip's frame is drawn here from its cached -// opening, and a clip beyond keeps the post's still rather than black, until -// a first frame comes. The slide left behind keeps its frame for the swipe +// opening, and a clip beyond gets no picture (and stays out of the +// carousel) until a first frame comes — never the post's still first. The slide left behind keeps its frame for the swipe // back. Run: bun tools/pager-first-frame-test.js import puppeteer from './puppeteer.js'; import { cacheKeyFor } from '../src/wallet.js'; @@ -106,13 +106,15 @@ try { console.log('\n[the slides ahead hold their first frames]'); check('the next clip holds the server\'s first frame', await waitPoster('tall', 'server'), JSON.stringify(await slides())); check('…the server was asked for it once', asked.filter((x) => x === 'first:tall').length === 1, asked.join(' ')); - check('the clip after, which the server has no frame for, keeps the post\'s still', await waitPoster('last', 'still'), JSON.stringify(await slides())); + await sleep(1500); + check('the clip after, which the server has no frame for, gets no stand-in still', (await posterOf('last')) === 'none', JSON.stringify(await slides())); + check('…and waits out of the carousel', await page.evaluate(() => [...document.querySelectorAll('.mp-group')].find((g) => /last\.webm$/.test(g.querySelector('.mp-slide').getAttribute('data-k'))).classList.contains('mp-wait'))); check('…no thumbnail route was tried for any of them', !asked.some((x) => /thumb\.jpg/.test(x)), asked.join(' ')); await page.keyboard.press('ArrowDown'); check('on to the next: it plays', await waitFor(() => { const s = document.querySelector('.mp-slide.mp-cur'); return !!s && s.getAttribute('data-k').endsWith('/tall.webm') && !s.querySelector('video').paused; }, null, 6000), JSON.stringify(await slides())); check('…the server\'s frame still under it', (await posterOf('tall')) === 'server', String(await posterOf('tall'))); check('the one left behind holds its first frame for the swipe back', await waitPoster('wide', 'server'), JSON.stringify(await slides())); - check('the next, now the clip ahead, has its frame drawn here in place of the still', await waitPoster('last', 'drawn', 12000), JSON.stringify(await slides())); + check('the next, now the clip ahead, has its frame drawn here ', await waitPoster('last', 'drawn', 12000), JSON.stringify(await slides())); check('…the server asked only once more for it, not again and again', asked.filter((x) => x === 'first:last').length === 1, asked.join(' ')); await page.keyboard.press('ArrowUp'); check('back on the first: it plays again, its frame under it', await waitFor(() => { const s = document.querySelector('.mp-slide.mp-cur'); return !!s && s.getAttribute('data-k').endsWith('/wide.webm') && !s.querySelector('video').paused && /first\.jpg/.test(s.querySelector('video').getAttribute('poster') || ''); }, null, 6000), JSON.stringify(await slides())); |
