Repository navigation
feat(website): add a Reverse trackpad swipe setting for browsers that hide Natural scrolling - #39164
JalaluddinYazdani wants to merge 1 commit into
Conversation
|
@buluoray @bolichen97 could you review this? It implements option 1 from #38623 (a Reverse trackpad swipe switch, off by default, used only where the browser cannot detect Natural scrolling). GitHub would not let me request reviewers from a fork, hence the mention. Screenshots of the new Settings row will follow. |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The new switch is off by default, and a maintainer chose this approach on #38623 (Option 1). It replaces all 3 places that read What this change shipsInventory (8 items) — 8 justifiedIntent: let people with macOS Natural scrolling off get a side-panel swipe that follows their fingers in Chrome and Firefox. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 129681b Description read[DESCRIPTION-READ] 80fba128bb15f25e03c3807c8bf36be885649caf1a448354550c35d364bc219e That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The switch only fills the case where neither the wheel nor the desktop shell reports Natural scrolling, it is off by default, the PR removes nothing, and committed screenshots cover the new row. [DESIGN-REVIEWED] 129681b Description read[DESCRIPTION-READ] 204a5f3bcc12ca6a624a4ecb58f3e97e2abd2af6db8efc0a3be7058afd18aa62 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, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Five committed screenshots show every new state (off and on, light and dark, plus the tooltip). Nothing blocks. No first-time reader has seen them: this is a fork lane, so pushing the branch to this repository would run the blind read. Notes
[UX-REVIEWED] 129681b Description read[DESCRIPTION-READ] 0b9bb5a020f867b342ddfd01a6508ffeb79dd92973ab2a48542fa1e34ead1cc6 That sha256 names everything this verdict read: the PR description, plus the 8 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 (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] 129681b |
GPT 6.1 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)Reviewed Opus 5.5 adjudication downgraded every blocking finding. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents. Review detailsBLOCKING -- website/src/hooks/useTrackpadSwipe.ts:697 -- Refresh the direction in already-armed frames
Adjudication (Opus 5.5) — is blocking on each finding proportionate?LOW: needs Chrome or Firefox with Natural scrolling off, and the switch flipped once while a relaying frame is already armed. Hosts arm frames only at effect start ( |
|
@JalaluddinYazdani I approved the held CI runs on 68bdb15. Two checks are red:
On the design: #38623 asked a maintainer to pick between the options, and so far nobody has picked one on the issue. Since this PR adds a new user setting, I've flagged it for a maintainer call. I'll do the code review once the checks above are green. AI-assisted, sent by Bolin Review bot |
68bdb15 to
129681b
Compare
|
Maintainer design sign-off from @bolichen97: option 1 from #38623 is the direction we want. A "Reverse trackpad swipe" setting, off by default, fixes the swipe for people with Natural scrolling off in Chrome and Firefox. Safari and the desktop app keep detecting it on their own, and detection still wins over the switch. I'll do the code review and approve once the checks on the current head are green. AI-assisted, sent by Bolin Review bot |
|
@JalaluddinYazdani thanks for the gen:ui fix. Two things on 129681b:
Design sign-off is already on the PR; I'll approve once these are green. AI-assisted, sent by Bolin Review bot |
|
Bundle Size Gate: AI-assisted, sent by Bolin Review bot |
… hide Natural scrolling Chrome and Firefox tabs do not expose macOS Natural scrolling, so with it off the side-panel swipe still ran backwards there after kirodotdev#38711. A new browser-local switch in Settings > Display (off by default) supplies the missing answer: lib/scrollTouch naturalScrolling() reads the desktop shell's report first, then the switch (on = Natural scrolling off). The wheel's own webkitDirectionInvertedFromDevice still wins, so Safari and the desktop app are unchanged; the row is hidden where the shell reports the setting. The frame wheel relay gets the same value when armed. Fixes kirodotdev#38623
129681b to
3ec42d1
Compare
|
@JalaluddinYazdani the one red on 3ec42d1 is Backend Tests (3.12, 8): AI-assisted, sent by Bolin Review bot |
Problem / Motivation
Goal: Let people who turn macOS Natural scrolling off get a side-panel swipe that follows their fingers in Chrome and Firefox tabs too.
#38711 fixed the swipe direction with Natural scrolling off in Safari (which reports
webkitDirectionInvertedFromDevice) and in the desktop app (which readscom.apple.swipescrolldirection). Chrome and Firefox tabs expose the macOS setting nowhere, so there the right-docked side panel (chat and Mates pages) still moves opposite to the fingers for those users. Option 1 of the decision on #38623 (comment): add a "Reverse trackpad swipe" setting, off by default.Why it matters
Anyone with Natural scrolling off who uses the dashboard in Chrome or Firefox gets a backwards swipe: swiping left to open the panel closes it, and the reverse. There is no way to fix it today.
Not a goal
DURABLE_PREF_KEYS). It describes one browser on one Mac.What changed (motivation → approach → change)
fingerSigngets no WebKit flag and no shell report, so it assumes Natural scrolling is on and reads the fingers backwards.fingerSigna third source for the unknown case only, a browser-local switch. The order is: the wheel's own WebKit flag, then the desktop shell, then the switch. With the switch off, nothing changes for anyone.website/src/lib/scrollTouch.ts:REVERSE_TRACKPAD_SWIPE_KEY(kc-reverse-trackpad-swipe) andnaturalScrolling(). It returns the shell's report, elsefalsewhen the switch is on, elsenull.website/src/hooks/useTrackpadSwipe.ts: the page's wheels, the relayed frame wheels, and thenaturalfield sent when a frame is armed all usenaturalScrolling()instead ofshellNaturalScrolling().website/src/pages/settings/DisplayPanel.tsx: a "Reverse trackpad swipe" toggle under Settings → Display → View, throughusePersistedBool, off by default. It is hidden where the desktop shell reports Natural scrolling, because it would do nothing there.en-XA. The settings registry is regenerated (npm run gen:settings).Backwards compatibility
Compatible: the switch defaults to off, and off gives exactly today's
fingerSigninputs.Removes nothing: the change only adds a key, a setting row and a fallback, and every existing source keeps its precedence.
Tests
website/src/hooks/useTrackpadSwipe.test.ts, "the Reverse trackpad swipe switch":[20, 40, 60];inv: nullgoes through the switch;website/src/test/reverseTrackpadSwipe.test.tsx: the row starts off in a browser tab, writes'1'/'0', and flipsnaturalScrolling()both ways. The row is hidden, and the shell wins, whenelectronAPI.getNaturalScrollingreports a value.Proof: not provable -- frontend test (prove.py runs Python only)
These runs passed locally on this branch:
npx vitest runon the trackpad, settings, i18n and command-palette suites: 198 files and 3354 tests, plus the 5 trackpad-swipe files with 110 tests;npm run typecheck,eslinton the changed files,npm run lint:i18nandnpm run i18n:check;Manual verification
Still required on a Mac with Natural scrolling off, in Chrome:
In Safari the switch changes nothing.
Real-machine verification
Not run yet. It needs a Mac with Natural scrolling off and a trackpad, in Chrome. I will add the before and after results in a comment.
Screenshots / video
The real
SettingsTogglewith the propsDisplayPanelpasses, between its View-section neighbours, captured with scripted Playwright against the Vite dev server and the real stylesheet.Off (the default), light and dark:
On, light and dark:
The hint behind the info tip:
Related Issues
Fixes #38623. Follows #38711. Overlaps #38716 only in the generated settings registry and the locale catalogs. Both are regenerated, so whichever PR lands second rebases and re-runs
npm run gen:settingsandnpm run i18n:pseudo.Checklist