feat: [Remote rendering 3.3a] server-authoritative widget toggles and projection - #137
Open
LKasianAnsys wants to merge 13 commits into
Open
LKasianAnsys wants to merge 13 commits into
LKasianAnsys wants to merge 13 commits into
Conversation
LKasianAnsys
marked this pull request as ready for review
September 23, 2026 22:52
This was referenced Sep 24, 2026
This branch has not been deployed
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 #21
Context
This is the first PR of 4 to move ownership of widget state from the client to the server.
The state authority for the on/off state of four widgets is moved from client to server. The server keeps the value, a trigger per toggle writes it, and save_state reads from it instead of from a round-trip to the browser.
The four widgets addressed in this PR are:
The first three have explicit visibility toggles, whereas the fourth, projection/orthographic mode, is stored as the camera record's field rather than an actual trigger of its own.
The client still applies the toggle locally and now reports what it settled on, so a toggle survives a reconnect or rebuild.
Manual Check
The on/off status for the four widgets is now server-authoritative. This means that:
save: in a viewer with a dataset loaded, toggle all of the widgets on -> run save_state -> thevisor.jsonfile should contain the correct widget visibility values.load: in a viewer, either an empty scene or with the dataset already loaded, runload_state-> the widgets should all be visible.Copilot summary
This pull request adds server-authoritative support for widget toggles and projection control in VISOR, enabling the backend to manage and synchronize the state of UI widgets such as cross-section, edges, bounding box, and projection mode. The changes introduce new payload models, update the API surface for scene mutation, and implement the necessary trigger handlers and renderer methods to support these features.
Backend widget and projection control:
SetCrossSectionVisibilityPayload,SetEdgesVisiblePayload,SetBoundingBoxVisibilityPayload,SetProjectionPayload) inwidget_state_payloads.py, enabling structured communication for these toggles.LocalAppfor each widget toggle and projection, allowing the frontend to request state changes that are now handled server-side.SceneMutationApi) and its usage throughoutlocal_app.pyto include new methods for widget toggles and projection, and refactored injection and method calls accordingly. [1] [2] [3] [4] [5] [6] [7]Renderer and state model updates:
VisorSceneDetails) to include new fields for orthographic, cross-section, edges, and bounding box enabled states, supporting round-trip state serialization. [1] [2]