Repository navigation
Conversation
…ification ZoomIn/ZoomOut/ZoomReset/SetZoom/GetZoom on macOS drove -[WKWebView setMagnification:], a view-level scale: the layout viewport stays the same, the page is drawn larger and clipped at the window edges, nothing reflows. Windows (put_ZoomFactor) and Linux (webkit_web_view_set_zoom_level) implement the same API as a browser zoom, and so does Safari. WKWebView.pageZoom (macOS 11+) is that browser zoom; below macOS 11 the magnification path stays as the fallback. ZoomReset also keeps resetting the magnification so a pinch zoom (AllowsMagnification) still returns to actual size. Fixes wailsapp#6226
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughmacOS webview zoom uses ChangesmacOS Webview Zoom
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The macOS zoom change is ready to merge after normal checks; no specific unresolved behavior issue was identified. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit taps the zoom control, Comment |
|
Automated v3 GA-readiness test result for head
The results match the master baseline at |
Description
On macOS
Window.ZoomIn()/ZoomOut()/ZoomReset()/SetZoom()/GetZoom()— and theZoomIn/ZoomOut/ResetZoommenu roles built on them — drive-[WKWebView setMagnification:]. Magnification is a view-level scale transform: the layout viewport stays as it was, the page is drawn larger and clipped at the window edges, nothing reflows. Windows (put_ZoomFactor) and Linux (webkit_web_view_set_zoom_level) implement the same API as a browser zoom, and so does Safari.This switches the darwin implementation to
WKWebView.pageZoom(macOS 11+), which is that browser zoom: the CSS viewport shrinks, text wraps, responsive layouts adapt — the behaviour the other two backends already have. Details and measurements in #6226.Changes
windowZoomSet/windowZoomGet/windowZoomIn/windowZoomOutgo through two static helpers that usepageZoomand fall back tomagnificationbelow macOS 11 — the package is compiled with-mmacosx-version-min=10.13, so the@availableguard keeps it warning-free there.windowZoomResetresets the page zoom and keeps resetting the magnification, so a pinch zoom (AllowsMagnification) still returns to actual size on ⌘0.GetZoom()now reports the page zoom factor.Fixes #6226
Type of change
How Has This Been Tested?
Repro app from #6226 — 800 px window, long paragraph,
ZoomIn()× 6 thenZoomReset(), metrics reported by the page:documentElement.clientWidthvisualViewport.widthvisualViewport.scalemaster, zoomedGetZoom()returns 1.30 in both;ZoomReset()restores the initial values (800 / 800 / 1.00 / 10 / 776) in both. The recordings in #6226 show the same difference interactively.go test ./pkg/application/passes; no new compiler warnings.Test Configuration
Checklist:
website/src/pages/changelog.mdxwith details of this PR (v3 changelog entries are added automatically)Summary by CodeRabbit