feat: [Remote rendering 3.2d] report settled camera gestures to the server - #125
Merged
Merged
Conversation
LKasianAnsys
force-pushed
the
feat/3.2d-report-camera-to-server
branch
from
September 16, 2026 21:29
b1d5fff to
8f07192
Compare
LKasianAnsys
changed the base branch from
main
to
feat/3.2c-add-camera-gesture-tracker
September 16, 2026 21:48
LKasianAnsys
force-pushed
the
feat/3.2d-report-camera-to-server
branch
from
September 16, 2026 22:40
bd5df63 to
551ddc2
Compare
# Conflicts: # tests/unit/vtk/scene/test_base.py
LKasianAnsys
force-pushed
the
feat/3.2c-add-camera-gesture-tracker
branch
from
September 21, 2026 20:09
5da4a63 to
b149c50
Compare
LKasianAnsys
force-pushed
the
feat/3.2d-report-camera-to-server
branch
from
September 21, 2026 20:09
aa2a5e4 to
07de410
Compare
Base automatically changed from
feat/3.2c-add-camera-gesture-tracker
to
main
September 22, 2026 16:20
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
Resolves #20
Context
This is the last of 4 PRs for user story 3.2 (#20) of the phased implementation plan (ADR here) for adding remote rendering in VISOR.
PR 3.2a (#110) added the server-side camera record and populated it on load, PR 3.2b (#111) updated
save_stateto read from it, and PR 3.2c (#124) tags each client-side camera change asgestureorprogrammatic. Gestures still do not reach the server-side record. This PR adds the client-to-server report, so the record is updated after every completed gesture andsave_statewrites the current camera.CameraSyncReportersubscribes to teh settle from PR 3.2c, reads the camera once at settle time, and sends it with its origin as a newsync_cameratrigger.VisorFrontendholds the subscription and releases it when the frontend is replaced on rebuild, so one settle produces one report.sync_cameratrigger handler onLocalApp; payloads not taggedgestureare dropped before the coordinator (logged, so an echo is visible invisor.log)VisorSceneBase.sync_camera: under_vtk_lock, writes the record, applies it to the pipeline, and re-serializes.Two pre-existing bugs, found while testing this PR, are fixed here:
z/rhandler had no modifier check, soCtrl+Rreached it as a plainrand reset the camera.Ctrl+Rdid was reset the camera, and since a reset lands on the default framing it looked like a reload had happened.Ctrl+Rafter a camera update in the browser replaces the recorded camera with the reset one.VtkScene andCameraGestureTrackerhave been updated tokeydownand ignoreCtrl,Meta,Alt` and auto-repeat.tabindex="0", so after any click the canvas held focus andCtrl+R,Ctrl+FandF5were cancelled until focus moved.RemoteVtkScenenow removes the attribute; all VISOR key listeners are onwindow, so nothing depends on focus canvas.Testing
To test this change, which is the full 3.2 user story work, run the VISOR server, and open the
logs/visor.logfile.z,rload_stateCopilot summary
This pull request implements server-side tracking of user camera gestures. It introduces a new
sync_cameratrigger, allowing the frontend to report settled camera gestures to the backend, where they are validated, logged, and applied to the server-side camera state. The implementation ensures that only genuine user gestures are recorded, avoids redundant updates, and maintains clear separation of concerns for testability and maintainability.The most important changes are:
Backend: Camera Gesture Reporting and Handling
sync_cameratrigger to the backend, including theSyncCameraPayloadmodel and validation logic, to accept and process camera gesture reports from the frontend. Only gestures withorigin: "gesture"are recorded; others are logged and dropped. (src/ansys/visor/viewer/app/trame/local_app.py,src/ansys/visor/viewer/models/runtime/requests/sync_camera_payload.py) [1] [2]sync_cameramethod on the scene coordinator to update the backend camera state and re-serialize it, without triggering client notifications or causing update loops. (src/ansys/visor/viewer/vtk/scene/base.py)Frontend: Camera Gesture Detection and Reporting
CameraSyncReportermodule that subscribes to settled camera gestures, builds a precise payload, and sends it to the server using the provided trigger sender. The subscription is managed to avoid duplicate reports on frontend rebuilds. (src/ansys/visor/visor-client/src/CameraSyncReporter.ts,src/ansys/visor/visor-client/src/VisorFrontend.tsx,src/ansys/visor/visor-client/src/App.tsx) [1] [2] [3]src/ansys/visor/visor-client/src/VisorFrontend.tsx,src/ansys/visor/visor-client/src/App.tsx) [1] [2]Testing and Maintenance
keydowninstead ofkeyupfor gesture detection). (src/ansys/visor/visor-client/src/jest-tests/CameraGestureTracker.test.js) [1] [2] [3]