feat: [Remote rendering 3.2b] save state reads from server camera - #111
Merged
Merged
Conversation
LKasianAnsys
force-pushed
the
feat/3.2b-save-state-reads-from-server-camera
branch
from
September 16, 2026 18:51
602a815 to
5412adf
Compare
LKasianAnsys
changed the base branch from
main
to
feat/3.2a-server-tracked-camera
September 16, 2026 19:26
LKasianAnsys
marked this pull request as ready for review
September 16, 2026 21:20
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
dismissed
ansBAkula’s stale review
September 22, 2026 15:14
The base branch was changed.
margalva
approved these changes
Sep 22, 2026
LKasianAnsys
deleted the
feat/3.2b-save-state-reads-from-server-camera
branch
September 22, 2026 16:05
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 second 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 added a server-side camera record and populated it on
load_state. The save path still takes its camera from the browser's reply to the save-time round trip, so the server holds a camera it does not yet use.This PR is the second step:
get_statenow takesscene.camerafrom the record instead of from the client's reply, so the browser is no longer a camera source on the save path. The round trip itself is unchanged; only the camera field is superseded. Gestures do not reach the record until PR 3.2d, so the record still reflects the loaded camera at this point (see below).Note before testing: In this PR,
save_statewrites the camera that was loaded, not the camera the user has moved to. That is the expected intermediate state. To test:scene.camerainvisor.jsonmatches the loaded camera. (PR 3.2d is where the actual browser camera will be reflected in the persisted state)Two cleanups are included as described in the auto-generated summary below; the duplicate
cameradeclaration inPersistedSceneStateis removed, andsetCameraStateAsyncnow takes only the seven fields it applies. Neither changes the runtime behaviour.Copilot summary
This pull request ensures that when saving the viewer state, the camera information is always sourced from the server's authoritative camera record, rather than from the browser's reply or the VTK pipeline. It also introduces a clear distinction between the camera state that can be applied from the frontend and the full camera state, and adds comprehensive tests to guarantee correct behavior.
Key changes include:
Backend logic and data model:
get_state, the camera is now always taken from the renderer's record (get_camera_state()), never from the browser's reply or the pipeline. [1] [2]PersistedSceneStatemodel cleans up a duplicatecamerafield.Frontend/TypeScript API:
AppliedCameraStatetype, representing only the seven camera fields that can be set from the frontend, and updated theIRendererinterface and implementations to use this type forsetCameraStateAsync. [1] [2] [3] [4] [5] [6]Testing and verification: