feat(desktop): detach viewer into a Document Picture-in-Picture window #62

Merged
Claude-Run merged 1 commit from feat/VAPP-50-desktop-detach-pip into main 2026-06-29 15:34:13 +02:00
Member

Add a "Detach" control to the remote-desktop toolbar that pops the live KVM canvas into an OS-level Document Picture-in-Picture window. Document PiP shares this JS/wasm context, so moving the canvas DOM node carries its relay WebSocket and all input listeners with it: the session keeps streaming with no reconnect, and mouse / keyboard / wheel input (bound to the canvas element) keep working in the detached window. The canvas is focused after the move so its keyboard listeners keep receiving.

Closing the PiP window (or clicking Re-dock, which just closes it) fires a pagehide listener that returns the canvas to its original page container and reverts the toolbar via an on_redock callback. Session teardown removes the pagehide listener before closing the window and closes any open PiP window, so neither the WebSocket nor the listeners leak when the pane is closed while detached.

The requestWindow bindings are not in stable web-sys, so the call goes through js_sys::Reflect rather than a typed API (no RUSTFLAGS change). The feature is detected via window.documentPictureInPicture; where it is absent (Firefox today) the control renders disabled with an explanatory tooltip instead of erroring, the resolved graceful fallback.

#VAPP-50

Add a "Detach" control to the remote-desktop toolbar that pops the live KVM canvas into an OS-level Document Picture-in-Picture window. Document PiP shares this JS/wasm context, so moving the canvas DOM node carries its relay WebSocket and all input listeners with it: the session keeps streaming with no reconnect, and mouse / keyboard / wheel input (bound to the canvas element) keep working in the detached window. The canvas is focused after the move so its keyboard listeners keep receiving. Closing the PiP window (or clicking Re-dock, which just closes it) fires a pagehide listener that returns the canvas to its original page container and reverts the toolbar via an on_redock callback. Session teardown removes the pagehide listener before closing the window and closes any open PiP window, so neither the WebSocket nor the listeners leak when the pane is closed while detached. The requestWindow bindings are not in stable web-sys, so the call goes through js_sys::Reflect rather than a typed API (no RUSTFLAGS change). The feature is detected via window.documentPictureInPicture; where it is absent (Firefox today) the control renders disabled with an explanatory tooltip instead of erroring, the resolved graceful fallback. #VAPP-50
feat(desktop): detach viewer into a Document Picture-in-Picture window
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m17s
Create release / Create release from merged PR (pull_request) Has been skipped
8e987f680e
Add a "Detach" control to the remote-desktop toolbar that pops the live KVM canvas into an OS-level Document Picture-in-Picture window. Document PiP shares this JS/wasm context, so moving the canvas DOM node carries its relay WebSocket and all input listeners with it: the session keeps streaming with no reconnect, and mouse / keyboard / wheel input (bound to the canvas element) keep working in the detached window. The canvas is focused after the move so its keyboard listeners keep receiving.

Closing the PiP window (or clicking Re-dock, which just closes it) fires a pagehide listener that returns the canvas to its original page container and reverts the toolbar via an on_redock callback. Session teardown removes the pagehide listener before closing the window and closes any open PiP window, so neither the WebSocket nor the listeners leak when the pane is closed while detached.

The requestWindow bindings are not in stable web-sys, so the call goes through js_sys::Reflect rather than a typed API (no RUSTFLAGS change). The feature is detected via window.documentPictureInPicture; where it is absent (Firefox today) the control renders disabled with an explanatory tooltip instead of erroring, the resolved graceful fallback.

#VAPP-50
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!62
No description provided.