Page MenuHomePhabricator

Multi-part message in template dialog moves around, but shouldn't
Closed, ResolvedPublic3 Estimated Story Points


We show the message "You are currently editing a template and one or more pieces of connected content (wikitext and/or additional templates)." at the top of a multi-part transclusion. When I move parts around, the message starts moving around as well.

Peek 2021-10-14 15-27.gif (779×1 px, 1 MB)

The reason is the way this is currently implemented. The message is manually inserted into the .oo-ui-stackLayout container, right next to the pages that are in this container. No widget expects an additional, unrelated element in this container. Depending on the way the new position of an element is calculated, it might naturally end at e.g. position 0, which is above the message.

Event Timeline

As context, because I deep dived into something like this for another patch:

OO.ui.StackLayout uses OO.ui.mixin.GroupElement to managed the list and order of the elements applied. The $group property relevant for the DOM elements that are manipulated is set to this.$element in the StackLayout constructor. Therefore anything added to that $element ( like the message box in question ) will potentially be moved around when manipulating the stack layout's items.

Lena_WMDE set the point value for this task to 3.Dec 1 2021, 2:58 PM

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

[mediawiki/extensions/VisualEditor@master] Prepend multipart message in onreplacepart to prevent it from moving around

Change 743978 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Prepend multipart message in onReplacePart to prevent it from moving around

WMDE-Fisch moved this task from Demo to Done on the WMDE-TechWish-Sprint-2021-11-24 board.