Repository navigation
feat: [Remote rendering 4.2a] Move CLIENT mode viewer wiring out of app - #184
Open
LKasianAnsys wants to merge 4 commits into
Open
LKasianAnsys wants to merge 4 commits into
LKasianAnsys wants to merge 4 commits into
Conversation
LKasianAnsys
force-pushed
the
feat/4.1d-add-server-rendering-mode
branch
from
October 26, 2026 14:15
26fa6a3 to
63b6e49
Compare
LKasianAnsys
force-pushed
the
feat/4.2a-move-client-mode-wiring-out-of-app
branch
from
October 26, 2026 14:15
11e0806 to
cdd67ea
Compare
LKasianAnsys
force-pushed
the
feat/4.2a-move-client-mode-wiring-out-of-app
branch
from
October 26, 2026 17:27
cdd67ea to
279ad21
Compare
LKasianAnsys
marked this pull request as ready for review
October 26, 2026 17:41
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 #27
Context
This PR moves the client-mode viewer wiring out of App.tsx into
useClientVtkand shares the frontend build, so that server mode can add its own hook beside it and reuse the same build. Until now, App.tsx has held that wiring directly, so a second rendering mode would not have a clean place to plug in.This is a pure refactor, no behaviour changes.
Copilot summary
This pull request refactors the client-side viewer wiring for CLIENT mode, moving key logic out of
App.tsxand into dedicated hooks and helper modules. The changes modularize and clarify how the frontend is constructed, how the renderer and event listeners are managed, and how the camera sync reporter is attached and released. This improves maintainability, testability, and ensures that event listeners are correctly cleaned up when the frontend is replaced.Refactoring and Modularization:
Moved CLIENT mode viewer wiring logic from
App.tsxinto a new custom hookuseClientVtkand a helper functionbuildFrontendAsync, significantly simplifyingApp.tsxand centralizing the logic for connecting to the wasm scene, rebuilding the frontend, and handling server updates. [1] [2] [3] [4]Introduced
useVisorArgsanduseClientVtkhooks to encapsulate argument handling and client-mode renderer management, replacing ad-hoc logic inApp.tsx.Event Listener Management and Cleanup:
Changed the way event listeners are managed in
VisorFrontend: replaced the camera sync listener release method with a generalizedreleasemethod that removes all listeners registered by the frontend. This ensures that no stale listeners remain after a rebuild, preventing duplicate event handling. [1] [2] [3]Moved the attachment of the camera sync reporter from
VisorFrontendto the CLIENT mode hook, so it is now attached to the renderer at creation time and released at the correct lifecycle point. [1] [2]Documentation and Testing:
CameraSyncReporter.tsto clarify its role as the client-mode reporter, now attached by the hook, and to improve the explanation of listener lifecycles and testing rationale. [1] [2]