Repository navigation
chore: [Remote rendering 3.6b] Resolve state on server and apply as given on the client - #166
Open
LKasianAnsys wants to merge 14 commits into
Open
LKasianAnsys wants to merge 14 commits into
LKasianAnsys wants to merge 14 commits into
Conversation
LKasianAnsys
force-pushed
the
chore/3.6b-resolve-state-on-server
branch
from
October 9, 2026 22:09
2b71e87 to
b43d7cd
Compare
LKasianAnsys
force-pushed
the
chore/3.6a-clean-up-state
branch
from
October 13, 2026 17:06
72ff429 to
edc2803
Compare
LKasianAnsys
force-pushed
the
chore/3.6b-resolve-state-on-server
branch
3 times, most recently
from
October 14, 2026 03:37
094f434 to
137b19f
Compare
LKasianAnsys
changed the base branch from
chore/3.6a-clean-up-state
to
chore/3.6c-reserialize-in-renderer
October 14, 2026 03:38
LKasianAnsys
marked this pull request as ready for review
October 14, 2026 04:41
LKasianAnsys
changed the base branch from
chore/3.6c-reserialize-in-renderer
to
main
October 14, 2026 13:34
LKasianAnsys
changed the base branch from
main
to
chore/3.6c-reserialize-in-renderer
October 14, 2026 13:34
LKasianAnsys
force-pushed
the
chore/3.6b-resolve-state-on-server
branch
from
October 14, 2026 20:45
3d535ce to
7458089
Compare
LKasianAnsys
force-pushed
the
chore/3.6c-reserialize-in-renderer
branch
2 times, most recently
from
October 15, 2026 15:00
4a618a5 to
3e43f27
Compare
LKasianAnsys
force-pushed
the
chore/3.6b-resolve-state-on-server
branch
from
October 15, 2026 15:00
285c16f to
2b40e33
Compare
LKasianAnsys
force-pushed
the
chore/3.6c-reserialize-in-renderer
branch
from
October 16, 2026 17:04
3e43f27 to
bf0e6dd
Compare
LKasianAnsys
force-pushed
the
chore/3.6b-resolve-state-on-server
branch
from
October 16, 2026 17:05
2b40e33 to
a1b3d5d
Compare
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 #24
Context
Until now, the viewer's per-part visual state (whether a part is visible, its opacity, selected, diffuse color, color variable) was allowed to be unset/null at every level. The server's runtime record for a part could hold null in any field. For example, a freshly loaded dataset had no part records at all, so if a dataset were loaded immediately followed by a save_state, the save would write
parts: {}, and a load_state had inconsistent handling of null or missing values: a literal fallback in some server apply paths, and the client's own values in others.This PR makes this behaviour deliberate: the server resolves a value for every field, so a runtime record is never unset. A file is applied over the server's current state by one rule. The client applies what it is sent, no longer holding defaults of its own.
Changes
RuntimeUIState,RuntimeSceneState,RuntimeViewState, composed byRuntimeAppState).VisorStateMapper.persisted_to_runtime, per field:nullappears only where it is meaningful:colorVariable, the camera, clipping plane, andorthographicEnabledbefore a camera exists.RuntimeAppState(used inload_state) and is dropped fromVisorSceneDetails(used in server pushes/reconnects). The renderer owns camera and cross-section plane records, and the object graph already delivers them on every API push so the payload copy was a second channel the client never applied.load_statepath keeps them underRuntimeAppState.view: the client currently applies them from that push rather than relying on the object graph for delivery.colorVariableturns scalar coloring off and the delivered diffuse color shows. The Dash parts prop follows from the wire.add_datasetthe server applies every part's record to its pipeline. Metadata-seeded records were prviously stored and never applied on the server; the client did it on first delivery, which this PR removes.Persisted state
The persisted file schema is unchanged and older files load as before.
Visible behaviour changes:
startwith a dataset loaded, then immediately runningsave_statewrites a record per part. (Previously it held 'null' values throughout).load_statecontains a unit.Manual check
parts: {}).save_stateagain: A's opacity should read 1.0 in the saved state file, not null.startoradd_datasetwith metadata setting the opacity of one or more part: the correct opacity should be applied on the first frame.Copilot summary
This pull request refactors and improves how runtime and persisted viewer state are modeled and resolved on the server. The changes clarify the separation between runtime (in-memory, server-owned) and persisted (file-loaded) state, introduce overlay logic to cleanly resolve state when loading files, and update several models to use required fields with explicit defaults. The refactor also splits the UI, scene, and view state into distinct models, each with clear responsibilities.
The most important changes include:
State Modeling and Overlay Logic:
overlaid_with) forRuntimeUIState,RuntimeSceneState, andRuntimePartPropertiesto resolve the final runtime state by combining current, persisted, and default values according to clear rules. [1] [2] [3]UI, Scene, and View State Separation:
RuntimeUIState,RuntimeSceneState, and newRuntimeViewState, each with required fields and explicit defaults. UpdatedRuntimeAppStateto own these records. [1] [2] [3]Part Properties Refactor:
RuntimePartPropertiesto require all fields exceptcolor_variable, provide adefault_formethod, and implement overlay logic for merging with persisted properties. AddedVariableReferencefor color mapping.Persisted State Model Renaming:
VisorUIStatetoPersistedUIStatefor clarity, and updated all references to use the new name. [1] [2] [3] [4]Defaults and Constants:
VisorPartDefaultsfor default part property values, centralizing defaults for opacity, visibility, selection, and color.These changes collectively improve maintainability, clarity, and correctness when resolving viewer state, especially when loading files with partial or missing information.