Skip to content

Allow pinch to zoom when reading articles - #6538

Open
folecr wants to merge 2 commits into
wikimedia:mainfrom
folecr:st/pinch_to_zoom_article_webview
Open

Allow pinch to zoom when reading articles#6538
folecr wants to merge 2 commits into
wikimedia:mainfrom
folecr:st/pinch_to_zoom_article_webview

Conversation

@folecr

@folecr folecr commented Apr 28, 2026

Copy link
Copy Markdown

Bug : T424079

What does this do?

Allow pinch to zoom in the article webview in Wikipedia Android

I frequently use pinch to zoom on the web (both desktop and mobile) to zoom into article text or images without relayout of the entire article webpage but the mobile app does not allow usage of this gesture. This PR allows using pinch-to-zoom in the mobile app exclusively in the article webview.

Note : corresponding iOS PR wikimedia/wikipedia-ios#5821
Note : On Android the webview cannot be configured to ignore viewport scale limits so this change requires modifying HTML content with user-scalable=yes before loading in webview.
A broader, perhaps more correct fix, is to set user-scalable=yes in the content being served. It looks like user-scalable in the HTML content being served is being set by https://github.com/wikimedia/mediawiki-services-mobileapps/blob/master/lib/transformations/pcs/head.js#L71 introduced in change b3bed0a05861401f83d84e93d436d08bb77da1c4. If there is interest in doing so, I could potentially make a change in that repo if there is consensus that it is the right spot, instead of this repo.

Why is this needed?

When browsing wikipedia on mobile web and desktop web browsers, users may zoom into content with the pinch to zoom gesture. However this is not currently possible in app. This PR enables the same functionality in the wikipedia mobile app, for articles.

Note W3C recommendation https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/viewport#user-scalable

Phabricator:
https://phabricator.wikimedia.org/T424079

@folecr folecr changed the title Users can pinch to zoom when reading articles Allow pinch to zoom when reading articles May 7, 2026
@folecr
folecr force-pushed the st/pinch_to_zoom_article_webview branch from 2cf9d4b to 4b6ab0e Compare May 14, 2026 17:23
@folecr
folecr force-pushed the st/pinch_to_zoom_article_webview branch from 4b6ab0e to ff373a4 Compare May 26, 2026 16:25
folecr added 2 commits June 29, 2026 11:11
 * Enable zooming in WebView configuration
 * Replace the meta viewport content tag with what is served to mobile web
 * ...  by https://github.com/wikimedia/mediawiki/blob/master/includes/Skin/Skin.php#L386
 * ... `content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0"`

Bug : T424079
@folecr
folecr force-pushed the st/pinch_to_zoom_article_webview branch from ff373a4 to 51a1e1c Compare June 29, 2026 18:12
@folecr

folecr commented Jun 29, 2026

Copy link
Copy Markdown
Author

Gate change behind a developer settings flag as in wikimedia/wikipedia-ios#5821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant