Menu ▾ ▴

#250 Use native WebView zoom instead of CSS page scaling

closed
nobody
6 days ago
2026-08-28
Anonymous
No

Originally created by: kristofferR

Problem

Carrier currently implements page zoom with document-level CSS:

  • macOS/Linux set CSS zoom on the document element.
  • Windows scales the entire body with a transform and compensating width/height.

The transform path does not participate in layout like real page zoom. Fixed and sticky elements, pointer hit testing, viewport measurements, media overlays, and Messenger's own responsive layout can diverge from what the user sees. The current workaround also requires Carrier-specific resize nudges.

Goal

Make the native WebView zoom factor the single rendering primitive while preserving Carrier's existing 30-200% setting, shortcuts, persistence, and multi-window behavior.

Design constraints

  • Rust owns and applies the zoom factor through Tauri/Wry's native WebView zoom API.
  • Apply the saved factor when every Messenger window is created and when the setting changes.
  • Keep keyboard shortcuts and Settings synchronized through Carrier's existing trusted settings path. Do not expose a broad native zoom command to arbitrary remote-page script.
  • Clamp and validate the value natively as well as in the page.
  • Remove the CSS zoom/body-transform branches after native behavior is verified.
  • Theme recreation and additional windows must retain the current zoom.
  • Preserve accessibility and test screen coordinates used by Hide Names, viewer controls, context menus, and login layout.

Verification

  • Focused tests for clamping, setting propagation, and new-window initialization.
  • Manual macOS, Windows, and Linux checks at 30%, 80%, 100%, 150%, and 200%.
  • Verify fixed controls, media viewer hit targets, drag/pan, context-menu placement, and login layout.
  • Compare rendering and input behavior against the existing CSS implementation before removing it.

Ref [#55] and [#71].

Related

Tickets: #264
Tickets: #318
Tickets: #324
Tickets: #55
Tickets: #71

Discussion

  • Anonymous

    Anonymous - 6 days ago

    Originally posted by: kristofferR

    [!NOTE]
    🤖 Claude Opus 5.5 responding on behalf of Kristoffer

    Done in [#324] (on main, first released in v2.0.4). Rust applies the zoom level through the native WebView zoom on every platform (apply_page_zoom in src-tauri/src/settings.rs: the WKWebView page zoom on macOS, set_zoom on Windows and Linux). The CSS zoom and body-transform paths are gone; the page only reports keyboard and menu zoom changes, which Rust clamps, applies and saves.

     

    Related

    Tickets: #324

  • Anonymous

    Anonymous - 6 days ago

    Ticket changed by: kristofferR

    • status: open --> closed
     

Log in to post a comment.