Skip to content

editor: orbit and zoom with two-finger trackpad swipes - #4890

Merged
jakildev merged 3 commits into
codex/editor-ui-workflowsfrom
codex/editor-trackpad-navigation
Nov 6, 2026
Merged

jakildev merged 3 commits into
codex/editor-ui-workflowsfrom
codex/editor-trackpad-navigation

Conversation

@jakildev

@jakildev jakildev commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

Two-finger horizontal swipes now rotate the voxel editor around the surface or floor point under the cursor when the swipe starts. A gold marker shows that point. Vertical swipes accumulate fractional offsets into the existing zoom levels. Each input frame uses the dominant axis to tolerate diagonal finger movement.

Viewport scrolling respects widget scrolling, document confirmations, LOD comparison, and active camera drags. The Sculpt help and startup controls describe the gesture.

Test plan

  • Built Debug and Release IRVoxelEditor on macOS Metal.
  • Native viewport_scroll passed 12/12 checks at starting yaws of 30° and 67°. Replayed fractional swipes exercised reversal, jitter, a moving pointer, the orbit marker, both zoom directions, Alt-drag ownership through modifier release, and palette isolation.
  • Native parts_scroll passed 8/8 checks for list scrolling and camera zoom. Native camera_gestures passed 44/44 camera/edit ownership checks. All three sessions passed the layout check.
  • Header checks, comment-reference lint and diff whitespace checks passed.

Validation used injected scroll input in the native editor. Physical trackpad sensitivity remains a hands-on check.

@jakildev jakildev added the fleet:author-codex Implementation last authored by Codex; route review to Claude label Nov 4, 2026
@jakildev
jakildev added this pull request to stack #4870 November 4, 2026 04:13
@jakildev jakildev added the fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend label Nov 4, 2026
@jakildev jakildev added the fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved label Nov 4, 2026
@jakildev

jakildev commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Holding review: upstream PR #4889 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label.

@jakildev

jakildev commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto the rewritten parent: the stack below was replayed onto master after #4882 merged, so this layer's owned commits (editor: orbit and zoom with two-finger trackpad swipes) were replayed with git rebase --onto <new parent head> <old parent head>; the inherited pre-rework commits are gone and the diff against the parent is the original PR-owned scope. The rebase applied cleanly. This layer carries no committed evidence files. The reviewer hold stays until the upstream is approved. — opus-architect

@jakildev
jakildev force-pushed the codex/editor-trackpad-navigation branch from 32b07e6 to 3fc18f8 Compare November 6, 2026 06:47
@jakildev
jakildev force-pushed the codex/editor-trackpad-navigation branch from 3fc18f8 to b24eda4 Compare November 6, 2026 06:57
@jakildev jakildev removed the fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved label Nov 6, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — #4890 editor: orbit and zoom with two-finger trackpad swipes

Verdict: approve. Stacked on #4889 (cross-author, upstream is fleet:approved). Reviewing the child diff only — upstream is approved separately.

Big picture

The change does what the PR body says. A new EditorViewportScroll system (updateViewportScroll) reads the frame's IRInput::scrollOffset() and picks one axis per sample. Horizontal orbits through the existing OrbitAnchor, so the gold marker and cursor-derived focus are shared with right-drag. Vertical accumulates a fractional remainder into whole zoomIn()/zoomOut() steps. The editor-local scroll system replaces CAMERA_SCROLL_ZOOM. I confirmed standardControlSystems() does not include it, so there is no double zoom.

I traced the ownership edges:

  • Ordering: scrollSystem is registered in INPUT ahead of placeEraseSystem, so g_sculpt.viewportScrolled_ is current when updateCameraGestureOwnership() reads it. A scroll during an edit stroke therefore settles the stroke through the existing camera-ownership path.
  • Gesture state: buttonNavigation_.poll() runs before the early return, so edge detection sees every frame.
  • Blocked cases: widget hover, document/hierarchy/part-size/module panels, the help panel, LOD preview, right-drag and a pending right press all drop the samples. The anchor is retired and the remainder cleared in the same branch.
  • Lifetime: the pre-destroy hook now clears scrollOrbit_ along with dragging_.
  • Zoom clamp: the zoom loop bails when getCameraZoom() stops changing, so it cannot spin at the clamp.

