Page MenuHomePhabricator

Allow cookie to store multiple tours
Closed, ResolvedPublic

Description

I think there should be a separate cookie by tour, so they don't clobber each other, and they can be deleted individually.

Tours would still be able to opt out of cookies, initially with an isSinglePage property (which will be used for this and hiding the end tour checkbox).


Version: master
Severity: normal

Details

Reference
bz44924

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:22 AM
bzimport set Reference to bz44924.

swalling wrote:

Very good idea. In the future, the likelihood of running multiple tours that could collide will only grow.

This is a blocker for GettingStartedv2, since there's the on-page tour (which does not use cookies) and the main tour.

I realized we didn't completely spec this out. What should be the behavior if they have multiple tour cookies when they visit a page? Should they just all attempt to show, respecting the skip behavior?

I can do an interim solution that keeps a single cookie, but controls whether individual guiders should write to it. But we should see if we can figure out the desired behavior.

swalling wrote:

(In reply to comment #3)

I realized we didn't completely spec this out. What should be the behavior
if
they have multiple tour cookies when they visit a page? Should they just all
attempt to show, respecting the skip behavior?

I can do an interim solution that keeps a single cookie, but controls whether
individual guiders should write to it. But we should see if we can figure
out
the desired behavior.

I have attempted a first draft spec at [[Guided tours]] technical documentation section on mediawiki.org. The relevant suggestion is...

"In order to support multiple tours on the same wiki, a user may have multiple separate tour cookies. However, only one tour may fire on a given page. If there is a conflict and multiple tours attempt to fire on a single page, no tour will be displayed."

Sound reasonable?

GettingStarted doesn't require multiple cookies. The on-page tour should avoid fiddling with the single tour cookie, and clicking a task should set that single cookie just before following a link.

Besides the evils of cookie proliferation, multiple tour cookies are likely to irritate users. Tours aren't titled so one tour's step looks like another's. The user will notice "I clicked the '[ ] End tour' checkbox yet another one of these things showed up!" Furthermore if the user clicks the wrong link in one tour and jumps into a different tour it's more confusion. If it's worth having lots of tours it's worth presenting a way to start a particular tour, and leave the user in control.

swalling wrote:

(In reply to comment #5)

GettingStarted doesn't require multiple cookies. The on-page tour should
avoid
fiddling with the single tour cookie, and clicking a task should set that
single cookie just before following a link.

Besides the evils of cookie proliferation, multiple tour cookies are likely
to
irritate users. Tours aren't titled so one tour's step looks like another's.
The user will notice "I clicked the '[ ] End tour' checkbox yet another one
of
these things showed up!" Furthermore if the user clicks the wrong link in one
tour and jumps into a different tour it's more confusion. If it's worth
having
lots of tours it's worth presenting a way to start a particular tour, and
leave
the user in control.

S, how would you propose that we support multiple tours concurrently on the same wiki then? Think bigger than the GettingStarted single step tour and the tour which happens on another page.

(In reply to comment #6)
I don't know the use case. It may be OK for the user's first interaction with the wiki to automatically trigger one tour, but in general the user should initiate (click "Take a tour..." "Learn more..." "Walk me through..." etc.), and having only one at a time is easier on everyone.

Per S's concerns, we're going to take the simpler approach I labelled "interim solution above":

I've added a changeCookie property to guiders (https://gerrit.wikimedia.org/r/51803).

I then updated GuidedTour to default this to true for most tours, but false for single-page ones (https://gerrit.wikimedia.org/r/51804).

We can revisit multiple cookies if we need to.

Related URL: https://gerrit.wikimedia.org/r/66373 (Gerrit Change I9ce5667a55e9f2ad621d0deecfdff6ff12507d96)

The above implements multiple tours in a single cookie. There are still some known issues when multiple tours try to display on a page, which will be fixed in this or a future change.

(In reply to comment #4)

"In order to support multiple tours on the same wiki, a user may have
multiple
separate tour cookies. However, only one tour may fire on a given page. If
there is a conflict and multiple tours attempt to fire on a single page, no
tour will be displayed."

We've decided to change this to "the last tour started will be displayed"

https://gerrit.wikimedia.org/r/#/c/67066/ implements that behavior ("the last tour started will be displayed").

swalling wrote:

Current state of the design is that we're sticking with one cookie that can host an arbitrary number of tours.