Skip to content

feat(web): add a setting to disable history swipe navigation - #28370

Open
chomamateusz wants to merge 1 commit into
pingdotgg:mainfrom
chomamateusz:feat/history-swipe-setting
Open

chomamateusz wants to merge 1 commit into
pingdotgg:mainfrom
chomamateusz:feat/history-swipe-setting

Conversation

@chomamateusz

Copy link
Copy Markdown

Problem

On macOS desktop, a Logitech MX Master's horizontal thumb wheel can navigate thread history accidentally, including when horizontal scrolling reaches the edge of wide content. Electron 44's input events carry no trackpad-vs-wheel provenance, so the existing gesture cannot currently be restricted to trackpads.

Change

Add “Swipe to go back and forward” in desktop Settings > General > Navigation, with Settings search, a per-setting reset, and restore-defaults support. The client preference defaults to enabled. Turning it off unmounts the gesture handler and indicator immediately, including during a swipe; turning it on works without reloading. Mouse back/forward buttons and keyboard navigation retain their existing behavior.

Scope and approval

CONTRIBUTING.md states: “A focused configuration option for an established capability may also be eligible without prior feature approval.” This option controls the existing desktop history-swipe capability. The default is unchanged, and the scope adds no workflow or broader navigation behavior. This follows the configuration route; it does not claim explicit maintainer approval or guaranteed acceptance.

The change is limited to the client setting contract, desktop renderer Settings/search/reset integration, its mount gate, and focused tests. Hosted/local web and native mobile do not expose the desktop gesture. The gesture is not documented in user guides, so no documentation change is needed.

Verification

  • Failing first on origin/main at 15fe283, with only regression tests added: both disabled swipe directions still invoked history navigation once; three schema cases failed because the field was absent (5 failures, 28 existing tests passed).
  • With the change: 59 tests passed across settings contracts, AppSidebarLayout browser behavior, the existing swipe helper, and Settings search. Covers disabled back/forward navigation, removal of the indicator during an active swipe, and re-enabling without a reload.
  • Command: vp test run packages/contracts/src/settings.test.ts apps/web/src/components/AppSidebarLayout.browser.test.tsx apps/web/src/components/HistorySwipeNavigation.test.ts apps/web/src/components/settings/settingsSearch.test.ts.
  • vp run check:changed: passed (exit 0): format, lint, both knip passes, typecheck of 35 affected packages/dependents, 64 tests across six files, and four changed-source React Compiler cases.
  • Upstream HistorySwipeNavigation.tsx was unchanged since 305a90d; this change only adds an indicator test ID there. PR fix(web): horizontal scrolling inside diff and file panes no longer switches threads #28091 addresses shadow-root scrollers, a separate case.
  • Manual check in a desktop build carrying this change (recording below).

Evidence

Settings > General > Navigation, enabled and disabled:

setting-on setting-off

Recording: 0–10 s the setting is on and horizontal swipes move between threads; at 12 s it is turned off; 15–24 s the same swipes leave the thread in place.

swipe-demo.mp4

Model: gpt-6.1-sol via Codex CLI, orchestrated by Claude Code.

Horizontal mouse wheels can accidentally navigate desktop thread history.
Electron input events do not distinguish a trackpad swipe from a mouse wheel.

Add a default-enabled client setting with desktop Settings search and reset
support. Unmount the gesture handler when disabled, and cover disabling,
mid-swipe cleanup, and re-enabling with focused regression tests.

Model: gpt-6.1-sol via Codex CLI, orchestrated by Claude Code.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 31, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at db2a71b

Macroscope's review found this PR approvable — Adds a desktop setting to disable swipe history navigation while keeping it enabled by default. The change is reversible and removes gesture listeners when disabled.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 54c5f25 and db2a71b.

Files selected for processing: 8
  • apps/web/src/components/AppSidebarLayout.browser.test.tsx
  • apps/web/src/components/AppSidebarLayout.tsx
  • apps/web/src/components/HistorySwipeNavigation.tsx
  • apps/web/src/components/settings/SettingsPanels.tsx
  • apps/web/src/components/settings/settingsSearch.test.ts
  • apps/web/src/components/settings/settingsSearch.ts
  • packages/contracts/src/settings.test.ts
  • packages/contracts/src/settings.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The change adds a client setting for desktop history swipe navigation. The setting defaults to enabled, appears in Electron General settings, and controls whether AppSidebarLayout renders the navigation component.

