Repository navigation
editor: orbit and zoom with two-finger trackpad swipes - #4890
Conversation
|
Holding review: upstream PR #4889 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label. |
|
Rebased onto the rewritten parent: the stack below was replayed onto master after #4882 merged, so this layer's owned commits ( |
32b07e6 to
3fc18f8
Compare
3fc18f8 to
b24eda4
Compare
jakildev
left a comment
There was a problem hiding this comment.
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:
scrollSystemis registered in INPUT ahead ofplaceEraseSystem, sog_sculpt.viewportScrolled_is current whenupdateCameraGestureOwnership()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 withdragging_. - 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) usesIRTime::Clock::now()wall time, soviewport_scrollretention 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 appliesfloor(|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.
|
Feedback pass: the review's only items sit under |
|
Merger: cannot auto-resolve mechanically. The PR has Conflicted files:
Labeled The SHA pair: master=8162a732c841e90ddf56acb0594696ff03273805 × PR=da45aac7d0f1fad4eb1c9c5c0f52bb19388a77ff — fleet merger |
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>
da45aac to
80ea13e
Compare
|
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 |
|
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
left a comment
There was a problem hiding this comment.
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
EditorViewportScrollsystem,RotateParamsadditions (buttonNavigation_,scrollOrbit_,zoomRemainder_,lastScroll_),SculptState::viewportScrolled_, theviewport_scrollsession and itscustomCameraInputhook inupdateCameraGestureOwnership(). - The conflict resolution in
main.cppmerged cleanly with #4882's grid changes. The scroll system is still registered ahead ofplaceEraseSystem, andCAMERA_SCROLL_ZOOMis still removed with its include. The pre-destroy hook still clearsscrollOrbit_along withdragging_. - The only new text is the compacted
CLAUDE.mdright-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-sizeis green in CI.
Validation I ran on the head
fleet-build --target IRVoxelEditoron macOS Metal: clean. The worker's comment cites anIRShapeDebugbuild, 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-lintgreen;linux-buildwas 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.
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
Validation used injected scroll input in the native editor. Physical trackpad sensitivity remains a hands-on check.