diff options
| author | Adam Soltys <[email protected]> | 2026-10-18 06:19:39 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-18 06:19:39 -0700 |
| commit | 7859a2fb3937f44727c9a3408d407da926b4f724 (patch) | |
| tree | 2f54e0c4aa991187ca91642b06e1752a5944540b /tools/pager-swipe-fly-test.js | |
| parent | 78fbd1fb0be6c7029409c8ab5cb020009853c4c5 (diff) | |
| download | coinosv3-7859a2fb3937f44727c9a3408d407da926b4f724.tar.gz coinosv3-7859a2fb3937f44727c9a3408d407da926b4f724.zip | |
The media pager no longer goes round from its last post to its first (or first to last): a step, a flick or the wheel at an end stays there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013ZDf1cyCQLkfjftYhymZAg
Diffstat (limited to 'tools/pager-swipe-fly-test.js')
| -rw-r--r-- | tools/pager-swipe-fly-test.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/pager-swipe-fly-test.js b/tools/pager-swipe-fly-test.js index 707aad6..657ea75 100644 --- a/tools/pager-swipe-fly-test.js +++ b/tools/pager-swipe-fly-test.js @@ -1,8 +1,9 @@ // On a phone, a fast flick up or down in the media pager flies past several // posts and lands snapped on one, the way a spin of the wheel does; a // gentler swipe is one post, as before; a fling at the end lands on the -// last post rather than wrapping past it; a tap mid-flight stops it on the -// post most on screen, and a swipe back from there goes to the one before. +// last post and goes no further (no going round to the first); a tap +// mid-flight stops it on the post most on screen, and a swipe back from +// there goes to the one before. // Run: bun tools/pager-swipe-fly-test.js import puppeteer from './puppeteer.js'; import { cacheKeyFor } from '../src/wallet.js'; @@ -121,15 +122,18 @@ try { const seen = await page.evaluate(() => document.querySelector('.mp-position').textContent); check('the counter says where it landed', seen === landed + ' / ' + N, seen); - console.log('\n[a flick near the end coasts round to the start]'); + console.log('\n[the ends are ends]'); while ((await at()) !== 7) { await page.keyboard.press((await at()) < 7 ? 'ArrowDown' : 'ArrowUp'); await settled(); } const before = await at(); await swipe(600, 80, 3); await settled(); - check('from post ' + before + ' (a flight\'s worth would be past the end), a flick comes round to the first post', before >= 7 && (await at()) === 1, String(await at())); - await swipe(-600, 80, 3); await settled(); - check('…and a flick back up from the first comes round to the last', (await at()) === N, String(await at())); + check('from post ' + before + ', a flick whose flight would be past the end lands on the last post', before === 7 && (await at()) === N, String(await at())); await swipe(600, 80, 3); await settled(); - check('…a flick down from the last, to the first again', (await at()) === 1, String(await at())); + check('…a flick on from the last stays there (no going round to the first)', (await at()) === N, String(await at())); + await page.keyboard.press('ArrowDown'); await settled(); + check('…and so does ↓', (await at()) === N, String(await at())); + while ((await at()) !== 1) { await page.keyboard.press('ArrowUp'); await settled(); } + await swipe(-600, 80, 3); await settled(); + check('a flick back up from the first stays on the first', (await at()) === 1, String(await at())); await swipe(320, 130); await settled(); check('a gentle swipe from the first: the second, as ever', (await at()) === 2, String(await at())); |
