feat: [Remote rendering 3.2c] attribute camera changes to the input that caused them - #124
Merged
Merged
Conversation
LKasianAnsys
changed the base branch from
main
to
feat/3.2b-save-state-reads-from-server-camera
September 16, 2026 20:04
LKasianAnsys
changed the base branch from
feat/3.2b-save-state-reads-from-server-camera
to
main
September 16, 2026 21:22
LKasianAnsys
changed the base branch from
main
to
feat/3.2b-save-state-reads-from-server-camera
September 16, 2026 21:29
LKasianAnsys
force-pushed
the
feat/3.2b-save-state-reads-from-server-camera
branch
from
September 21, 2026 20:09
ab48dec to
ebb70a9
Compare
LKasianAnsys
force-pushed
the
feat/3.2c-add-camera-gesture-tracker
branch
from
September 21, 2026 20:09
5da4a63 to
b149c50
Compare
Base automatically changed from
feat/3.2b-save-state-reads-from-server-camera
to
main
September 22, 2026 16:05
LKasianAnsys
dismissed
ansBAkula’s stale review
September 22, 2026 16:05
The base branch was changed.
margalva
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Addresses #20
Context
This is the third of 4 PRs for user story 3.2 (#20) of the phased implementation plan (ADR here) for adding remote rendering in VISOR.
After PRs 3.2a (#110) and 3.2b (#111) the server holds the camera and reads it on
save_state, but only theload_statepath writes it. For the record to stay current the browser needs to report camera changes back, and for the server to accept those reports the client needs to distinguish a user gesture from a camera change the server pushed; otherwise, every server-side camera update is echoed back as a gesture. This PR tags (on the client side only) each camera change event with its origin, user input or programmatic:CameraGestureTrackertags a camera eventgestureonly while a mouse button is held on canvas, or within 300ms of a wheel event or az/rkeydown, and settles 300ms after the last event. Anything else isprogrammatic. (see theCameraGestureTrackerdocstring )IRenderergainsaddCameraSettledListener; both renderers implement it.VtkSceneconstructs the tracker and forwards camera events to it.Nothing subscribes to the settle yet, so runtime behaviour is unchanged; the subscriber and the trigger to the server are implemented in 3.2d.
Testing
Manual tests of this PR need the wiring added in 3.2d, so the two need to be tested together.
Copilot summary
This pull request introduces a new mechanism for debouncing and attributing camera change events to either user gestures or programmatic actions. The main addition is the
CameraGestureTracker, which tracks user input and reports when the camera has "settled" after a change, along with the origin of that change. This enables more accurate server-side camera state recording and improves the clarity of user-initiated vs. programmatic camera changes. The implementation includes new tests, interface changes, and integration into both the renderer and scene classes.Key changes:
Camera gesture tracking and debounce logic
CameraGestureTracker(wasm/CameraGestureTracker.js) to debounce raw camera events and attribute each settle window to either a usergestureor aprogrammaticchange, with detailed handling of user input and event timing.CameraGestureTracker, verifying debounce timing, input attribution, and teardown behavior.API and type changes
CameraOrigintype ('gesture' | 'programmatic') and documented its semantics inIRenderer.ts.addCameraSettledListenerto theIRendererinterface, providing a callback that fires once per settle window with the origin of the change.Renderer and scene integration
addCameraSettledListeneras a no-op inNullRendererand as a proxy to the underlying scene inWasmRenderer. [1] [2]CameraGestureTrackerintoVtkScene, ensuring proper listener management and teardown during scene rebuilds to avoid stale reports. [1] [2]