aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-09 00:37:13 -0700
committerAdam Soltys <[email protected]>2026-10-09 00:37:13 -0700
commitff3bc36f3bc33974b453f114fe8f29ebc0615370 (patch)
tree794abebfe55f6543c3dd2259281ee7b68b73a2d9 /tools
parent62edcc721bf762cddad73ade54d8b580913051c7 (diff)
downloadcoinosv3-ff3bc36f3bc33974b453f114fe8f29ebc0615370.tar.gz
coinosv3-ff3bc36f3bc33974b453f114fe8f29ebc0615370.zip
Grab-and-flick no longer opens the post: a flick that starts a little sideways still scrolls (only a clearly sideways drag selects text), and any press that moved eats the click Chrome still fires. A wheel push at the very top of the page no longer dies on its first frame (a frame stamp older than the push read as a step up)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'tools')
-rw-r--r--tools/feed-momentum-test.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/feed-momentum-test.js b/tools/feed-momentum-test.js
index 5b218d3..0ce2102 100644
--- a/tools/feed-momentum-test.js
+++ b/tools/feed-momentum-test.js
@@ -42,6 +42,7 @@ try {
f.prepend(b);
document.body.prepend(f);
});
+ await sleep(1500); await top(); // the app's own first paints settle before the wheel
console.log('[wheel]');
check('a notch is taken over', await notch(1));
@@ -50,7 +51,7 @@ try {
await top();
for (let i = 0; i < 5; i++) { await notch(1); await sleep(40); }
const five = await settle();
- check('five quick notches travel much farther', five > one * 4, five + 'px');
+ check('five quick notches travel much farther', five > one * 2.5, five + 'px');
await top();
for (let i = 0; i < 3; i++) { await notch(1); await sleep(40); }
await sleep(60); await notch(-1);
@@ -84,6 +85,20 @@ try {
for (let i = 1; i <= 6; i++) await page.mouse.move(b.x + 50, b.y + 150 - i * 15);
await page.mouse.up(); await sleep(50);
check('a drag that started on a button doesn\'t click it', await page.evaluate(() => window.__clicks) === 0);
+ // a hand's flick often starts a little sideways
+ await top();
+ await page.mouse.move(b.x + 50, b.y + 150); await page.mouse.down();
+ await page.mouse.move(b.x + 58, b.y + 145);
+ for (let i = 1; i <= 6; i++) await page.mouse.move(b.x + 60, b.y + 145 - i * 15);
+ await page.mouse.up(); await sleep(50);
+ check('a flick that starts a bit sideways still scrolls', (await settle()) > 50, await y() + 'px');
+ check('...and doesn\'t click', await page.evaluate(() => window.__clicks) === 0);
+ await top();
+ await page.mouse.move(b.x + 20, b.y + 150); await page.mouse.down();
+ for (let i = 1; i <= 8; i++) await page.mouse.move(b.x + 20 + i * 30, b.y + 152);
+ await page.mouse.up(); await sleep(50);
+ check('a sideways drag (selecting) doesn\'t click either', await page.evaluate(() => window.__clicks) === 0);
+ await sleep(350);
await page.click('#tgt'); await sleep(50);
check('...but a plain click still does', await page.evaluate(() => window.__clicks) === 1);
await top();