Skip to content

feat: [Remote rendering 3.5a] move variable ownership to server - #152

Draft
LKasianAnsys wants to merge 7 commits into
mainfrom
feat/3.5a-move-variable-ownership-to-server
Draft

LKasianAnsys wants to merge 7 commits into
mainfrom
feat/3.5a-move-variable-ownership-to-server

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Addresses #23

Status: WIP

Context

This is the first PR for user story 3.5 in Phase 3 of the remote rendering epic, which sees the visualizer state authority move from client to server.

This PR moves the global variable ownership to the server; previously this was handled on the client.

Copilot summary

This pull request implements a significant architectural change for variable ownership in the VISOR state synchronization model: the server now owns and manages variable records and their ranges, rather than relying on the client to provide this information. This centralizes variable state, improves consistency, and ensures the backend is the authority for variable information. The changes include new models for server-owned variable records, new APIs for setting variable ranges, and updates to validation and persistence logic.

Key changes:

Server-side variable ownership and management:

  • Introduced VisorVariableRecord and VisorVariableRecords in visor_variable_record.py to represent and manage variable state and ranges on the server, including logic for merging, updating, and persisting variable ranges.
  • Updated VisorVariableState to clarify that it is now a persisted projection of the server-owned VisorVariableRecord, not a passthrough of client data.

API and payload changes:

  • Added SetVariableRangePayload model for the new set_variable_range trigger, enabling the frontend to request updates to variable ranges, which are now applied scene-wide by the server.
  • Modified LocalApp in local_app.py to add the set_variable_range trigger and handler, and updated set_part_color_variable to ignore client-supplied min/max values, instead using the server's record. [1] [2] [3] [4] [5] [6]

Persistence and validation updates:

  • Updated PersistedViewerStateV1.from_components to require variable_states as a keyword-only argument, reflecting the server's authoritative role. [1] [2] [3]
  • Enhanced VisorSaveStateResponse to discard any variableStates sent by the client, ensuring only server-owned variable records are persisted and validated.

These changes collectively ensure that variable state is managed, validated, and persisted solely by the server, improving reliability and future extensibility.

@github-actions github-actions Bot added documentation Improvements or additions to documentation test Work associated with testing added enhancement New feature or request labels Oct 1, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/3.4-server-owned-ui-state October 1, 2026 18:24
@github-actions github-actions Bot removed the documentation Improvements or additions to documentation label Oct 1, 2026
@LKasianAnsys
LKasianAnsys marked this pull request as draft October 1, 2026 18:25
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.4-server-owned-ui-state branch 2 times, most recently from e64851b to 1916c0e Compare October 1, 2026 18:58
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5a-move-variable-ownership-to-server branch 2 times, most recently from d5b9b47 to a6e2619 Compare October 1, 2026 21:53
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.4-server-owned-ui-state branch from 1916c0e to f5cf3cb Compare October 2, 2026 15:51
Base automatically changed from feat/3.4-server-owned-ui-state to main October 2, 2026 16:57
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5a-move-variable-ownership-to-server branch from a6e2619 to 328ccf1 Compare October 2, 2026 17:23
@LKasianAnsys LKasianAnsys self-assigned this Oct 2, 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