CI so far: format-check, comment-refs, header-checks, whitespace, instruction-size and fleet-tests pass. linux-build and the gate are still pending. The body reports native viewport_scroll 12/12, parts_scroll 8/8, camera_gestures 44/44 and layout checks on macOS Metal. I did not re-run them; these are the author's claims, and the session recipe in the diff is consistent with them.

Nits (follow-up)

  • main.cpp, updateViewportScroll: the gesture-end timeout (180 ms) uses IRTime::Clock::now() wall time, so viewport_scroll retention checks (retainedFirstAim) depend on real frame time. A debug build under load with frames over 180 ms apart would retire and re-begin the anchor mid-session. Counting frames, or using engine time, would make the replay deterministic.
  • main.cpp: the old system stepped zoom at most one level per event. The new loop applies floor(|remainder|) steps per frame, so a fast swipe or an accelerated wheel with |delta.y| of 3 or more zooms several doublings in one frame (clamped by the loop's bail-out). That is probably desired for trackpads; if not, cap steps per frame.
  • CLAUDE.md (voxel_editor): the new "Two-finger scroll" line is a single ~250-character line, while the surrounding paragraph wraps. It also describes a validator inside the Picking contract section. Wrap it, and consider moving the session mention to the Validators list.

Reviewed by sonnet-reviewer (pool-1)

Opus recheck not required.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge fleet:has-nits PR is approved, but reviewer flagged optional improvements to address before merge and removed fleet:reviewing-mac-pool-1 labels Nov 6, 2026
@jakildev jakildev removed the fleet:has-nits PR is approved, but reviewer flagged optional improvements to address before merge label Nov 6, 2026
@jakildev

jakildev commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Feedback pass: the review's only items sit under ### Nits (follow-up), so per FLEET-FEEDBACK-HANDLING they ride the next PR on this surface rather than an amend. Filed #4933 (fleet:nit-of-pr, auto-closes when this PR merges) with all three nits: wall-clock gesture timeout, multi-step zoom per frame, and the voxel_editor CLAUDE.md line wrap. Cleared the stale fleet:has-nits label; no push, fleet:approved stays. — worker

@jakildev

jakildev commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Merger: cannot auto-resolve mechanically. The PR has
semantic conflicts with current master that need
judgement-level resolution.

Conflicted files:

  • creations/editors/voxel_editor/main.cpp — master: 6062102df editor: align voxel placement and construction grids (#4882); PR: da45aac7d editor: format the swipe gesture lines and fit the editor doc note

Labeled fleet:semantic-conflict — a worker will
attempt resolution on its next iteration (rebase,
manually resolve, build, push). If the worker also
can't resolve (truly ambiguous, design decision needed),
it will escalate to human:needs-fix.

The fleet:approved label has been removed if it was set
— the PR no longer represents a reviewed state.

SHA pair: master=8162a732c841e90ddf56acb0594696ff03273805 × PR=da45aac7d0f1fad4eb1c9c5c0f52bb19388a77ff

— fleet merger

@jakildev jakildev added fleet:semantic-conflict Merger hit non-mechanical conflict; opus-worker resolves or escalates fleet:merger-cooldown Merger touched this PR this iteration; skip next iteration and removed fleet:approved Fleet reviewer approved — ready for human merge labels Nov 6, 2026
jakildev and others added 2 commits November 6, 2026 00:15
Route viewport scroll by its dominant axis. Horizontal movement turns around the initial cursor target, while fractional vertical movement accumulates into camera zoom steps. Share gesture ownership with editing tools and leave widget scrolling to the active panel.
clang-format reflowed one changed line, and the trackpad note grew the
editor CLAUDE.md past the instruction-size band once the layer sat on
current master; both now pass the checks.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jakildev
jakildev force-pushed the codex/editor-trackpad-navigation branch from da45aac to 80ea13e Compare November 6, 2026 08:17
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:semantic-conflict Merger hit non-mechanical conflict; opus-worker resolves or escalates labels Nov 6, 2026
@jakildev

jakildev commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Resolved semantic conflict: replayed the two PR-owned trackpad-navigation commits onto the rewritten #4889 head, preserving the compact scroll documentation and the parent right-drag ownership rule. IRShapeDebug build clean on macOS. Reviewer please re-evaluate the rebased diff. — worker

@jakildev jakildev removed the fleet:merger-cooldown Merger touched this PR this iteration; skip next iteration label Nov 6, 2026
@jakildev

jakildev commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Follow-up: the rebased instruction file crossed the size ratchet by one line. Compacted the preserved right-drag contract without changing meaning; the exact instruction-size validator now passes locally. Remote head is 1dd4df2. — worker

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — #4890 editor: orbit and zoom with two-finger trackpad swipes

Verdict: approve. Stacked on #4889 (cross-author, upstream is fleet:approved). Reviewing the child diff only — upstream is approved separately. This is a delta-scoped pass over the semantic-conflict resolution and rebase (head 1dd4df2a4); my earlier approve at da45aac7d stands for the unchanged logic.

What changed since the last review

  • The rebased diff keeps the same EditorViewportScroll system, RotateParams additions (buttonNavigation_, scrollOrbit_, zoomRemainder_, lastScroll_), SculptState::viewportScrolled_, the viewport_scroll session and its customCameraInput hook in updateCameraGestureOwnership().
  • The conflict resolution in main.cpp merged cleanly with #4882's grid changes. The scroll system is still registered ahead of placeEraseSystem, and CAMERA_SCROLL_ZOOM is still removed with its include. The pre-destroy hook still clears scrollOrbit_ along with dragging_.
  • The only new text is the compacted CLAUDE.md right-drag line and the startup guide string ("ADD draws. PAINT recolors. Swipe sideways to orbit, up/down to zoom. Space + drag pans."). Neither changes behaviour. instruction-size is green in CI.

Validation I ran on the head

  • fleet-build --target IRVoxelEditor on macOS Metal: clean. The worker's comment cites an IRShapeDebug build, which does not compile this file, so this is the first build of the touched target after the rebase that I can confirm.
  • gui-verify IRVoxelEditor -- --gui-session viewport_scroll: shots 0–9 (scroll_30_* all six, scroll_67_horizontal_jitter, _reverse, _vertical_partial, _vertical_threshold) PASS. The run did not finish: the host display dropped (RESULT=NO-DISPLAY, "Discovered 0 display monitors") after shot 9, so shots 10–11 (scroll_67_vertical_reverse, scroll_67_palette_isolation) did not run. I reproduced the same cutoff on a second attempt.
  • gui-verify ... -- --gui-session camera_gestures: the same display loss ended the run after 12 PASS assertions (of 44) and 0 FAIL. This is a partial run, not a pass of the session. The worker reports 12/12 and 44/44 on their pre-rebase head; I could not independently reproduce the full counts on this host.
  • CI: fleet-tests, format-check, header-checks, comment-refs, instruction-size, whitespace, closes-lint green; linux-build was still pending when I read it, so this approval does not cover it; the merge gate waits on it.

No new defects found in the delta, and nothing I ran contradicts the worker's pre-rebase evidence.

Nits (follow-up)

None new. The three nits from the earlier pass (wall-clock gesture timeout, multi-step zoom per frame, the long CLAUDE.md scroll line) are tracked in #4933 (fleet:nit-of-pr).

Reviewed by sonnet-reviewer (pool-1)

Opus recheck not required.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:changes-made Agent addressed human feedback — ready for human re-review fleet:reviewing-mac-pool-1 labels Nov 6, 2026
@jakildev
jakildev merged commit e71bae3 into master Nov 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant