Skip to content

feat(timeline): zoom on a macOS trackpad pinch in WebKit - #5608

Merged
georgi merged 1 commit into
mainfrom
claude/macos-timeline-zoom-gestures-cd0z6g
Sep 5, 2026
Merged

feat(timeline): zoom on a macOS trackpad pinch in WebKit#5608
georgi merged 1 commit into
mainfrom
claude/macos-timeline-zoom-gestures-cd0z6g

Conversation

@georgi

@georgi georgi commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

What changed

A macOS trackpad pinch over the timeline lanes now zooms in Safari/WebKit. Chromium reports a pinch as a synthetic ctrlKey wheel, which TracksRegion already routes to a cursor-anchored zoom; WebKit instead fires gesturestart/gesturechange/gestureend with a cumulative scale and no wheel event at all, so the pinch fell through to Safari's page zoom. The new listeners on the lanes scroller feed the same rAF-batched setZoom + zoomAnchorRef path (one store publish per frame, the time under the fingers stays put), preventDefault so Safari does not zoom the page, and set a flag that suppresses the wheel-zoom route while a gesture is in flight so the two can't compound. Feature-detected via ongesturechange, so nothing changes in Chromium or Electron. The pinch math lives in a pure timelineGesture.ts helper.

Verification

  • npm run test:affected — the two failures it reported (@nodetool-ai/kernel, @nodetool-ai/data-nodes) are pre-existing on this branch: kernel passes on a rerun (984 passed), and data-nodes fails identically with the diff stashed (tests/lib-charts-platforms.test.ts: "Failed to resolve entry for package @nodetool-ai/data-nodes"). Directly: npx jest src/components/timeline → 67 suites, 473 tests passed.
  • npm run typecheck — web leg clean (npx tsc --noEmit -p web/tsconfig.json, exit 0) after npm install + npm run build:packages; the mobile leg fails on missing Expo/React Native deps, which are not installed in this container and unrelated to the diff.
  • npm run lint — passes (warnings only, all on pre-existing lines).
  • npm run dev:nodetool -- harness gate --base HEAD — maps to the web-editor surface, 0 selfchecks to run. (--base main is meaningless here: the local origin/main ref was stale and pulled in 683 unrelated files.)

Both new suites were inverted once and observed failing:

  • pinchMsPerPx with startMsPerPx / scale flipped to * scaleTests: 3 failed, 5 passed.
  • An early return at the top of the gesture effect → Tests: 2 failed, 2 passed in TracksRegionGesture.test.tsx.

New checks

  • Both inverted once and observed failing; the failing output is in Verification above.
  • TracksRegionGesture.test.tsx drives the real listeners on the rendered region (synthesized WebKit gesture events), and its last case asserts the effect stays off where ongesturechange is absent, so it cannot pass by matching nothing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NZFK5r1WVrGxsvXrKQULJM


Generated by Claude Code

Chromium reports a trackpad pinch as a synthetic ctrlKey wheel, which the
tracks region already routes to an anchored zoom. Safari reports one as
gesturestart/gesturechange/gestureend with a cumulative scale and no wheel
event, so a pinch over the timeline zoomed the page instead of the lanes.

Adds the WebKit gesture route on the lanes scroller, feeding the same
rAF-batched setZoom + cursor-anchor path, and suppresses the wheel zoom
while a gesture is in flight so the two can't compound.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZFK5r1WVrGxsvXrKQULJM
@georgi
georgi enabled auto-merge September 5, 2026 16:31
@georgi
georgi merged commit 2ac69cd into main Sep 5, 2026
23 checks passed
@georgi
georgi deleted the claude/macos-timeline-zoom-gestures-cd0z6g branch September 5, 2026 16:37
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