Skip to content

fix: forward pointer drags with coordinates to macOS views - #4

Merged
dashersw merged 1 commit into
mainfrom
macos-pointer-drag
Sep 29, 2026
Merged

dashersw merged 1 commit into
mainfrom
macos-pointer-drag

Conversation

@skyturkish

@skyturkish skyturkish commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

GeaRootClickBridge now sends real coordinates, forwards drag moves to the pressed view, and skips the click after a drag.

Ordinary views on macOS received onPointerDown/onPointerUp at (0,0) and
never onPointerMove: GeaRootClickBridge handled only the press
recognizer's began/ended states and dispatched events without
coordinates. Canvases worked because GeaCanvasView feeds TouchRuntime
directly.

The bridge now converts the recognizer location to tree coordinates
(undoing applyViewStyle's y-flip and adding the root's tree origin),
fills the same payload TouchRuntime's dispatchPointer does, dispatches
touchmove to the pressed node on the changed state, and suppresses the
click after a drag past TouchRuntime's 16 px slop. Split-view panes pass
their layout origin to the bridge on every sync.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f7f07e05-713e-4186-b54a-35c993be98f2

📥 Commits

Reviewing files that changed from the base of the PR and between 0ca9c5c and a27e246.

📒 Files selected for processing (1)
  • packages/geastack-apple/targets/macos/main/macos_renderer.mm

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

Walkthrough

The macOS root bridge now tracks press gestures, dispatches coordinate-bearing touch events, and sends a click only when a press ends without being marked as a drag. Gesture coordinates include the root or pane origin.

Changes

macOS Press Gesture Events

Layer / File(s) Summary
Gesture tracking and event dispatch
packages/geastack-apple/targets/macos/main/macos_renderer.mm
The bridge records the hit target and press coordinates, sends touch start, move, and end events, and includes pointer and touch coordinates. Movement greater than 16 units on either axis marks a drag. Single-root and pane synchronization update the bridge origin for tree-space coordinates.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: dogukani

Merge Risk: ⚪ Minimal · up to a27e2

The change adds drag-aware pointer events and click suppression on macOS. No concrete merge-blocking issue was found. The author notes only a manual probe was run and other controls were not re-tested.

Architecture Summary

Architecture risk: 🔵 Low · up to a27e2

The change affects 1 system.

Changed systems: packages/geastack-apple

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/geastack-apple (library) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/geastack-apple/targets/macos/main/macos_renderer.mm: GeaRootClickBridge changes from a click handler to a press handler and adds origin, start/last-coordinate, and drag state for tracking gestures.
  • observed — Modified behavior in packages/geastack-apple/targets/macos/main/macos_renderer.mm: fire: now converts the recognizer location to tree coordinates using the root origin and dispatches events with pointer, coordinate, and touch-point payloads. The old event helper supplied only type and target.
  • observed — Modified behavior in packages/geastack-apple/targets/macos/main/macos_renderer.mm: On press begin, the bridge records the hit target and coordinates and sends TouchStart; on changed states, it sends TouchMove when coordinates differ and marks a drag when either axis moves more than 16 units. On termination it sends TouchEnd at the last coordinates, and sends Click only for an ended press that was not marked as dragged. The previous implementation sent no move events and clicked after every ended press.
  • observed — Modified behavior in packages/geastack-apple/targets/macos/main/macos_renderer.mm: ensureRootClickBridge now accepts and stores a tree-space origin. It still creates and attaches a recognizer only when none exists, but refreshes the origin on every call; previously an existing bridge caused an immediate return without updating state.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: forwarding coordinate-bearing pointer drags to macOS views.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@dashersw
dashersw merged commit 1b1f754 into main Sep 29, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants