Skip to content

Commit 3930691

Browse files
committed
fix: keep in-page swipes on visible content
1 parent cd48822 commit 3930691

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/__tests__/runtime-interactions.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,12 +609,12 @@ test('runtime gesture swipe presets use stable viewport lanes', async () => {
609609
session: 'default',
610610
});
611611

612-
assert.deepEqual(pageSwipe.from, { x: 85, y: 65 });
613-
assert.deepEqual(pageSwipe.to, { x: 15, y: 65 });
612+
assert.deepEqual(pageSwipe.from, { x: 85, y: 50 });
613+
assert.deepEqual(pageSwipe.to, { x: 15, y: 50 });
614614
assert.deepEqual(edgeSwipe.from, { x: 8, y: 50 });
615615
assert.deepEqual(edgeSwipe.to, { x: 85, y: 50 });
616616
assert.deepEqual(calls, [
617-
{ from: { x: 85, y: 65 }, to: { x: 15, y: 65 }, durationMs: 300 },
617+
{ from: { x: 85, y: 50 }, to: { x: 15, y: 50 }, durationMs: 300 },
618618
{ from: { x: 8, y: 50 }, to: { x: 85, y: 50 }, durationMs: 350 },
619619
]);
620620
});
@@ -634,9 +634,9 @@ test('runtime iOS in-page swipe presets avoid edge-navigation lanes', async () =
634634
session: 'default',
635635
});
636636

637-
assert.deepEqual(pageSwipe.from, { x: 15, y: 65 });
638-
assert.deepEqual(pageSwipe.to, { x: 85, y: 65 });
639-
assert.deepEqual(calls, [{ from: { x: 15, y: 65 }, to: { x: 85, y: 65 }, durationMs: 300 }]);
637+
assert.deepEqual(pageSwipe.from, { x: 15, y: 50 });
638+
assert.deepEqual(pageSwipe.to, { x: 85, y: 50 });
639+
assert.deepEqual(calls, [{ from: { x: 15, y: 50 }, to: { x: 85, y: 50 }, durationMs: 300 }]);
640640
});
641641

642642
test('runtime viewport gestures reject inspect-only macOS surfaces', async () => {

src/core/__tests__/dispatch-interactions.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ test('handleSwipePresetCommand resolves Android in-page swipe to content lane',
116116
undefined,
117117
);
118118

119-
assert.deepEqual(calls, [[340, 520, 60, 520, 300]]);
119+
assert.deepEqual(calls, [[340, 400, 60, 400, 300]]);
120120
assert.deepEqual(result, {
121121
x1: 340,
122-
y1: 520,
122+
y1: 400,
123123
x2: 60,
124-
y2: 520,
124+
y2: 400,
125125
preset: 'left',
126126
durationMs: 300,
127127
effectiveDurationMs: 300,

src/core/scroll-gesture.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ export function buildSwipePresetGesturePlan(
109109
options: { platform?: string; marginPx?: number } = {},
110110
): SwipePresetGesturePlan {
111111
const marginPx = options.marginPx ?? 8;
112-
const horizontalLanePercent = 65;
112+
// Mid-screen keeps in-page swipes on visible content; lower lanes can land in blank pager space.
113+
const horizontalLanePercent = 50;
113114
const inPageStartPercent = 85;
114115
const inPageEndPercent = 15;
115116
const [startPercent, endPercent, yPercent] =

0 commit comments

Comments
 (0)