Page MenuHomePhabricator

External maps sidebar doesn't stay collapsed
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Open a map in fullscreen mode and enable the external maps sidebar.
  • Close the sidebar again and close the fullsceen view.
  • Reopen that map or a different one on the same page.

What happens?:
The sidebar is extended.

What should have happened instead?:
It should not be extended if it was closed before.

Other information (browser name/version, screenshots, etc.):

Screenshot from 2023-02-01 12-39-08.png (974×1 px, 799 KB)

The relevant line of code is an if ( dialog.sideBar ). This assumes the sidebar is visible when the object exists.

This check alone is not enough.

When the dialog opens for the first time no sidebar object is created. This happens later the first time the sidebar opens. This object is not destroyed when we keep toggling the sidebar but reused. aria-hidden="false" is what hides the sidebar from now on, here. The state is tracked via the value of the "External maps" toggle button, here.

Suggestion:

	if ( dialog.sideBar ) {
		dialog.sideBar.tearDown();
		dialog.map.doWhenReady( function () {
			var open = dialog.mapDetailsButton.getValue();
			dialog.offsetMap( open );
			dialog.toggleSideBar( open );
		} );
	} else {

I think this is broken ever since the code was added in https://gerrit.wikimedia.org/r/588121. Still qualifies as a Regression I believe.

Event Timeline

thiemowmde renamed this task from External maps sidebar stays open to External maps sidebar doesn't stay collapsed.Feb 1 2023, 11:46 AM
thiemowmde updated the task description. (Show Details)
thiemowmde added subscribers: thiemowmde, WMDE-Fisch.

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

[mediawiki/extensions/Kartographer@master] Fix fullscreen map sidebar not staying collapsed

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

Change 889949 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Fix fullscreen map sidebar not staying collapsed

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