(core) Enable auto triggering of Welcome Tour, and various improvements.

Summary:
- Add showGristTour preference, and trigger tour automatically.
- Tour is only triggered for new and anonymous users on a personal org, with
  edit permission.

- Automatically open the right panel at tour start.
- Don't show tours on mobile, since that's not ready (popups are cut off
  and can't be dismissed)
- Cancel previous tour if a new one is somehow started.
- Remove #repeat- trigger hash tags from the URL when the tour starts.
- Ensure Help Center popup is positioned even when left panel is collapsed.
- Polish up the content of the last two cards in the tour.

Test Plan: Added test case for triggering and opening right panel.

Reviewers: alexmojaki, paulfitz

Reviewed By: alexmojaki

Differential Revision: https://phab.getgrist.com/D2955
This commit is contained in:
Dmitry S
2021-07-30 11:16:33 -04:00
parent 73c4efa315
commit 1605e18f66
12 changed files with 120 additions and 35 deletions

View File

@@ -24,6 +24,11 @@ export interface UserOrgPrefs extends Prefs {
// By living in UserOrgPrefs, this applies only to the examples-containing org.
seenExamples?: number[];
// Whether the user should see the onboarding tour of Grist. False by default, since existing
// users should not see it. New users get this set to true when the user is created. This
// applies to the personal org only; the tour is currently only shown there.
showGristTour?: boolean;
// List of document IDs where the user has seen and dismissed the document tour.
seenDocTours?: string[];
}

View File

@@ -207,6 +207,12 @@ export function encodeUrl(gristConfig: Partial<GristLoadConfig>,
if (state.hash) {
// Project tests use hashes, so only set hash if there is an anchor.
url.hash = hashParts.join('.');
} else if (state.welcomeTour) {
url.hash = 'repeat-welcome-tour';
} else if (state.docTour) {
url.hash = 'repeat-doc-tour';
} else {
url.hash = '';
}
return url.href;
}