We currently have at two versions of guided tour library, which really need to be reconciled in to one latest version working as well as possible.
I want to report all the outstanding issues with tours (there are lots!) but it does not make sense to do this until we sort out which versions are where and find the current best version to use and build on.
I've created a 3rd version which tries to take the best of each of the previous two versions, with the issues listed mostly resolved. It has a couple of hacks that need to be removed but I propose that we now work from this version as it's the most functional of all the options.
Here is a summary of what we have now:
v1 - The main library file is currently the same on test.wikidata and wikidata, except live version has comments explaining defined functions (test version has no comments)
Live library: https://test.wikidata.org/w/index.php?title=MediaWiki:Guidedtour-lib.js
Test library: https://www.wikidata.org/w/index.php?title=MediaWiki:Guidedtour-lib.js
This version has some recent changes that were supposed to fix T213704 (marked resolved but not fixed on live at present), using the Mutation Observer API.
- Does not fix issues lists in T213704 that latest changes are supposed to fix
- Fires the "onShow" function twice instead of once for most slides. When there is an actionBtn, this leads to the action being triggered twice. Not quite pinned down yet, but you can see this by clicking "next" on slide 3 in the example above. You will see that two "new statement" boxes are added. (new from MutationObserver fix)
- T244747: Wikidata Tours: Stepping back shows next and previous steps at once (new from MutationObserver fix)
v2 - A second improved library file is also present on test.wikidata, aiming to fix the issues reported in T213704: Wikidata Tours don't load correctly
This version basically fixes the https://phabricator.wikimedia.org/T244994 issue of un-attached guiders when a step reveals new html elements. However, it does have the issues listed below:
- Does not trigger the next slide when the user clicks on the actionBtn themselves. It only works when they click the "next" button.
- The T244994 fix has not worked for the "add statement" action, it only seems to work when the next step is revealed within a currently visible new statement box (e.g. "add qualifier", "add reference")
Note: there are several other issues which effect both versions but will be reported once we're all on one single version.
IMHO, we should quickly copy the v2 file (https://test.wikidata.org/w/index.php?title=MediaWiki:Guidedtour-lib2.js) over to live Wikidata. The current live version is quite broken, and although there are issues with v2 it does have much less wrong with it.
v3 - I've managed to create a new version now which takes the best of both version and fixes the issues listed with each one
See the comment 13th Feb below for details.