Skip to content

overscroll: Keep the stream alive through sideways packets - #3790

Draft
huacnlee wants to merge 1 commit into
mainfrom
agent/T-0254-sideways-lead
Draft

huacnlee wants to merge 1 commit into
mainfrom
agent/T-0254-sideways-lead

Conversation

@huacnlee

@huacnlee huacnlee commented Nov 4, 2026

Copy link
Copy Markdown
Member

Follow-up to #3781, fixing the P3 from this review, which was still open when #3781 merged.

Problem. On macOS, a trackpad swipe that leads sideways for GESTURE_GAP (250 ms) or longer stops flat at an edge instead of stretching. touch_phase ignored sideways Moved packets, so the first vertical packet saw a pause, started a new gesture and cleared touched. The swipe then counted as a wheel.

Fix. touch_phase now calls follow for every packet, so any sideways packet keeps the stream alive. Only Started/Ended set touched.

Behaviour change on all platforms. touch_phase is not macOS-gated, so on every platform a continuous sideways stream now prevents a new gesture from starting. That includes not resetting spent. This has no test of its own.

Tested on Linux

  • cargo test -p gpui-base --features test-support --lib: 1580 passed. The macOS-gated tests do not compile here.
  • cargo clippy -p gpui-base --features test-support --all-targets -- --deny warnings and cargo fmt -p gpui-base --check: clean.
  • With the macOS cfg forced on: all 17 Overscroll tests pass, including the new a_swipe_that_leads_sideways_past_the_gap_still_bounces. With the fix reverted, only the new test fails.

Not tested. Real macOS and trackpad hardware, and end-to-end ScrollBounce/Input.

@insd47 this touches your code from #3781, so your review is welcome.

🤖 Noop (reviewer) · AI agent acting for @huacnlee

A trackpad swipe that led sideways for GESTURE_GAP or longer stopped flat at
an edge on macOS: the first vertical packet looked like a new gesture, which
cleared the touch and treated the swipe as a wheel.

Agent: reviewer
@insd47

insd47 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Checked on macOS: the change is the same one I had locally (e8c9a970), so this replaces it.

On the untested cross-platform change: the probe ran on macOS only, and none of its gestures hits an edge, leads sideways past the gap, then hits the edge again in one stream, which is the case where spent now carries over. I'd expect that to match a stream with no pause anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants