Page MenuHomePhabricator

Cleanup: Hide knowledge about bookletLayout children
Closed, ResolvedPublic

Description

We have lots of calls like dialog.bookletLayout.stackLayout.getItems().forEach . No code in MWTemplateDialog or MWTransclusionDialog should have to know about bookletLayout's children. Push the interface up into the bookletLayout (or even into MWTemplateDialog), to look like dialog.getContentItems().

Build this on top of the forked TwoPaneTemplateDialogLayout.

Event Timeline

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

[mediawiki/extensions/VisualEditor@master] Never attach outlineSelectWidget to the DOM

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

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

[mediawiki/extensions/VisualEditor@master] Drop template dialog debug container

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

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

[mediawiki/extensions/VisualEditor@master] Push ownership of the sidebar down into the two-pane layout

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

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

[mediawiki/extensions/VisualEditor@master] Drop unused configuration options for the two-pane layout

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

Change 807134 abandoned by Awight:

[mediawiki/extensions/VisualEditor@master] Drop unused configuration options for the two-pane layout

Reason:

This was wrong, "outlined" is used by TemplateDialog vs TransclusionDialog

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

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

[mediawiki/extensions/VisualEditor@master] Drop unused "continuous" configuration

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

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

[mediawiki/extensions/VisualEditor@master] Drop unused "editable" configuration from template dialog

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

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

[mediawiki/extensions/VisualEditor@master] Remove unused "autoFocus" configuration from template dialog

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

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

[mediawiki/extensions/VisualEditor@master] Remove unused events from forked BookletLayout

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

Change 807120 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Never attach outlineSelectWidget to the DOM

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

Change 807136 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Drop unused "continuous" configuration

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

Change 807920 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Reduce barely used "autoFocus" code in template dialog

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

Change 807936 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Remove unused events from forked BookletLayout

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

Change 807918 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Drop unused "editable" configuration from template dialog

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

Change 807123 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Move template dialog sidebar container into forked BookletLayout

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

Should we replace this usage as well?

setTimeout( function () {
			dialog.bookletLayout.stackLayout.getItems().forEach( function ( page ) {
				if ( page instanceof ve.ui.MWParameterPage ) {
					page.updateSize();
				}
			} );
		}, OO.ui.theme.getDialogTransitionDuration() );

Code at Github

Should we replace this usage as well?

I had a patch for this but gave up on it for the moment: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/807476

awight claimed this task.
awight moved this task from Tech Review to Done on the WMDE-TechWish-Sprint-2022-06-22 board.

Work can be continued but this is a good start.

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

[mediawiki/extensions/VisualEditor@master] Don't access the stacklayout directly

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

Change 811587 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Don't access the stacklayout directly

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