Page MenuHomePhabricator

Bad interaction between RevisionSlider and CollapsibleVector extension
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

Revision-Slider currently undoes all effects of the MediaWiki-extensions-CollapsibleVector.

CollapsibleVector is a JavaScript extension that re-adds a collapse feature to the left navigation bar. This was once a core feature, but got removed a few years ago. Note the arrow:

Screenshot from 2018-12-10 09-32-28.png (159×178 px, 7 KB)

RevisionSlider contains a feature where it replaces the diff view below the slider on-the-fly, without reloading the entire page. The code for this feature is in the file ext.RevisionSlider.DiffPage.js. In one line it replaces the contents of the #mw-panel (this is the left navigation bar) with an entirely new version as provided by the server. This is done because there are links in this navigation bar that reference the currently displayed revision, e.g. "Permanent link" and "Printable version". These would point to the wrong revision and must be replaced because of this. To make this easier, the code replaces the entire navigation bar.

This also kills all effect any JavaScript had on the navigation bar before!

Unfortunately the CollapsibleVector code currently does not use any hook, but initializes via $( function () { … } );. This can not be called again after RevisionSlider replaced the #mw-panel contents.

Ideas:

  • Try to rewrite CollapsibleVector to use the wikipage.content hook.
  • Rewrite the line of code that replaces the entire #mw-panel in one step, and instead iterate the two DOM fragments and only replace href attributes (and possibly others, e.g. title or data-…).

Reported here: https://www.mediawiki.org/wiki/Topic:Uq065ue6voxwn51d

Event Timeline

Why is this tagged as an MCR issue?

thiemowmde removed a subscriber: daniel.

Just a mistake, sorry, @daniel. The one I wanted to point you at is T211473.

awight changed the subtype of this task from "Task" to "Bug Report".Oct 30 2020, 1:53 PM

Change 638100 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/CollapsibleVector@master] Init collapsing via JS content hook

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

Change 638100 merged by jenkins-bot:
[mediawiki/extensions/CollapsibleVector@master] Init collapsing via JS content hook

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

WMDE-Fisch set the point value for this task to 2.Nov 2 2020, 3:09 PM