Repository navigation
feat: Remote rendering 4.2b: Choose viewer from server mode and show streamed frames - #185
Merged
LKasianAnsys merged 3 commits intoNov 2, 2026
Merged
Conversation
LKasianAnsys
force-pushed
the
feat/4.2b-show-server-rendered-frames-in-browser
branch
from
October 26, 2026 14:16
1a2fb9f to
006facb
Compare
LKasianAnsys
force-pushed
the
feat/4.2b-show-server-rendered-frames-in-browser
branch
from
October 26, 2026 17:32
006facb to
7689ab9
Compare
LKasianAnsys
marked this pull request as ready for review
October 26, 2026 18:11
LKasianAnsys
force-pushed
the
feat/4.2b-show-server-rendered-frames-in-browser
branch
from
October 28, 2026 16:15
7689ab9 to
e12d96d
Compare
LKasianAnsys
force-pushed
the
feat/4.2b-show-server-rendered-frames-in-browser
branch
from
October 29, 2026 21:14
cb2c1e4 to
27d1bf6
Compare
Base automatically changed from
feat/4.2a-move-client-mode-wiring-out-of-app
to
main
October 29, 2026 23:11
LKasianAnsys
force-pushed
the
feat/4.2b-show-server-rendered-frames-in-browser
branch
from
October 29, 2026 23:11
27d1bf6 to
b4dc851
Compare
ansBAkula
approved these changes
Nov 2, 2026
ansBAkula
left a comment
Collaborator
There was a problem hiding this comment.
The window resize is not affecting the axis widget...it remains the same size (both client and server modes). I remember this was fixed in Theia (wasm/client rendering). Functionality wise everything works as expected.
Collaborator
Author
|
@ansBAkula Yes good catch. The orientation widget resize fix ended up being reverted at the time, as there was an upstream issue that had triggered a regression in |
LKasianAnsys
deleted the
feat/4.2b-show-server-rendered-frames-in-browser
branch
November 2, 2026 13:57
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 #27
Context
This PR adds client-side support for streaming frames from the server in SERVER mode. Until now, the browser always rendered with WASM, even in SERVER mode. It now reads the server's mode, and in server mode, ServerCanvas subscribes to the trame-rca
viewarea, reports its size through aResizeObserver(the first report starts the stream), and sendsset_dark_themeafter subscribing. No wasm is loaded in server mode. Both modes build their websocket URL throughtrameWebSocketUrl.Manual check: start VISOR in SERVER mode with a dataset as initial input. Open the viewer; a frame is displayed. No WASM network requests should be shown in the network tab with dev tools open. The frame should resize with the browser window.
Client mode should be unchanged.
Summary
Adds support for server-side rendering mode in the Visor client. Previously the client always connected a local wasm scene and rendered itself. Now, on startup the client probes the server's
rendering_modeand, when the server says"server", instead streams server-rendered JPEG frames over trame's Remote Controlled Area (RCA) protocol and displays them directly, skipping the wasm scene entirely.Changes
New: rendering-mode probe (
hooks/useRenderingMode.ts)rendering_modestate value ("client"or"server")."client"mode, disconnects immediately (the existing client-mode scene opens its own connection) and returns the mode."server"mode, keeps the trame connection alive and returns it for reuse by the streaming hook.UnknownRenderingModeErrorfor any unexpected value.New: server-rendering hook (
hooks/useServerVtk.ts)ServerCanvasto receive streamed frames and sends the page's dark/light theme to the server viaset_dark_theme.New:
rca/ServerCanvas.tsstreamtopic, decodes incoming JPEG frame bytes into aBlob/object URL, and renders them into an<img>element.ResizeObserverto report the element's pixel size (trame.rca.size) to the server so the server can resize its render window and produce correctly-sized frames.New:
trameWebSocketUrl.tsws/wsssession URL based on the page's protocol; used by both the probe and the existing client-mode connection (useClientVtk.ts) to avoid duplicated scheme logic.Modified:
App.tsxuseRenderingModeon mount;useClientVtkis now only "active" (and only opens its wasm connection) when the probe resolves to"client"mode.ServerCanvaselement directly instead of theUiScaffold/wasm frontend.Modified:
hooks/useClientVtk.tsactiveboolean parameter; its connection effect now no-ops untilactiveis true, so the wasm scene is never started while the server is driving rendering.trameWebSocketUrlhelper instead of inlining the URL.