fix(desktop): keep Detach canvas wasm-owned so PiP close cannot freeze app #86

Merged
Claude-Run merged 1 commit from fix/VAPP-70-detach-pip-canvas-freeze into main 2026-07-06 04:03:44 +02:00
Member

The Desktop tab's Detach control moves the live KVM into a Document Picture-in-Picture window. The canvas was a Dioxus-rendered element, so moving it out of the renderer's document left Dioxus's DOM registry pointing at a node in another document; on re-dock (or any re-render while detached) the wasm render/event loop threw and stopped dispatching events app-wide, matching the reported symptom that every tab and left-hand menu item went dead until a full page reload (Defect B).

The fix makes the live canvas wasm-owned instead of Dioxus-owned. DesktopPane now renders an empty mount div (display: contents so layout is identical) and the wasm driver creates the canvas via create_element("canvas") and inserts it into that mount. Detach moving a node Dioxus never knew about is invisible to the renderer, so its diffing and synthetic-event dispatch stay intact through detach, re-dock, and window-close. The view-mode display CSS, previously a reactive rsx attribute, is now pushed imperatively via DesktopHandle::set_view_css on mode change and on attach.

For the blank-viewport report (Defect A), after the canvas moves into the PiP window the driver asks the agent to re-ship every tile (send_refresh) so a live frame paints immediately rather than staying blank until the next changed tile; the canvas node and its 2D context are preserved across the cross-document move, so the re-blit lands on the same surface.

The /relays address bar and dead Enter/refresh/no-network behavior are the browser's display artifacts of a non-navigable Document PiP companion window, not a navigation; no code navigates it (the detach path contains no /relays reference).

Adds src/components/desktop_pip_guard.rs, a compile-time guard test that fails if the KVM canvas ever becomes a Dioxus rsx element again or if the wasm-side creation disappears, so the invariant is enforced mechanically.

#VAPP-70

The Desktop tab's Detach control moves the live KVM <canvas> into a Document Picture-in-Picture window. The canvas was a Dioxus-rendered element, so moving it out of the renderer's document left Dioxus's DOM registry pointing at a node in another document; on re-dock (or any re-render while detached) the wasm render/event loop threw and stopped dispatching events app-wide, matching the reported symptom that every tab and left-hand menu item went dead until a full page reload (Defect B). The fix makes the live canvas wasm-owned instead of Dioxus-owned. DesktopPane now renders an empty mount div (display: contents so layout is identical) and the wasm driver creates the canvas via create_element("canvas") and inserts it into that mount. Detach moving a node Dioxus never knew about is invisible to the renderer, so its diffing and synthetic-event dispatch stay intact through detach, re-dock, and window-close. The view-mode display CSS, previously a reactive rsx attribute, is now pushed imperatively via DesktopHandle::set_view_css on mode change and on attach. For the blank-viewport report (Defect A), after the canvas moves into the PiP window the driver asks the agent to re-ship every tile (send_refresh) so a live frame paints immediately rather than staying blank until the next changed tile; the canvas node and its 2D context are preserved across the cross-document move, so the re-blit lands on the same surface. The /relays address bar and dead Enter/refresh/no-network behavior are the browser's display artifacts of a non-navigable Document PiP companion window, not a navigation; no code navigates it (the detach path contains no /relays reference). Adds src/components/desktop_pip_guard.rs, a compile-time guard test that fails if the KVM canvas ever becomes a Dioxus rsx element again or if the wasm-side creation disappears, so the invariant is enforced mechanically. #VAPP-70
fix(desktop): keep Detach canvas wasm-owned so PiP close cannot freeze app
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 30s
Create release / Create release from merged PR (pull_request) Has been skipped
73a2d32adc
The Desktop tab's Detach control moves the live KVM <canvas> into a Document Picture-in-Picture window. The canvas was a Dioxus-rendered element, so moving it out of the renderer's document left Dioxus's DOM registry pointing at a node in another document; on re-dock (or any re-render while detached) the wasm render/event loop threw and stopped dispatching events app-wide, matching the reported symptom that every tab and left-hand menu item went dead until a full page reload (Defect B).

The fix makes the live canvas wasm-owned instead of Dioxus-owned. DesktopPane now renders an empty mount div (display: contents so layout is identical) and the wasm driver creates the canvas via create_element("canvas") and inserts it into that mount. Detach moving a node Dioxus never knew about is invisible to the renderer, so its diffing and synthetic-event dispatch stay intact through detach, re-dock, and window-close. The view-mode display CSS, previously a reactive rsx attribute, is now pushed imperatively via DesktopHandle::set_view_css on mode change and on attach.

For the blank-viewport report (Defect A), after the canvas moves into the PiP window the driver asks the agent to re-ship every tile (send_refresh) so a live frame paints immediately rather than staying blank until the next changed tile; the canvas node and its 2D context are preserved across the cross-document move, so the re-blit lands on the same surface.

The /relays address bar and dead Enter/refresh/no-network behavior are the browser's display artifacts of a non-navigable Document PiP companion window, not a navigation; no code navigates it (the detach path contains no /relays reference).

Adds src/components/desktop_pip_guard.rs, a compile-time guard test that fails if the KVM canvas ever becomes a Dioxus rsx element again or if the wasm-side creation disappears, so the invariant is enforced mechanically.

#VAPP-70
Claude-Run deleted branch fix/VAPP-70-detach-pip-canvas-freeze 2026-07-06 04:03:44 +02:00
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!86
No description provided.