Page MenuHomePhabricator

Preview mapframes should appear static if the wiki is configured to only show static mapframes
Closed, ResolvedPublic5 Estimated Story Points

Description

Requirements

  • Disable dynamic features (zooming, panning) so that it becomes a static thumbnail, on wikis where the final mapframe will also be static
  • Full screen button and double-click must still work for full screen testing and to match final map

Technical background

When a site is configured to show only a static map thumbnail ($wgKartographerStaticMapframe = true), the preview mapframe should behave the same as the pulished map. When previewing, the thumbnail should be static and double-clicking into the map should show a dynamic, full-screen map.

For technical reasons, we can't show a true static thumbnail (because these are rendered on the maps server and it can only be done for saved article content, accessed via the MediaWiki API). But we could make the dynamic thumbnail behave mostly like a static map by disabling all interactions except for the double-click to open a full-screen map.

Opening as full-screen in the preview view already works as expected.

Demo for fix:
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Maptests/Inline_marker&action=edit

  • Click preview, see the "fake" static preview that cannot be moved around or zoomed

Event Timeline

Change 835159 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] [POC] Make dynamic preview behave like static map in static mode

https://gerrit.wikimedia.org/r/835159

thiemowmde set the point value for this task to 5.Sep 28 2022, 11:36 AM
ECohen_WMDE renamed this task from Investigation: Edit preview should show a static mapframe to Preview mapframes should static if final mapframe is static.Oct 13 2022, 8:59 AM
ECohen_WMDE updated the task description. (Show Details)
lilients_WMDE renamed this task from Preview mapframes should static if final mapframe is static to Preview mapframes should be static if final mapframe is static.Oct 21 2022, 9:41 AM
awight renamed this task from Preview mapframes should be static if final mapframe is static to Preview mapframes should appear static if the wiki is configured to only show static mapframes.Oct 21 2022, 11:20 AM
awight updated the task description. (Show Details)

Change 883934 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Kartographer@master] Don't renable draggable when map is static

https://gerrit.wikimedia.org/r/883934

Change 883934 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Don't renable draggable when map is static

https://gerrit.wikimedia.org/r/883934

WMDE-Fisch moved this task from Doing to Tech Review on the WMDE-TechWish-Sprint-2023-01-18 board.
WMDE-Fisch subscribed.

Change 835159 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Make dynamic preview behave like static map in static mode

https://gerrit.wikimedia.org/r/835159

What about arrow key controls? In beta these appear to be still enabled. Also, if I enter full screen, then zoom/pan and exit full screen, then would it be possible to reset the position?

Change 885271 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Kartographer@master] Disable keyboard navigation on static preview

https://gerrit.wikimedia.org/r/885271

What about arrow key controls? In beta these appear to be still enabled. Also, if I enter full screen, then zoom/pan and exit full screen, then would it be possible to reset the position?

Thanks, we missed the keyboard controls. I added a patch.

Resetting the position seems to be a bit more tricky due to the way the code is connected at that part. Since we try to wrap up the topic area, I'll leave this a step for further improvements. There's another ticket, I'll link here.

Change 885271 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Disable keyboard navigation on static preview

https://gerrit.wikimedia.org/r/885271

Change 885993 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Don't change map position after fullscreen in static preview mode

https://gerrit.wikimedia.org/r/885993

What about arrow key controls? In beta these appear to be still enabled. Also, if I enter full screen, then zoom/pan and exit full screen, then would it be possible to reset the position?

Thanks, we missed the keyboard controls. I added a patch.

Resetting the position seems to be a bit more tricky due to the way the code is connected at that part. Since we try to wrap up the topic area, I'll leave this a step for further improvements. There's another ticket, I'll link here.

Ok Thiemo found the place I seemed to miss all the time :-D.

Change 885993 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Don't change map position after fullscreen in static preview mode

https://gerrit.wikimedia.org/r/885993

Right-clicking the thumbnail causes it to scroll and display coordinates. Perhaps we need to intercept button 3 as well.

Change 886924 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Kartographer@master] Disable right click coordinate popup for static maps in preview

https://gerrit.wikimedia.org/r/886924

Right-clicking the thumbnail causes it to scroll and display coordinates. Perhaps we need to intercept button 3 as well.

Note: This is a feature that was added for the Wikivoyage users some time ago, so they can get coordinates while editing more easily. See patch notes. Since we would only remove it for the static preview it seems fine though. Users can still use it when expanding the map.

thiemowmde claimed this task.

Change 886924 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Disable right click coordinate popup for the static map preview

https://gerrit.wikimedia.org/r/886924