Page MenuHomePhabricator

Add a "nearby" button to dynamic Kartographer maps
Closed, ResolvedPublic3 Estimated Story Points

Description

Add a new toggle button for showing and hiding a nearby articles layer in maps. This doesn't have to be connected to any logic yet.

  • Should be hidden behind a feature flag until the MVP implementation is complete.
  • Should send some kind of metrics instrumentation.
  • Metrics can be retrieved using API request data in combination with a special user agent

Dev note: For the first proof of concept/demo it's okay to reuse the existing layer selector (see screenshot below) (if it turns out to be generated by Kartographer rather than by custom JS on Wikivoyage, also see the notes below) or add a new button at the bottom, whatever is easier to implement. Final UI/UX design will l be done later.

Screenshot from 2022-04-13 14-37-38.png (807×501 px, 73 KB)

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
ResolvedNone

Event Timeline

thiemowmde set the point value for this task to 5.

Note: It turns out there is already some code for a nearby feature in the Maps (Kartographer) extension: https://gerrit.wikimedia.org/g/mediawiki/extensions/Kartographer/+/master/modules/wikivoyage/WVMap.js#17. The only piece that's local on Wikivoyage (and controlled by the community) is the configuration for this: https://de.wikivoyage.org/wiki/MediaWiki:Kartographer.js.

It doesn't look like we can actually reuse this because it is in the special Wikivoyage-only code. But we can certainly learn from this (remarkably small) code and copy what it does.

Change 780784 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Kartographer@master] Nearby feature flag and toggle button

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

I've implemented as a toggle button to match the "External maps" button, we can revise later.

awight moved this task from Doing to Tech Review on the WMDE-TechWish-Sprint-2022-04-13 board.

Notes from the review:

  • The name of the feature flag is $wgKartographerNearby as it's meant to be a generic nearby feature, in contrast to the existing one that's specific to Wikivoyage.
  • It's a button at the bottom for the moment.

Screenshot from 2022-04-14 16-26-40.png (136×432 px, 10 KB)

awight changed the point value for this task from 5 to 3.Apr 14 2022, 2:27 PM

I've forgotten to add the metrics. Thanks for review!

Change 780784 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Nearby feature flag and toggle button

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

Change 781003 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Kartographer@master] Geosearch request includes a User-Agent

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

Instrumentation was added in a slightly roundabout way: the geosearch API request will include a traceable User-Agent.

Change 781003 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Geosearch request includes a User-Agent

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

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

[operations/mediawiki-config@master] [beta] Enable Kartographer nearby feature on beta cluster

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

Change 784702 merged by jenkins-bot:

[operations/mediawiki-config@master] [beta] Enable Kartographer nearby feature on beta cluster

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

WMDE-Fisch updated the task description. (Show Details)

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

[mediawiki/extensions/Kartographer@master] [DNM] Remove icons from nearby and external maps buttons

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

Change 835163 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Remove icons from nearby and external maps buttons

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