Skip to content

feat: [Remote rendering 3.4] server-owned UI panel and theme state - #144

Open
LKasianAnsys wants to merge 14 commits into
feat/3.3d-sync-orientation-widget-to-serverfrom
feat/3.4-server-owned-ui-state
Open

LKasianAnsys wants to merge 14 commits into
feat/3.3d-sync-orientation-widget-to-serverfrom
feat/3.4-server-owned-ui-state

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

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_state and written into the persisted state, and was passed back through to the viewer on load_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, so save_state now records the server's value rather than the browser's.

Fixed, pre-existing:

  • The properties panel previously initialized itself empty on mount, so a part selected before the panel mounted (a refresh) showed as selected in the tree and on the mesh but not in the panel. It now reads the tree view's current selection at mount.

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 VisorUIState model 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

  • Introduced a VisorUIState model to hold theme and panel layout state on the server, replacing separate dark_mode handling 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)
  • Updated state construction and application methods (from_components, apply_state, get_state, get_scene_details) to use the unified VisorUIState object, 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

  • Added new payload models for panel layout state: SetPanelTopLeftPanelCollapsedPayload, SetPanelTopRightPanelCollapsedPayload, SetPanelTopRightLegendCollapsedPayload, and SetPanelTopRightTabIndexPayload, each carrying the relevant UI state from frontend to backend. (src/ansys/visor/viewer/models/runtime/requests/widget_state_payloads.py)
  • Implemented new backend triggers and handlers in LocalApp to 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.

@github-actions github-actions Bot added test Work associated with testing added labels Sep 25, 2026
@LKasianAnsys LKasianAnsys self-assigned this Sep 25, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Sep 25, 2026
@LKasianAnsys LKasianAnsys changed the title Feat/3.4 server owned UI state feat: [Remote rendering 3.4] server-owned UI panel and theme state Sep 25, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/3.3d-sync-orientation-widget-to-server September 25, 2026 17:04
@LKasianAnsys
LKasianAnsys changed the base branch from feat/3.3d-sync-orientation-widget-to-server to main September 25, 2026 18:59
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/3.3d-sync-orientation-widget-to-server September 25, 2026 19:43
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review September 25, 2026 19:43

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.

[Remote rendering 3.4] UI panel and theme state authority

2 participants