Last modified: 2013-04-22 16:17:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45530, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43530 - Improve GuidedTour tour API
Improve GuidedTour tour API
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
GuidedTour (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Matthew Flaschen
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-31 03:11 UTC by Matthew Flaschen
Modified: 2013-04-22 16:17 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Matthew Flaschen 2012-12-31 03:11:51 UTC
Make it easier to use the GuidedTour API.  This is a general tracking bug.  

Most of this will probably wait until after we have a beta out.
Comment 1 Terry Chay 2013-01-03 22:35:05 UTC
What sort of ideas are you thinking about?
Comment 2 Matthew Flaschen 2013-01-03 23:04:15 UTC
I'm very open to suggestions.  But there are a few things that could be easier:

1. People have to manually construct the guider ID.
2. You have to do multiple calls to initGuider.
3. Some things like the next button could potentially have less boilerplate.

One idea is to pass a name and array of steps to a wrapper method, with automatic features like a next button on every step but the last.

Note that the i18n change is already a small improvement on this front, in that you can just use somepropertymsg: 'message-name' for i18n.
Comment 3 Steven Walling 2013-01-03 23:10:03 UTC
Speaking as semi-technical end user, making users write JSON for this one purpose seems a bit crazy. The people who will conceivably write tours expect and understand writing JavaScript in the MediaWiki namespace as the standard for creating gadgets and other interfaces. Unless there's a really really good reason to deviate from this standard, I would rather not chance hurting community adoption.
Comment 4 Matthew Flaschen 2013-01-03 23:20:41 UTC
One idea is to have two APIs:

1. One is a JavaScript API with the full flexibility of Guiders, with just some convenience wrapping (e.g. possibly automatic IDs and almost certainly easy i18n).
2. The other is more high-level, and would maybe even use a simple JSON structure instead of JavaScript as Terry suggested at https://bugzilla.wikimedia.org/show_bug.cgi?id=43531 (not set on this either way).

If you want, you can brainstorm ideas at https://www.mediawiki.org/wiki/Guided_tours

Steven, the set of people who write JavaScript on Wikipedia is not that big.  So if we can provide an option that attracts people who write things like Wikipedia:Tutorial, that's a win.

Also, bear in mind that JSON is a focused subset of JavaScript, rather than something totally new like Lua.
Comment 5 Matthew Flaschen 2013-01-03 23:21:21 UTC
Sorry, the brainstorming page is https://www.mediawiki.org/wiki/Guided_tours/API_brainstorming .
Comment 6 Terry Chay 2013-01-03 23:26:28 UTC
Right now they don't even write JSON, they write Javascript. JSON would be a huge step up!

I believe more ideal would be if a tour looked more similar to a (or a bunch of) mediawiki template call. Right now I don't think that's feasible in the short term because features like auto-advancing the guider haven't settled until we actually write more tours. But it's not unreasonable to expect we can reach that given that initiguiders inside the tour look very similar to a key-value list as it is.

I just thought it'd be nice to have a discussion along what lines we are thinking publicly in bugzilla. We definintely want to make writing guided tours more accessible both in terms of security (mediawiki namespace is necessary but too restrictive IMO, at least for content parts, probably the entire tour) and in terms of degree of difficulty (there are too many things that HAVE to be done. For instance the guider ID has to be consistently named for it to work and the next element has to be explicitly called, etc.).
Comment 7 Steven Walling 2013-01-03 23:29:57 UTC
>Right now they don't even write JSON, they write Javascript. JSON would be a
>huge step up!

I wouldn't be so sure. JSON looks simply to people who know JavaScript. It still looks like code to really non-technical people. 

Even if I agreed, I'm not even sure that we want that many tours popping up over the place anyway. I am not really seeing a compelling need to lower the barrier to writing interactive interfaces that low. Modals are best used with care, since they interrupt users.
Comment 8 Matthew Flaschen 2013-01-03 23:36:22 UTC
I think JSON is simpler than anything-goes JS, but it's clearly not trivial, and some people are not going to be able to do either.

I do think we want to make tours easy to write.

First, no one has to use a tour.  You don't have to do the "how to read article history tour" to read article history.  You do it if you want to, perhaps linked from Help:Page history.  So we're not interrupting people who just clicked the history tab and want to get to the point.

Second, tours are easily dismissable, so if you do start on some tour, and realize, "I already know all this", you just click the x.

Basically, I don't see tours as a new interface.  After all, the tour itself doesn't allow you to do anything; you still have to e.g. do the actual edit.

It's something optional that shows you how to use an existing interface.
Comment 9 Steven Walling 2013-01-03 23:49:37 UTC
>It's something optional that shows you how to use an existing interface.

You cannot be too careful about educational tools like this. See also: Clippy. The line between a helpful popup and an annoyance which appears too often is finer than you might think.
Comment 10 Matthew Flaschen 2013-01-03 23:51:18 UTC
Clippy was unpopular precisely because it showed by default (and in a very annoying way).

Tours would never show by default, only when you start one by putting tour= in your URL.  In practice, that's almost always going to be when you follow a link from some help or project page.
Comment 11 Matthew Flaschen 2013-01-03 23:56:44 UTC
We may want to show them by default in a few cases.

However, that doesn't mean we have to limit the library of tours that are just available to take (and can be linked from help pages).
Comment 12 Matthew Flaschen 2013-01-03 23:57:42 UTC
Also, they can be started from a cookie, but ordinary Help: or Project: pages clearly can't do that.
Comment 13 Matthew Flaschen 2013-01-26 04:30:05 UTC
I added a proposal to spur discussion at https://www.mediawiki.org/wiki/Guided_tours/API_brainstorming

This could help with things like an isTooltipOnly property, or other tour-level information.
Comment 14 Matthew Flaschen 2013-02-05 05:09:13 UTC
I've started this, based on the defineTour idea.  This will make it much more elegant to add isSinglePage and shouldTrack.
Comment 15 Matthew Flaschen 2013-02-05 06:59:42 UTC
I've made an initial Gerrit (https://gerrit.wikimedia.org/r/#/c/47561/).  It still needs tests, which I'm going to amend the commit to add.

Let me know what you think.
Comment 16 Matthew Flaschen 2013-02-05 08:48:04 UTC
That commit got merged, so I'll do the tests in a separate one.
Comment 17 Matthew Flaschen 2013-02-06 03:02:34 UTC
Tests are in https://gerrit.wikimedia.org/r/#/c/47698/ .
Comment 18 Matthew Flaschen 2013-02-06 04:03:36 UTC
Merged.

I'm going to go ahead and mark this fixed.  However, you can still use the brainstorming page (https://www.mediawiki.org/wiki/Guided_tours/API_brainstorming) and create bugs with proposals.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links