Page MenuHomePhabricator

Wikidata Tours: Stepping back shows next and previous steps at once
Open, Needs TriagePublicBUG REPORT

Description

IMPORTANT: This issue has been caused by the recent attempt to fix T213704 using the Mutation Observer API. There is a later version of the library which does not have this issue, see T244994: Wikidata tours: Reconcile versions of MediaWiki:Guidedtour-lib.js for details on reconciling current versions

When any step in a tour uses the attachTo property for positioning the pop up, the back button shows both the next and the previous slide at the same time.
For steps which do not use the attachTo property, you can navigate forward and back normally without any problem.

Steps to Reproduce:

  1. Load the items Wikidata tour - https://www.wikidata.org/w/index.php?title=Q16943273&tour=wbitems
  2. Verify that the back button works perfectly up to and including the "Item Pages" step (step number 5)
  3. Once you reach the "Labels" step (step number 6), press the back button

Actual Results:

After clicking the back button on step 6 (the first step to include an attachTo property), the pop ups for both step 5 and step 7 are shown at the same time.

The same can be seen in subsequent steps in the tour, as well as on step 3 onward in the statements tour

Expected Results:

Only the previous step should be displayed when clicking the back button, step 5 in this case.
Step 7 should only be revealed after clicking the forward button (or completing an action that skips to the next slide)

Related Objects

Event Timeline

@rosalieper do you know anyone who could help with this? We found a few more bugs in Wikidata:Tours which are causing them not to work properly, I've spent the past few weeks writing 10ish new tours so would be great to have this working

Note: I've updated the description as I've discovered the cause of this issue is the MutationObserver fix attempted previously. Really we have to resolve T244994: Wikidata tours: Reconcile versions of MediaWiki:Guidedtour-lib.js before we proceed with anything. If we switch to the newer version by @Rosalie_WMDE then this issue is not present.

I expect that this issue can be fixed by adding

observer.disconnect();

at the appropriate position in MediaWiki:Guidedtour-lib.js

Thanks for that, yes I'm sure that must be it. My first quick attempt has not worked but will wait to see the outcome of T244994: Wikidata tours: Reconcile versions of MediaWiki:Guidedtour-lib.js before digging in any further as we should probably work from the later version of the library at https://test.wikidata.org/wiki/MediaWiki:Guidedtour-lib2.js