Page MenuHomePhabricator

Add ability to hide frame around maps in VE
Closed, ResolvedPublic5 Estimated Story Points

Description

NOTE: should be implemented after T318815: Add ability to add caption to maps in VE

Currently the setting to hide frame is only accessible in wikitext and cannot be set in VE. We will add a toggle to show/hide frame for maps in Visual Editor (see mock) to the "Map options" tab.

Requirements

  • Add ToggleSwitchWidget beneath the position setting with label Show frame
  • Change section label to Display
  • The setting should be turned on by default
  • If there is a caption, then the toggle should be disabled in the on position
  • If the map is set to frameless, but a user adds a caption, the toggle should be switched to on and disabled
  • If a caption is deleted, then the toggle should be un-disabled
  • As the options tab gets longer, when the user scrolls down, the whole dialog scrolls (existing behavior)
  • Add text to Display info icon help text (added in T318818 ): Turning off the frame causes the embedded map to be drawn without a frame (border), similar to frameless images. This option is disabled if the map has a caption.
Mock and specs

See epic: T318834

Technical implementation

Similar to the position attribute, this can be added to the mapframe:

<mapframe frameless>

Outcome

Screenshot from 2022-11-01 14-20-17.png (1×1 px, 202 KB)

Event Timeline

lilients_WMDE set the point value for this task to 3.Sep 28 2022, 2:26 PM
lilients_WMDE renamed this task from Add ability to hide frame around map in VE to Add ability to hide frame around maps in VE.Sep 28 2022, 2:38 PM
lilients_WMDE added a project: VisualEditor.
  • If there is a caption, then the toggle should be disabled in the on position
  • If the map is set to frameless, but a user adds a caption, the toggle should be switched to on and disabled
  • If a caption is deleted, then the toggle should be un-disabled

This makes the ticket a bit more complicated. I would say we should adapt the story points accordingly.

Alternatively we could also maybe simply add a text that frameless maps can not have captions. Or we could change that behaviour and allow captions for frameless maps. Why not? 🤔

Change 837150 had a related patch set uploaded (by Svantje Lilienthal; author: Svantje Lilienthal):

[mediawiki/extensions/Kartographer@master] [WIP] Add ability to hide frame around maps in VE

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

Alternatively we could also maybe simply add a text that frameless maps can not have captions. Or we could change that behaviour and allow captions for frameless maps. Why not? 🤔

It should have the disabled behavior. Would be great if you could adjust the story points. Forgot to bring this up when we were going through it in story time!

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

[mediawiki/extensions/Kartographer@master] [WIP] Add ability to hide frame around maps in VE

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

lilients_WMDE changed the point value for this task from 3 to 5.Oct 21 2022, 9:32 AM

This patch caused VE to no longer render or edit frameless maps, and should be reverted until we can fix: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Kartographer/+/790617

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

[mediawiki/extensions/Kartographer@master] Revert "Skip rendering empty <div> when no caption is given"

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

Change 848386 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/Kartographer@master] Revert "Skip rendering empty <div> when no caption is given"

Reason:

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

Change 842748 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Make frameless maps editable in VisualEditor

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

Change 837150 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Add ability to hide frame around maps in VisualEditor

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

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

[mediawiki/extensions/Kartographer@master] Minor CSS adjustments to maps dialog options panel

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

Change 851048 had a related patch set uploaded (by Svantje Lilienthal; author: Svantje Lilienthal):

[mediawiki/extensions/Kartographer@master] Adding help text about frame to display section

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

Change 851048 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Adding help text about frame to display section

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

Change 851047 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Minor CSS adjustments to maps dialog options panel

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