@devries-cameron20 / t3code Mirror · read-only / commits / 4363d0bf65
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 23:30 UTC

fix(web): mouse tilt wheel no longer switches threads on Windows and Linux desktop (#32963)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 10, 2026 at 21:22 UTC 4363d0bf658f67089fcae185d2354e01a1a6706c
2 files changed +19 -2
apps/web/src/components/HistorySwipeNavigation.browser.test.tsx
+13
@@ -29,6 +29,7 @@ describe("HistorySwipeNavigation", () => {
29 ["a swipe that started in a closed dialog keeps the thread", "closed-dialog", 0, -130, false],
30 ] as const)("%s", async (_name, scroller, scrollLeft, deltaX, navigates) => {
31 navigateHistory.mockReset();
32 + using _platform = vi.spyOn(navigator, "platform", "get").mockReturnValue("MacIntel");
33 await using screen = await render(<HistorySwipeNavigation />);
34 const panel = screen.container.appendChild(document.createElement("div"));
35 const root = scroller.startsWith("shadow") ? panel.attachShadow({ mode: "open" }) : panel;
@@ -58,4 +59,16 @@ describe("HistorySwipeNavigation", () => {
59
60 expect(navigateHistory).toHaveBeenCalledTimes(navigates ? 1 : 0);
61 });
62 +
63 + it("a horizontal mouse wheel tick off macOS keeps the thread", async () => {
64 + navigateHistory.mockReset();
65 + using _platform = vi.spyOn(navigator, "platform", "get").mockReturnValue("Win32");
66 + await using screen = await render(<HistorySwipeNavigation />);
67 + const content = screen.container.appendChild(document.createElement("div"));
68 + content.style.cssText = "height: 20px; width: 100px";
69 +
70 + swipe(content, -120);
71 +
72 + expect(navigateHistory).not.toHaveBeenCalled();
73 + });
74 });
apps/web/src/components/HistorySwipeNavigation.tsx
+6 -2
@@ -1,7 +1,7 @@
1 import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
2 import { useEffect, useState } from "react";
3
4 -import { cn } from "../lib/utils";
4 +import { cn, isMacPlatform } from "../lib/utils";
5 import { canNavigateHistory, navigateHistory, type HistoryDirection } from "../navigationHistory";
6
7 const SWIPE_TRIGGER_DISTANCE = 120;
@@ -88,12 +88,16 @@ export function isMomentumTail(deltas: readonly number[]): boolean {
88 );
89 }
90
91 -/** Two-finger horizontal trackpad swipes go back and forward, like a browser. */
91 +/**
92 + * Two-finger horizontal trackpad swipes go back and forward, like a browser.
93 + * macOS only: on Windows and Linux a mouse tilt wheel is indistinguishable from a trackpad swipe.
94 + */
95 export function HistorySwipeNavigation() {
96 const [swipe, setSwipe] = useState<SwipeIndicatorState | null>(null);
97
98 // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- window wheel and desktop gesture listeners track trackpad swipes
99 useEffect(() => {
100 + if (!isMacPlatform(navigator.platform)) return;
101 let gesture: SwipeGesture | null = null;
102 const hideIndicator = () =>
103 setSwipe((current) => (current === null ? null : { ...current, tracking: false }));