Fix live swipe paging and retain tilt preference on iOS
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 29s
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 29s
Replace the damped single-screen fade with live mobile panels on a shared composited rail, preserving per-tab scrolling and pausing offscreen physics. Center macro text and separate the saved tilt switch from session motion permission, resuming permission from a normal interaction. Validate live previews, interruption and multi-touch cancellation, relaunch, and permission races.
This commit is contained in:
parent
7288e56c02
commit
3c0d6560f1
15 changed files with 784 additions and 263 deletions
|
|
@ -3,7 +3,7 @@
|
|||
(() => {
|
||||
const checks = {};
|
||||
const font = (element) => getComputedStyle(element).fontSize.split('px')[0] * 1;
|
||||
const visible = (selector) => [...document.querySelectorAll(selector)].filter(e => e.getBoundingClientRect().width > 0);
|
||||
const visible = (selector) => [...document.querySelectorAll(selector)].filter(e => e.getBoundingClientRect().width > 0 && !e.closest('.page-panel[aria-hidden="true"]'));
|
||||
const dialog = document.querySelector('dialog[open]');
|
||||
checks.noHorizontalPageOverflow = document.documentElement.scrollWidth <= window.innerWidth + 1;
|
||||
if (!dialog && visible('.dashboard-grid').length) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
(async () => {
|
||||
const checks = {};
|
||||
const pause = (ms = 380) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
const visible = selector => [...document.querySelectorAll(selector)].filter(e => e.getBoundingClientRect().width > 0);
|
||||
const visible = selector => [...document.querySelectorAll(selector)].filter(e => e.getBoundingClientRect().width > 0 && !e.closest('.page-panel[aria-hidden="true"]'));
|
||||
const page = () => document.querySelector('main').getAttribute('aria-label');
|
||||
const nav = async label => {
|
||||
visible('.bottom-nav button').find(e => e.textContent.trim() === label).click();
|
||||
|
|
|
|||
65
tests/browser/swipe-preview.check.js
Normal file
65
tests/browser/swipe-preview.check.js
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
// Run on an unlocked phone-size localhost preview using Runtime.evaluate with
|
||||
// awaitPromise. Reproduces the visible adjacent screen and centered macro text.
|
||||
(async () => {
|
||||
const checks = {};
|
||||
const target = document.querySelector('.orb');
|
||||
const rect = target.getBoundingClientRect();
|
||||
const x = innerWidth / 2;
|
||||
const y = rect.y + rect.height / 2;
|
||||
const emit = (type, dx, ended = false) => {
|
||||
const touch = new Touch({ identifier: 21, target, clientX: x + dx, clientY: y });
|
||||
target.dispatchEvent(new TouchEvent(type, { bubbles: true, cancelable: true, touches: ended ? [] : [touch], changedTouches: [touch] }));
|
||||
};
|
||||
emit('touchstart', 0);
|
||||
emit('touchmove', -70);
|
||||
emit('touchmove', -140);
|
||||
await new Promise(requestAnimationFrame);
|
||||
await new Promise(requestAnimationFrame);
|
||||
const nextHeading = [...document.querySelectorAll('h1')].find(e => e.textContent.includes('Library'));
|
||||
const next = nextHeading?.getBoundingClientRect();
|
||||
checks.nextScreenVisibleDuringDrag = Boolean(next && next.width > 0 && next.left > 0 && next.left < innerWidth);
|
||||
const current = target.getBoundingClientRect();
|
||||
checks.followsFingerWithoutDamping = Math.abs((rect.left - current.left) - 140) < 3;
|
||||
emit('touchcancel', -140, true);
|
||||
await new Promise(resolve => setTimeout(resolve, 380));
|
||||
emit('touchstart', 0);
|
||||
emit('touchmove', -100);
|
||||
await new Promise(requestAnimationFrame);
|
||||
const first = new Touch({ identifier: 21, target, clientX: x - 100, clientY: y });
|
||||
const second = new Touch({ identifier: 22, target, clientX: x + 10, clientY: y });
|
||||
target.dispatchEvent(new TouchEvent('touchstart', { bubbles: true, touches: [first, second], changedTouches: [second] }));
|
||||
target.dispatchEvent(new TouchEvent('touchend', { bubbles: true, touches: [], changedTouches: [first, second] }));
|
||||
await new Promise(resolve => setTimeout(resolve, 380));
|
||||
checks.multitouchDoesNotLeavePartialPage = Math.abs(target.getBoundingClientRect().left - rect.left) < 2;
|
||||
const libraryButton = [...document.querySelectorAll('.bottom-nav button')].find(e => e.textContent.trim() === 'Library');
|
||||
libraryButton.click();
|
||||
await new Promise(requestAnimationFrame);
|
||||
const viewport = document.querySelector('main');
|
||||
const rail = document.querySelector('.page-rail');
|
||||
const before = new DOMMatrixReadOnly(getComputedStyle(rail).transform).m41;
|
||||
const resumeTouch = (type, dx) => {
|
||||
const touch = new Touch({ identifier: 23, target: viewport, clientX: x + dx, clientY: y });
|
||||
viewport.dispatchEvent(new TouchEvent(type, { bubbles: true, cancelable: true, touches: type === 'touchcancel' ? [] : [touch], changedTouches: [touch] }));
|
||||
};
|
||||
resumeTouch('touchstart', 0);
|
||||
resumeTouch('touchmove', 40);
|
||||
await new Promise(requestAnimationFrame);
|
||||
await new Promise(requestAnimationFrame);
|
||||
const after = new DOMMatrixReadOnly(getComputedStyle(rail).transform).m41;
|
||||
const desired = before + 40;
|
||||
const expected = desired > 0 ? desired * .15 : desired;
|
||||
checks.interruptedSettleContinuesWithoutJump = Math.abs(after - expected) < 5;
|
||||
resumeTouch('touchcancel', 40);
|
||||
await new Promise(resolve => setTimeout(resolve, 380));
|
||||
[...document.querySelectorAll('.bottom-nav button')].find(e => e.textContent.trim() === 'Today').click();
|
||||
await new Promise(resolve => setTimeout(resolve, 380));
|
||||
checks.macroNumbersCentered = [...document.querySelectorAll('.macro')].filter(e => e.getBoundingClientRect().width > 0).every(macro => {
|
||||
const value = macro.querySelector('div:not(.progress-track)');
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(value);
|
||||
const text = range.getBoundingClientRect();
|
||||
const track = macro.querySelector('.progress-track').getBoundingClientRect();
|
||||
return Math.abs(text.x + text.width / 2 - track.x - track.width / 2) < 2;
|
||||
});
|
||||
return { pass: Object.values(checks).every(Boolean), checks };
|
||||
})()
|
||||
Loading…
Add table
Add a link
Reference in a new issue