OZtree icon indicating copy to clipboard operation
OZtree copied to clipboard

Tour controller (was: Tour URL format)

Open hyanwong opened this issue 5 years ago • 6 comments

After discussion with @jrosindell , we think that the simplest format for a URL for a tour is something like

www.onezoom.org/life/my_tour

which can be distinguished from a "normal" geo-located URL because of the lack of @ sign, i.e. it's not www.onezoom.org/life/@foo=bar. This should play nicely with e.g. partner pages, which can be of the form www.onezoom.org/linnean/my_tour.

hyanwong avatar Feb 14 '20 17:02 hyanwong

We think that ?tour=dinosaurs:4 is less fraught with parsing mishap than the above. Where "4" is the number of the tourstop in sequence (OTT might be more stable, but not necessarily unique in a tour).

record_url will need to preserve it, so a copy-pasted URL will also continue at that tourstop if you've paused the tour and started poking around.

You may have to assume that tours start paused, so starting means a click and autoplay.

lentinj avatar May 19 '22 13:05 lentinj

The bulk of this work here will be a Tour (javascript) controller, that can be plumbed into URL state and trigger an update.

The tour controller should also be responsible for the tutorial / screensaver wiring. I'm not sure if there should be some consideration for pre-loading the tutorial. But it's unlikely worth the effort.

lentinj avatar May 24 '22 12:05 lentinj

Also as part of this the initialisation of Tour needs to be tightened up. setup_page() return types are a bit vague, depending on what is handed in, and the ready promise is a bit messy.

lentinj avatar May 24 '22 13:05 lentinj

  • [x] Manage the destruction of any old Tour objects (presumably we have a screensaver + active tour slot?) by calling a destructor on the Tour class, which allows it to detach and destroy any associated DOM, solving #199

lentinj avatar May 25 '22 14:05 lentinj

The above, after doing a lot of ~unrelated bugfixes, introduces controller_tour. This means I can do e.g. onezoom.controller.tour_start('/tour/tutorial_MDmouse') from the /life page.

Next step is to add an option for managing the tour via. URL, as described above.

lentinj avatar May 26 '22 10:05 lentinj

The above adds a "tour" querystring parameter, which looks like tour=/tour/tutorial@2, where "2" is an optional tourstop number. The URL is parsed well enough that we won't mistake it for the @ in the OTT.

lentinj avatar May 26 '22 13:05 lentinj

Merged into main with https://github.com/OneZoom/OZtree/pull/639

lentinj avatar Mar 23 '23 11:03 lentinj