Repository navigation
fix(webview): preserve zoom hotkeys across reloads (fix #16432) - #16433
Open
TimeToBuildBob wants to merge 1 commit into
Open
TimeToBuildBob wants to merge 1 commit into
TimeToBuildBob wants to merge 1 commit into
Conversation
Git-Session-Id: 44d60a8d-a5a8-4168-9e33-4417c5f832a6
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #16432. The Linux/macOS shortcut script keeps its counter in the document, while native zoom survives reload. After 140% → reload, zoom-in incorrectly requests 120%.
Webview, shared across cloned handles and document recreation. Absolute Rust/JS setters and relative shortcuts use the same state; shortcut limits remain 0.2–10 and absolute setters remain unclamped.set_webview_zoomcommand/ACL; existing numeric payloads are unchanged. Handle the command synchronously so rapid reset/shortcut operations keep arrival order.Verification
cargo test -p tauri --lib --no-default-features --features test --offline: 84 passed on Linux.node --test crates/tauri/src/webview/scripts/zoom-hotkey.test.cjs: 4 passed. All four fail with the original script.cargo clippy -p tauri -p tauri-runtime-wry --lib --no-default-features --features tauri/test --offline: passes with one pre-existing redundant-clone warning inmanager/webview.rs:272.git diff --checkpass.set_zoom→ shortcut, five-event burst, reset, and a queued-worker/main-thread interleaving. The wheel-handler test uses a synthetic DOM wheel event in the native webview, not physical wheel input.Boundaries
Native evidence is Linux only. macOS is script-test coverage; Windows/macOS native and mobile cross-compilation remain CI/maintainer verification. This does not persist zoom across process restarts or track direct platform mutations via
with_webview, outside Tauri's setters. No ActivityWatch-specific polyfill or reload reset is added.The commit is signed. I read the contribution policy and will not generate replies to review comments; any requested review discussion needs a human handoff.