fix(web): prevent mobile pinch and input-focus zoom#2391
fix(web): prevent mobile pinch and input-focus zoom#2391jappyjan wants to merge 1 commit intopingdotgg:mainfrom
Conversation
The viewport meta omitted maximum-scale and user-scalable, so iOS Safari auto-zoomed on input focus and let users pinch the chrome, both of which break the remote-control workflow over Tailscale on phones. Pin the viewport scale and disable user scaling. iOS Safari has historically ignored user-scalable=no for accessibility reasons, so the viewport meta alone isn't enough. Add `touch-action: pan-x pan-y` to html and body — this is the mechanism iOS does respect: pan/scroll still works, pinch-to-zoom is blocked. It only affects touch input, so desktop browsers are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughUpdated viewport meta tag configuration to prevent user zooming while constraining scaling, and added touch-action CSS properties to enable pan gestures on the html and body elements for improved mobile interaction handling. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Comment |
|
@coderabbitai review |
ApprovabilityVerdict: Approved This is a minor, self-contained CSS/HTML change that prevents mobile pinch-zoom and input-focus zoom. The changes only affect mobile touch behavior and have no impact on backend logic, security, or other runtime behavior. You can customize Macroscope's approvability policy. Learn more. |
✅ Actions performedReview triggered.
|
|
This can be closed now since #1652 is merged |
Summary
The viewport meta omitted `maximum-scale` and `user-scalable`, so iOS Safari auto-zoomed when an input was focused and let the user pinch the chrome. Both break the remote-control workflow over Tailscale on a phone.
Two changes:
Why both
`user-scalable=no` alone is unreliable on modern iOS Safari — Apple deferred to it for a long time, and even with current builds it's a hint, not a contract. `touch-action: pan-x pan-y` is the mechanism iOS does honor consistently: pan/scroll still works, pinch-to-zoom is blocked. It only affects touch input, so desktop browsers are unchanged.
Verified empirically that just the viewport-meta change is not enough on iOS — both pinch-zoom and input-focus zoom kept happening on iPhone until `touch-action` was added.
Test plan
Trade-off
System-level pinch zoom is disabled on touch. iOS still honors the OS-level "Display Zoom" / "Accessibility > Zoom" setting regardless, so a11y users keep their escape hatch. This matches the explicit user requirement for a fixed remote-control viewport.
Screenshots / video
ScreenRecording_04-28-2026.23-50-25_1.mp4
Note
Prevent mobile pinch-zoom and input-focus zoom on web
maximum-scale=1anduser-scalable=noin the viewport meta tag in index.html to block zoom on browsers that honor these directives.touch-action: pan-x pan-ytohtmlandbodyin index.css to disable pinch gestures on iOS Safari, which ignores the viewport meta tag restrictions.Macroscope summarized 277c467.
Note
Medium Risk
Disables pinch-to-zoom across the app on touch devices, which can impact accessibility and mobile usability despite being a small, localized change.
Overview
Prevents iOS Safari from zooming the page (pinch-zoom and input-focus zoom) by tightening the
viewportmeta tag (maximum-scale=1,user-scalable=no).Adds
touch-action: pan-x pan-yonhtmlandbodyto reliably block pinch-zoom while preserving scrolling/panning on touch devices.Reviewed by Cursor Bugbot for commit 277c467. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit