feat(desktop): add Fit / Full size / Scaled viewport modes #59
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VAPP-52-desktop-view-modes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The remote-desktop canvas rendered at a single fixed presentation (max-width: 100%; height: auto, centred), with no user control over how the remote framebuffer is shown. Add a MeshCentral-style 3-state view-mode control on the desktop pane.
A new ViewMode enum (Fit | FullSize | Scaled, default Fit) drives only CSS: the canvas backing store stays at the native remote resolution in every mode, and the toolbar cycle button ("View: Fit/Full size/Scaled", next to Quality / Refresh) flips display sizing plus the scroll container's overflow. Fit shrinks to fit either axis keeping aspect and letterboxes (container overflow: hidden, centred); Full size paints the canvas at its intrinsic 1:1 pixels with the container scrolling (overflow: auto) when the remote screen exceeds the viewport; Scaled stretches to fill the container box (aspect may distort). The container now has a fixed viewport height (70vh, min 360px) so Fit can letterbox and Scaled can stretch within a definite box. The choice persists in localStorage under vc-desktop-view-mode (default Fit), gated to wasm with an SSR stub.
Input mapping is unchanged: screen_xy still derives the scale per-axis from getBoundingClientRect, which reflects whichever CSS size the mode produced, so all three modes map clicks correctly without branching. The per-axis arithmetic is extracted into a pure map_axis() so it is unit-testable on the server target; tests cover Full size while scrolled (negative origin) and Scaled while distorted (differing X/Y ratios), plus clamping, the mode cycle, and the localStorage round-trip.
Adds the Storage web-sys feature for localStorage access.
#VAPP-52
The remote-desktop canvas rendered at a single fixed presentation (max-width: 100%; height: auto, centred), with no user control over how the remote framebuffer is shown. Add a MeshCentral-style 3-state view-mode control on the desktop pane. A new ViewMode enum (Fit | FullSize | Scaled, default Fit) drives only CSS: the canvas backing store stays at the native remote resolution in every mode, and the toolbar cycle button ("View: Fit/Full size/Scaled", next to Quality / Refresh) flips display sizing plus the scroll container's overflow. Fit shrinks to fit either axis keeping aspect and letterboxes (container overflow: hidden, centred); Full size paints the canvas at its intrinsic 1:1 pixels with the container scrolling (overflow: auto) when the remote screen exceeds the viewport; Scaled stretches to fill the container box (aspect may distort). The container now has a fixed viewport height (70vh, min 360px) so Fit can letterbox and Scaled can stretch within a definite box. The choice persists in localStorage under vc-desktop-view-mode (default Fit), gated to wasm with an SSR stub. Input mapping is unchanged: screen_xy still derives the scale per-axis from getBoundingClientRect, which reflects whichever CSS size the mode produced, so all three modes map clicks correctly without branching. The per-axis arithmetic is extracted into a pure map_axis() so it is unit-testable on the server target; tests cover Full size while scrolled (negative origin) and Scaled while distorted (differing X/Y ratios), plus clamping, the mode cycle, and the localStorage round-trip. Adds the Storage web-sys feature for localStorage access. #VAPP-52