Skip to content

feat: [Remote rendering 3.3a] server-authoritative widget toggles and projection - #137

Open
LKasianAnsys wants to merge 13 commits into
mainfrom
feat/3.3a-server-tracked-widget-toggles
Open

LKasianAnsys wants to merge 13 commits into
mainfrom
feat/3.3a-server-tracked-widget-toggles

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • cross section widget
  • bounding box widget
  • wire frame (edge visibility) widget
  • orthographic widget (projection mode)

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:

  • a browser refresh will preserve whether any of the four widgets are enabled, and
  • save_state reads from the server-side records, and load_state reads the persisted state back into the server's copy of the scene. This should not result in any behaviour change, as the widget state was previously obtained by round trips to the client, but to verify no regressions:
    • save: in a viewer with a dataset loaded, toggle all of the widgets on -> run save_state -> the visor.json file should contain the correct widget visibility values.
    • load: in a viewer, either an empty scene or with the dataset already loaded, run load_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:

  • Added new payload models for widget-state triggers and projection (SetCrossSectionVisibilityPayload, SetEdgesVisiblePayload, SetBoundingBoxVisibilityPayload, SetProjectionPayload) in widget_state_payloads.py, enabling structured communication for these toggles.
  • Implemented new trigger handlers in LocalApp for each widget toggle and projection, allowing the frontend to request state changes that are now handled server-side.
  • Updated the scene mutation protocol (SceneMutationApi) and its usage throughout local_app.py to 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:

  • Added abstract and concrete methods to the renderer base and local renderer classes for handling projection and edges visibility, ensuring these can be set and tracked by the backend. [1] [2] [3]
  • Extended the scene details model (VisorSceneDetails) to include new fields for orthographic, cross-section, edges, and bounding box enabled states, supporting round-trip state serialization. [1] [2]

@github-actions github-actions Bot added test Work associated with testing added enhancement New feature or request labels Sep 22, 2026
@LKasianAnsys LKasianAnsys changed the title feat: [Remote rendering 3.3a] server tracked widget toggles feat: [Remote rendering 3.3a] server-authoritative widget toggles and projection Sep 22, 2026
@LKasianAnsys LKasianAnsys self-assigned this Sep 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added enhancement New feature or request test Work associated with testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants