Skip to content

feat: Remote rendering 4.2a: Move CLIENT mode viewer wiring out of app - #184

Merged
LKasianAnsys merged 5 commits into
mainfrom
feat/4.2a-move-client-mode-wiring-out-of-app
Oct 29, 2026
Merged

LKasianAnsys merged 5 commits into
mainfrom
feat/4.2a-move-client-mode-wiring-out-of-app

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Addresses #27

Context

This PR moves the client-mode viewer wiring out of App.tsx into useClientVtk and 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.tsx and 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.tsx into a new custom hook useClientVtk and a helper function buildFrontendAsync, significantly simplifying App.tsx and centralizing the logic for connecting to the wasm scene, rebuilding the frontend, and handling server updates. [1] [2] [3] [4]

  • Introduced useVisorArgs and useClientVtk hooks to encapsulate argument handling and client-mode renderer management, replacing ad-hoc logic in App.tsx.

Event Listener Management and Cleanup:

  • Changed the way event listeners are managed in VisorFrontend: replaced the camera sync listener release method with a generalized release method 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 VisorFrontend to 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:

  • Updated documentation in CameraSyncReporter.ts to 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]

@github-actions github-actions Bot added added enhancement New feature or request labels Oct 22, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.2a-move-client-mode-wiring-out-of-app branch 2 times, most recently from cdd67ea to 279ad21 Compare October 26, 2026 17:27
@LKasianAnsys LKasianAnsys self-assigned this Oct 26, 2026
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review October 26, 2026 17:41
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.2a-move-client-mode-wiring-out-of-app branch from 279ad21 to 4d641ae Compare October 28, 2026 15:59
@LKasianAnsys LKasianAnsys changed the title feat: [Remote rendering 4.2a] Move CLIENT mode viewer wiring out of app feat: Remote rendering 4.2a: Move CLIENT mode viewer wiring out of app Oct 28, 2026
ansBAkula
ansBAkula previously approved these changes Oct 29, 2026

@ansBAkula ansBAkula left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested...no regressions with CLIENT mode.

Base automatically changed from feat/4.1d-add-server-rendering-mode to main October 29, 2026 20:46
@LKasianAnsys
LKasianAnsys dismissed ansBAkula’s stale review October 29, 2026 20:46

The base branch was changed.

@github-actions github-actions Bot added the test Work associated with testing label Oct 29, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.2a-move-client-mode-wiring-out-of-app branch from 094c393 to 837e197 Compare October 29, 2026 20:52
@github-actions github-actions Bot removed the test Work associated with testing label Oct 29, 2026
@LKasianAnsys
LKasianAnsys added this pull request to stack #197 October 29, 2026 20:54
@LKasianAnsys
LKasianAnsys merged commit df57e8f into main Oct 29, 2026
16 checks passed
@LKasianAnsys
LKasianAnsys deleted the feat/4.2a-move-client-mode-wiring-out-of-app branch October 29, 2026 23:11
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants