feat: [Remote rendering 3.4] server-owned UI panel and theme state - #144
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
changed the base branch from
main
to
feat/3.3d-sync-orientation-widget-to-server
September 25, 2026 17:04
LKasianAnsys
changed the base branch from
feat/3.3d-sync-orientation-widget-to-server
to
main
September 25, 2026 18:59
LKasianAnsys
changed the base branch from
main
to
feat/3.3d-sync-orientation-widget-to-server
September 25, 2026 19:43
LKasianAnsys
marked this pull request as ready for review
September 25, 2026 19:43
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
Resolves #22
Context
This is user story 4 in Phase 3 of the remote rendering epic, where the viewer state ownership is moved from client to server. 3.4 sees the panel layout and theme become server-authoritative.
Previously, the UI state was read from the browser on
save_stateand written into the persisted state, and was passed back through to the viewer onload_state, but the server itself held no record of it. This PR changes that: it adds a server-side record for the UI panel state, has the client sync it on panel collapse/expand and tab selection, seeds the browser from it on a refresh and rebuild, and uses it for save/load. The dark theme gets no trigger, as no control exists on the browser, and the server already owns dark_mode, sosave_statenow records the server's value rather than the browser's.Fixed, pre-existing:
Copilot summary
This pull request introduces server-owned UI panel and theme state management for remote rendering, enhancing consistency and reliability in the UI's appearance and layout. The main changes implement a unified
VisorUIStatemodel on the server, which now tracks theme and panel layout state, and ensures these are synchronized between frontend and backend. This involves new payload models, updated state handling, and refactored state application and retrieval logic.UI State Management Enhancements
VisorUIStatemodel to hold theme and panel layout state on the server, replacing separatedark_modehandling and ensuring all UI state is owned and managed centrally. (src/ansys/visor/viewer/vtk/scene/base.py,src/ansys/visor/viewer/models/common/visor_ui_state.py)from_components,apply_state,get_state,get_scene_details) to use the unifiedVisorUIStateobject, passing the full UI state record rather than individual fields. (src/ansys/visor/viewer/models/runtime/scene/runtime_app_state.py,src/ansys/visor/viewer/models/runtime/visor_scene_details.py,src/ansys/visor/viewer/vtk/scene/base.py) [1] [2] [3]Panel Layout State Synchronization
SetPanelTopLeftPanelCollapsedPayload,SetPanelTopRightPanelCollapsedPayload,SetPanelTopRightLegendCollapsedPayload, andSetPanelTopRightTabIndexPayload, each carrying the relevant UI state from frontend to backend. (src/ansys/visor/viewer/models/runtime/requests/widget_state_payloads.py)LocalAppto receive and apply these panel layout state changes from the frontend. (src/ansys/visor/viewer/app/trame/local_app.py)These changes collectively ensure that the server is the source of truth for UI theme and panel layout, improving synchronization and reliability in multi-user or remote rendering scenarios.