Changes: History Swipe Navigation

Layer / File(s) Summary
Client setting contract
packages/contracts/src/settings.ts, packages/contracts/src/settings.test.ts
ClientSettingsSchema defaults historySwipeNavigation to true. ClientSettingsPatch accepts an optional boolean. Tests cover omitted and explicit values.
Settings controls and search
apps/web/src/components/settings/SettingsPanels.tsx, apps/web/src/components/settings/settingsSearch.ts, apps/web/src/components/settings/settingsSearch.test.ts
The Electron General settings panel exposes the setting and a reset action. Restore tracking and restoring defaults include it. Desktop settings search indexes the setting.
Sidebar navigation gating
apps/web/src/components/AppSidebarLayout.tsx, apps/web/src/components/HistorySwipeNavigation.tsx, apps/web/src/components/AppSidebarLayout.browser.test.tsx
AppSidebarLayout renders HistorySwipeNavigation only in Electron when the setting is enabled. Browser tests cover disabled and enabled behavior in both directions. The indicator has a test ID.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related issues

  • pingdotgg/t3code#28023 — The setting added by this change disables desktop trackpad swipe navigation.
  • pingdotgg/t3code#28159 — The setting can disable swipe-based history navigation during horizontal scrolling in the diff panel.
  • pingdotgg/t3code#28160 — The setting can disable the reported unintended desktop history navigation gesture.

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to db2a7

The setting preserves existing swipe behavior by default and can be changed without reloading. No merge-blocking risk was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: adding a setting to disable history swipe navigation.
Description check Passed The description includes all required sections. It explains the problem, implementation, scope justification, focused verification results, manual evidence, and the model and harness used.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@maria-rcks

maria-rcks commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified as-is at db2a71b12f7d5a389f60aa0fc05f1ff56c72de54 on this linux vm. no source changes.

  • reproduced on github/main at 8b74a69019e3 first: horizontal wheel input navigates between threads, with no setting to disable it.
  • used real dev servers, chrome through repository playwright, and the actual electron 44 desktop client built from each revision. created a real git project and two threads through the app. codex gpt-6.1-sol completed both main turns and another turn through the pr's web client. no mocks or seeded conversations.
  • in desktop settings, the control defaults on. switching off blocks both directions and removes the indicator. re-enabling restores both directions without reload. disabling during a swipe removes its indicator. the disabled preference survives reload.
  • keyboard and toolbar back/forward still work while swipes are disabled. settings search for "horizontal wheel", per-setting reset, and restore device defaults work. chrome correctly hides the desktop-only control.
  • blacksmith: desktop build and vp run check:changed 15fe2832727893cbdd2214383f9f971474849695 passed, including 35-package typechecking, 64 tests across six files, and four react compiler cases. all 31 reported ci checks pass.

after disabling, the real-client checks reported:

disabled back swipe keeps beta true
disabled swipe has no indicator true
keyboard back still works while disabled true
disabled forward swipe keeps alpha true
keyboard forward still works while disabled true
toolbar back still works while disabled true
toolbar forward still works while disabled true
re-enabled back swipe works without reload true
re-enabled forward swipe works without reload true

before, main settings with matching project data and viewport:

main general settings without a swipe control

pr, enabled:

pr general settings with swipe navigation enabled

pr, disabled:

pr general settings with swipe navigation disabled

main: horizontal wheel input moves beta to alpha and back.

main desktop wheel navigation between real codex threads

pr: disabled swipes leave the thread unchanged; keyboard and toolbar navigation still work; enabling restores swipe navigation. these animations contain the full recordings. the original mp4s were inspected and played through in t3, including seeking.

pr disabling swipes, preserving other navigation, and re-enabling

Not verified

macos hardware input from a physical trackpad or logitech mx master, mouse thumb buttons, windows desktop, native ios/android, and relay/tunnel connections were not exercised on this linux vm. the wheel checks used trusted chromium input through the real electron renderer and gesture ipc, so they do not prove macos hardware event provenance.

@iliyasone

Copy link
Copy Markdown

Note

🤖 Claude Opus 5.5 responding on behalf of Ilias

I'm a huge +1 on this PR. I use an Apple Magic Trackpad, and I couldn't understand what was happening: while I was scrolling, my threads kept suddenly switching from one to another.

This branch has not been deployed

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants