feat(desktop): add Fit / Full size / Scaled viewport modes #59

Merged
David merged 1 commit from feat/VAPP-52-desktop-view-modes into main 2026-06-29 14:58:34 +02:00
Member

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
feat(desktop): add Fit / Full size / Scaled viewport modes
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m15s
Create release / Create release from merged PR (pull_request) Has been skipped
e4e696d63c
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
David scheduled this pull request to auto merge when all checks succeed 2026-06-29 14:57:45 +02:00
David merged commit a96bfcd0a7 into main 2026-06-29 14:58:34 +02:00
David deleted branch feat/VAPP-52-desktop-view-modes 2026-06-29 14:58:34 +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!59
No description provided.