Skip to content

Settings: interface size (90-150%) with Cmd/Ctrl +/-/0 - #361

Merged
fylorn merged 1 commit into
devfrom
feat/ui-zoom
Oct 22, 2026
Merged

fylorn merged 1 commit into
devfrom
feat/ui-zoom

Conversation

@fylorn

@fylorn fylorn commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an interface size setting that scales the whole UI through the webview zoom (Tauri's set_zoom: WKWebView pageZoom, WebView2 ZoomFactor, WebKitGTK zoom-level). Layout, icons and spacing grow together; no CSS changes.

  • Settings > General > Interface size, right under Appearance: 90% / 100% / 110% / 125% / 150% (segmented control), default 100%, applied on click like the other rows.
  • Shortcuts: Cmd/Ctrl+= (also +) zooms in one step, Cmd/Ctrl+- zooms out, Cmd/Ctrl+0 resets to 100%. Registered in palette/keys.tsx, shown in the shortcut sheet, and searchable in the command palette. The next step is computed on the Rust side, so a held key does not read the same step several times. Tauri's zoom_hotkeys_enabled stays off.
  • Storage: zoom in app.json (Prefs::zoom, stored as a percentage, read in from_fields; values outside the steps fall back to 100%). It is not in the client_prefs sync list, because the right size depends on each computer's screen. A test covers this.
  • No 100% flash on cold start: the main window is zoomed in Rust right after it is built, before the page loads.
  • Window sizes: the main window's default size and minimum size scale with the zoom, so its CSS width matches 100% and does not drop below the 768/640 breakpoints. Both are clamped to the work area of the screen (150% needs 1230×840 pt, which does not fit vertically on a 1080p screen at 125% system scaling). Changing the zoom resets the minimum size, and the window grows if it is smaller. When the clamped size fills one side of the screen, the window is centered.
  • Small windows: the update window and the connection picker follow the zoom too. window::fit multiplies the measured CSS size by the zoom factor; the native title bar is not scaled. When the zoom changes while one is open, its ResizeObserver fires because the viewport width changes, and it refits.

No new platform-specific branches: everything goes through Tauri's cross-platform set_zoom, set_min_size and monitor APIs.

Test plan

  • tsc -b --noEmit, vitest run (new test: shortcut key mapping, and the UI steps match STEPS in zoom.rs)
  • cargo clippy --all-targets -- -D warnings, cargo test (new tests: serialization and steps, minimum-size scaling and clamping, prefs round trip and invalid values, not synced)
  • Full-app preview with the commands mocked: the settings row, the shortcut sheet entries, palette search, and the shortcuts change the selected step; dashboard rendered as at 125% (880×576 CSS px for a 1100×720 window) without horizontal overflow

Closes #355

🤖 Generated with Claude Code

The whole interface scales through the webview zoom (WKWebView pageZoom,
WebView2 ZoomFactor, WebKitGTK zoom-level via Tauri's set_zoom), so layout,
icons and spacing grow together without touching CSS.

- Settings > General gets an "Interface size" row under Appearance:
  90% / 100% / 110% / 125% / 150%, default 100%, applied on click.
- Cmd/Ctrl+= (also +) zooms in one step, Cmd/Ctrl+- out, Cmd/Ctrl+0 resets
  to 100%. Listed in the shortcut sheet and searchable in the command
  palette. Tauri's zoom_hotkeys_enabled stays off.
- Stored as "zoom" in app.json (Prefs::zoom, read field by field like the
  others). Not part of the synced general prefs: the right size depends on
  each computer's screen.
- The main window is zoomed right after it is built, so a cold start does
  not paint a 100% frame first. Its default and minimum size scale with the
  zoom, so the layout keeps the same CSS width as at 100% and does not drop
  below the responsive breakpoints; both are clamped to the screen's work
  area (150% on a 1080p screen at 125% system scaling does not fit
  vertically otherwise). Changing the zoom resets the minimum size.
- The update window and the connection picker follow the zoom too:
  window::fit converts their measured CSS size to points.

Closes #355

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 215a76e into dev Oct 22, 2026
10 of 11 checks passed
@fylorn
fylorn deleted the feat/ui-zoom branch October 22, 2026 13:23
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant