Repository navigation
feat: Remote rendering 4.4a: Update server mode panels when scene changes - #194
Open
LKasianAnsys wants to merge 5 commits into
Conversation
LKasianAnsys
force-pushed
the
feat/4.4a-update-server-mode-panels-when-scene-changes
branch
from
October 28, 2026 14:11
3300896 to
2ca7f83
Compare
LKasianAnsys
force-pushed
the
feat/4.4a-update-server-mode-panels-when-scene-changes
branch
from
October 28, 2026 16:17
2ca7f83 to
32f9772
Compare
LKasianAnsys
force-pushed
the
feat/4.4a-update-server-mode-panels-when-scene-changes
branch
from
October 28, 2026 16:31
32f9772 to
4f17bad
Compare
LKasianAnsys
force-pushed
the
feat/4.4a-update-server-mode-panels-when-scene-changes
branch
from
October 29, 2026 21:57
4f17bad to
5574cb6
Compare
LKasianAnsys
force-pushed
the
feat/4.4a-update-server-mode-panels-when-scene-changes
branch
2 times, most recently
from
November 2, 2026 13:57
c52afc1 to
11d3c3e
Compare
…g into useServerVtk
LKasianAnsys
force-pushed
the
feat/4.4a-update-server-mode-panels-when-scene-changes
branch
from
November 2, 2026 14:24
11d3c3e to
5c61d70
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 #29
Context
Until now, in a loaded visor scene, server-side API calls such as
add_datasetorload_stateupdated the server-mode canvas but not the UI panels, and picks on new parts did not resolve to anything. A refresh was needed to fetch the new, updated scene.In this PR, the server now bumps a
scene_versionstate key once per scene-changing API call, and the client rebuilds the frontend when it changes. The latest request wins, and each replaced frontend releases its listeners.Like the current client mode, server mode now rebuilds the full frontend on each python-originated scene change. (The scope of Phase 4 of the remote rendering epic targets parity with the client mode; an optimization to allow for in-place updates for data-only changes is expected in Phase 6 of the epic.)
Manual check: Start a VISOR session in server mode, open the viewer, run
add_datasetto add a second dataset, and see that the tree shows the new dataset without needing to refresh the page. Clicking a part of the new dataset selects it.Copilot summary
This pull request introduces a robust mechanism for tracking and responding to scene changes in server-mode VTK visualization, ensuring that the frontend reliably rebuilds whenever the scene changes. The main changes include adding a versioning key that increments with every scene modification on the server, a new frontend rebuilder utility on the client to handle rebuild requests efficiently, and comprehensive test coverage for these new behaviors.
Server-side scene change tracking:
scene_versionstate key and logic inServerStatePublisherto increment this value on every scene change, ensuring all modifications are serially tracked and communicated to clients. [1] [2]VisorVTKand its subclasses to call a_post_scene_change_hookafter every scene-changing operation, which bumps thescene_versionin server mode or does nothing in client mode. This is enforced via a new@notifies_scene_changedecorator applied to all relevant methods. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Frontend rebuild and state synchronization:
FrontendRebuilderclass, which ensures that multiple rebuild requests during an ongoing build collapse into a single additional build, preventing redundant work and handling errors gracefully.useServerVtkhook to watch thescene_versionkey and trigger frontend rebuilds usingFrontendRebuilderwhenever the scene changes, ensuring the UI always matches the server state. [1] [2]Testing improvements:
FrontendRebuilder, verifying its correct batching and error-handling behavior.ServerRendererproperly removes its frame listeners on disposal, preventing memory leaks or stale listeners.Internal code refactoring:
_clear_scenemethod, used by bothclearandremove_datasetto avoid code duplication.These changes together provide a robust, efficient, and well-tested mechanism for keeping the frontend in sync with all server-side scene changes in VTK server mode.