Repository navigation
fix: stop stray sideways wheel input from sliding a closed side panel - #35174
Conversation
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 14% chance that this change introduces a defect, above the 12% limit for approving on its own. Adds an 80px start distance to leftward runs that would bring a closed side panel out (the new An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the change fixes the real cause, which was a reveal with no minimum travel. It is opt-in per page and has rendered evidence attached. Notes
[DESIGN-REVIEWED] 6942e0d Description read[DESCRIPTION-READ] 586f56f55322af4dd2787065548e216e95ff1903d7cf90a76f66d3f780676628 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The PR adds no visible control; it only changes when a gesture starts. The before and after recordings are attached, and the stills show that the creep no longer leaves a strip at the edge. Notes
[UX-REVIEWED] 6942e0d Description read[DESCRIPTION-READ] 565efcf56ab1045f5b20711ab418a13926b41e6ced205ad3e27750f6244da2d2 That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
buluoray
left a comment
There was a problem hiding this comment.
Request changes on 7644da2. A leftward run that would bring a closed side panel out (chat page and Bots page) is consumed like a drag but moves nothing until the fingers' own travel reaches 80px, so a mouse thumb wheel's ~28px creep no longer slides the panel out. Closes, mid-settle grabs and reduced motion are unchanged. Decisive lines: website/src/hooks/useTrackpadSwipe.ts:234-240 (report(): a waiting reveal starts only at SWIPE_THRESHOLD_PX, moves count from origin), website/src/hooks/useTrackpadSwipe.ts:283 (waiting = owner === 'drag' && reveals(dir)), website/src/hooks/useTrackpadSwipe.ts:218 (finish() returns false for an unstarted reveal, so no onDragEnd and no flush), website/src/pages/chat/page/chatTrackpadSwipe.ts:156,170 (reveals only from rest; a run retired before the threshold does not start), website/src/pages/members/useMembersPageDrawers.ts:596
A leftward wheel run started the desktop side-panel drag at its first event, with no minimum travel, and both the chat page and the Bots page accept any leftward run while their panel is closed. A mouse thumb wheel that turns a pixel at a time while the mouse is held sends exactly such runs (0.83-1.67px steps, about 28px in all), so the closed panel slid out and back several times an hour with no deliberate input. The swipe reader now asks the page whether a run reveals a closed panel. Such a run is read like a drag from its first event, but starts only once the fingers' own travel (never a momentum tail) reaches SWIPE_THRESHOLD_PX, the 80px a reduced-motion swipe already needs, and the panel follows from there; the fingers' moves before that point are handed to the page, so the release reads their speed and a flick that just passes it still opens the panel. A lift-off or a recognised tail before that ends the run unstarted. A close, or a grab of a settle in flight, still starts at once. On the chat page a run retired (session switch, panel toggled) before its start distance no longer starts a drag. The spec and feature map state the start distance. Closes #34769
7644da2 to
6942e0d
Compare
|
|
|
[operator: bolichen97] @buluoray thanks for the review on 7644da2. Your summary matches the change, and the review names no separate defect, so here is what moved since:
If something else made you request changes, could you name it here? Otherwise a re-review on the new head would clear the request. |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix adds a start distance where the drag begins, has a linked issue (#34769), and reuses the existing What this change shipsInventory (10 items) — 10 justifiedIntent: stop a mouse thumb wheel's small sideways creep from sliding a closed desktop side panel out and back. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 6942e0d Description read[DESCRIPTION-READ] 0b70c763d55b58dd911c172c7ab81c0940033029fed6f4a43fa5f99d23be87d9 That sha256 names the PR description this verdict read. Recompute it with |
buluoray
left a comment
There was a problem hiding this comment.
Approve on 6942e0d. The point we raised on 7644da2 is fixed. In the desktop app, a slow leftward swipe that pauses with the fingers still down now keeps its progress toward the 80px start distance, so it opens the panel once the fingers carry on. A test pins this and fails when the fix is taken out. This head also starts the drag at exactly 80px and keeps the moves before that point for the release speed, so a quick flick that only just passes 80px opens the panel. A reveal that is lifted short of 80px stays unstarted while its momentum runs out. Each of these changes has a test that fails without it. Stray sideways input from a mouse wheel still never moves a closed panel. The only red checks are backend tests that were red on main when this CI ran, so the PR needs a rebase onto main before it can merge. Decisive lines: website/src/hooks/useTrackpadSwipe.ts:606 (settle keeps the finger-down hold for a waiting reveal), website/src/hooks/useTrackpadSwipe.ts:264 (the reader's own gap check holds any owner === 'drag', a waiting reveal included), website/src/hooks/useTrackpadSwipe.ts:244-258 (report() starts at exactly 80px and hands over the lead), website/src/hooks/trackpadPanelDrag.ts:108 (leadTrackpadSamples), website/src/hooks/useTrackpadSwipe.test.ts:574, website/src/hooks/useTrackpadSwipe.test.ts:599
Pull request was closed
|
[operator: bolichen97] The red Backend Tests shards (3.12 5 and 6, Windows 2 and 4) and the Coverage Gate behind them on 6942e0d were main's, not this PR's: the same jobs were red on main's own push runs, on |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Verified on head 6942e0d: PR Readiness is green. The diff is frontend and docs only and touches no auth, sandbox or secret surface. The new reader states were traced by hand, including the start at 80px with the lead samples and the lift and finish paths. Mutating each changed production branch turned at least one test red, and three shuffled runs stayed green.
Done well: a stray thumb-wheel creep stays an owned, consumed drag that moves nothing. A flick that only just passes 80px still opens the panel because the earlier finger moves carry its speed. The reporter's own capture is pinned as a test on both pages.
Optional:
- Add one Bots page test: open the panel on another tab, send the 28px creep, and assert the Dashboard tab stays unselected. Today no test fails if
revealsstops covering that case. - The window-focus trigger in #34769 is out of scope here and has no other open issue. Use
Part of #34769, or open a follow-up issue, so the next focus capture has an open place to go. - Open PR #27419 edits the same
wants/onDragStartregion and removes the Dashboard jump. Whichever PR merges second must resolve the conflict and drop the Dashboard jump wording from the comment, the feature map row and narrow-viewport.md.
Problem / Motivation
Goal: On desktop, a closed side panel stays closed until the person opens it: a stray sideways wheel run, such as a mouse thumb wheel turning by a pixel at a time, no longer slides it out and back.
On the chat page, with the right side panel closed, the panel slides out 20 to 50 px and back on its own, several times an hour. The reporter traced it to a mouse with a horizontal thumb wheel (Logitech MX Master 3S): the wheel turns a little while the mouse is held or moved and sends runs of 0.83 to 1.67 px leftward
wheelsteps that sum to about 28 px. The first such step started a drag that pulled the panel out, and the drag fell back under the commit line a moment later.Why it matters
Anyone whose mouse or input driver leaks small sideways scroll sees the closed panel flicker in and out at random while reading or typing, with no way to tell what caused it. The Bots page has the same drag on its own side panel and the same symptom.
Not a goal
What changed (motivation → approach → change)
A stray thumb-wheel run moved the closed panel because a leftward run started a drag at its first event, with no minimum travel, and the chat page accepts any leftward run while the panel is closed.
The swipe reader (
hooks/useTrackpadSwipe) now takes arevealsanswer from the page for each run. A run that would bring a closed panel out is read like a drag from its first event (so the browser's own swipe does not start under it, and its momentum tail is recognised as usual), but it starts only once the fingers' own travel reachesSWIPE_THRESHOLD_PX(80 px), the distance a reduced-motion swipe already needs; the panel then follows from that point. The fingers' moves before 80 px are handed to the page with the start, so the release reads their real speed and a quick flick that just passes 80 px still opens the panel. In the desktop app a pause with the fingers still down keeps that run, as it keeps a drag, up to the same 1 s cap. A lift-off or a recognised tail before 80 px ends the run unstarted. The chat page and the Bots page both answerrevealsfor a leftward run from rest; on the Bots page that also covers bringing its Dashboard tab forward. On the chat page, a run retired before it reaches 80 px (a session switch, the panel toggled) does not start a drag.The owning spec (
website/docs/narrow-viewport.md) and the feature map row state the start distance.Backwards compatibility
Compatible:
revealsis an optional option ofuseTrackpadSwipeand an optional argument ofcreateTrackpadSwipeReader; a page that does not pass it behaves exactly as before. For the person, opening a closed panel by trackpad now takes 80 px of finger travel, so a leftward flick shorter than that, which could open it before, no longer does.Removes nothing: no option, path or stored state is removed; only how far an opening run must go before it moves changes.
Tests
useTrackpadSwipe.test.ts: the reporter's fine-step run (22 events, ~28 px) on a revealing run starts no drag and moves nothing, though every event is the page's; a 10 px x 12 run starts at the event that reaches 80 px, moves 0, 10, 20, 30, 40 from that point and hands over the sums before it (-70 to -10 px, with their times); a step that crosses 80 px moves by what lies past it; a rightward run is no reveal and starts at its first event, with no lead.useTrackpadSwipe.test.ts: fingers that stop short of 80 px are never started by what follows them: a geometric momentum tail, a creeping tail, or (in the desktop shell) the momentum after a lift-off, read straight off the reader and through the hook's lift.useTrackpadSwipe.test.ts: in the desktop shell, 50 px, a 300 ms pause with the fingers down, then 30 px more: the drag starts at the event that reaches 80 px in all, with the moves before the pause in its lead.ChatPage.trackpadSwipe.test.tsx: the creep never mounts the closed panel's column; a session switch while an opening run is still short of 80 px drops the run; a quick flick (5, 15, 30, 40 px, then momentum) opens the panel.MembersPage.sidePanel.trackpadSwipe.test.tsx: the creep never slides the hidden Bots panel out; the same quick flick opens it.Determinism: the three changed files passed 20 runs at one worker and 10 at three workers, each with files and tests shuffled under a fresh printed seed (
--sequence.shuffle.files --sequence.shuffle.tests --sequence.seed=<n>), 127 tests each time.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Ran the built SPA in Chromium at 1440x900 (every
/api/**call answered from fixtures, no gateway) with the chat page's side panel closed. A page script sent the reporter's creep over the transcript (22 leftward wheel events of 1.67/0.83 px, 45 ms apart, 28.3 px in all), then a deliberate swipe (16 x 20 px, 16 ms apart), and read the panel column's width on every frame.The three new tests fail on the base code (the reader starts a drag at the first creep event; the chat column and the Bots panel mount) and pass here.
Screenshots / video
The change is motion, what a stray run no longer does, so each build is recorded: the creep first, then the deliberate swipe.
Before (base build):
before-recording.webm
After (this branch):
after-recording.webm
Related Issues
Closes #34769
Sibling sweep
Swept: git grep -n "useTrackpadSwipe(" -- website/src
Sibling: website/src/pages/members/useMembersPageDrawers.ts -- changed here
Sibling: website/src/hooks/useDrawerSwipe.ts -- not affected -- the phone drawer is a touch drag that already waits for AXIS_LOCK (10px) before it moves, and a stray wheel never reaches it
Pattern harvest
Rule candidate: review-prompt
Pattern: a gesture that moves a hidden surface from its first input event, with no start distance, so stray input reveals it
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)