Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guided tour / walkthrough #2168

Merged
merged 78 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
b6cd64f
add Shepherd version 10.0.0
hughrun Jun 11, 2022
cfa6597
add shepherd styles for guided tour
hughrun Jun 12, 2022
f81095c
give suggested books block an id
hughrun Jun 12, 2022
806e277
add help button if page has tour
hughrun Jun 12, 2022
c614aeb
add shepherd tours
hughrun Jun 12, 2022
e768cf4
add barcode reader to home feed tour
hughrun Jun 12, 2022
2b43198
help tour button styling updates
hughrun Jun 12, 2022
80c7192
add show_guided_tour value to User
hughrun Jun 13, 2022
6b7caa9
url for setting show_guided_tour
hughrun Jun 13, 2022
07225c6
add guided tour link
hughrun Jun 13, 2022
8cadb3d
fix guided tour url
hughrun Jun 13, 2022
6ffb086
update tour link in main template
hughrun Jun 13, 2022
5f0e149
add guided tour to main feed page
hughrun Jun 13, 2022
2030dc8
clean up tour files
hughrun Jun 13, 2022
83e7302
update home feed guided tour
hughrun Jun 13, 2022
aebeac9
add guided tour to user profile
hughrun Jun 13, 2022
fbf7f37
user profile tour only on activity tab
hughrun Jun 13, 2022
7fbc991
change cancel buttons for guided tour
hughrun Jun 13, 2022
00df3c9
add guided tour for user groups page
hughrun Jun 13, 2022
d36dd9c
guided tour for user groups
hughrun Jun 18, 2022
5bf835b
fix typos
hughrun Jun 18, 2022
5796597
make guided tour cancel button DRY
hughrun Jun 18, 2022
044a173
remove CSRF from tour scripts
hughrun Jun 18, 2022
0e06143
add guided tour to user shelves
hughrun Jun 18, 2022
fef66a7
guided tour for book search
hughrun Jun 19, 2022
ff37b77
clean up search guided tour code
hughrun Jun 19, 2022
bc4a1c6
Guided tour of book page
hughrun Jun 19, 2022
d1079a1
remove console log from guided_tour.js
hughrun Jul 2, 2022
827a63b
add shelves to guided tour
hughrun Jul 2, 2022
06b4a55
add lists to guided tour
hughrun Jul 2, 2022
a8940b8
Fix order of tour
hughrun Jul 3, 2022
3f67bc3
standardise ids for tour anchors
hughrun Jul 3, 2022
39efb90
add noscript message for guided tour
hughrun Jul 3, 2022
04324c0
back button on all tour modals
hughrun Jul 3, 2022
0e9dc66
Merge branch 'main' into tour
hughrun Jul 3, 2022
f8e51b5
format guided tour js with prettier
hughrun Jul 3, 2022
b82cf88
linting fixes
hughrun Jul 3, 2022
d1180d4
linting fix for linting fix
hughrun Jul 3, 2022
3365bb6
show_guided_tour is not added to AP serialisation
hughrun Jul 9, 2022
53a89f6
guided tour only for request.user
hughrun Jul 9, 2022
389da79
fix missing hyphen
hughrun Jul 9, 2022
4d843b5
move shelve button tour id to prevent duplicates
hughrun Jul 9, 2022
56b91f4
fix incorrect tour step header
hughrun Jul 9, 2022
68308aa
update tour colour scheme
hughrun Jul 9, 2022
b41c826
custom style for highlighting tour anchorpoints
hughrun Jul 9, 2022
3c317d5
fix sass styles import bug
hughrun Jul 9, 2022
b369681
fix import message
hughrun Jul 9, 2022
5472cdc
update homepage tour
hughrun Jul 9, 2022
bb4b1a1
update user profile tour styles
hughrun Jul 9, 2022
bb85d3c
update search tour
hughrun Jul 9, 2022
e85e4a5
update book page tour
hughrun Jul 9, 2022
d67c6dc
user books tour update
hughrun Jul 9, 2022
07a8826
update lists tour
hughrun Jul 9, 2022
6df09eb
update user groups tour
hughrun Jul 9, 2022
c68c721
minor wording updates for tour
hughrun Jul 9, 2022
791847d
add timeline info to home tour
hughrun Jul 9, 2022
2f2ab5c
add DM tour
hughrun Jul 9, 2022
495bac2
transfer tour from group to DM
hughrun Jul 9, 2022
baad131
default existing users to no tour
hughrun Jul 9, 2022
245120e
resolve git conflict with main branch
hughrun Jul 9, 2022
02c6932
lint migration file
hughrun Jul 9, 2022
48bcb85
resolve conflict
hughrun Jul 9, 2022
8fbd634
add id to dm box
hughrun Jul 9, 2022
ab5e412
Merge branch 'main' into tour
hughrun Jul 9, 2022
e1acdd0
fix migrations
hughrun Jul 9, 2022
37c2ad1
fix border radius on shepherd messages
hughrun Jul 9, 2022
142c0e1
fix template error in search tour
hughrun Jul 10, 2022
a84deff
add scrollTo for link step on home tour
hughrun Jul 10, 2022
126fd4e
various wording updates to guided tour
hughrun Jul 10, 2022
6b1fcc3
use class instead of id for spoilers tour
hughrun Jul 10, 2022
43c598d
remove DMs from guided tour
hughrun Jul 17, 2022
387f2a7
update tour text
hughrun Jul 17, 2022
bec2943
remove console logs
hughrun Jul 17, 2022
c48ddf4
cleanup
hughrun Jul 17, 2022
17dc5e7
Merge branch 'main' into tour
hughrun Jul 17, 2022
356c1c0
fix migration dependency order
hughrun Jul 17, 2022
a4714f0
fix anchors not working on homepage tour
hughrun Jul 27, 2022
2455aad
add scrollTo where needed
hughrun Jul 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions bookwyrm/migrations/0154_user_show_guided_tour.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.14 on 2022-07-09 23:33

from django.db import migrations, models


def existing_users_default(apps, schema_editor):
db_alias = schema_editor.connection.alias
user_model = apps.get_model("bookwyrm", "User")
user_model.objects.using(db_alias).filter(local=True).update(show_guided_tour=False)


class Migration(migrations.Migration):

dependencies = [
("bookwyrm", "0153_merge_20220706_2141"),
]

operations = [
migrations.AddField(
model_name="user",
name="show_guided_tour",
field=models.BooleanField(default=True),
),
migrations.RunPython(existing_users_default, migrations.RunPython.noop),
]
1 change: 1 addition & 0 deletions bookwyrm/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class User(OrderedCollectionPageMixin, AbstractUser):
show_goal = models.BooleanField(default=True)
show_suggested_users = models.BooleanField(default=True)
discoverable = fields.BooleanField(default=False)
show_guided_tour = models.BooleanField(default=True)

# feed options
feed_status_types = ArrayField(
Expand Down
1 change: 1 addition & 0 deletions bookwyrm/static/css/themes/bookwyrm-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ $family-secondary: $family-sans-serif;

@import "../bookwyrm.scss";
@import "../vendor/icons.css";
@import "../vendor/shepherd.scss";
1 change: 1 addition & 0 deletions bookwyrm/static/css/themes/bookwyrm-light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ $family-secondary: $family-sans-serif;

@import "../bookwyrm.scss";
@import "../vendor/icons.css";
@import "../vendor/shepherd.scss";
48 changes: 48 additions & 0 deletions bookwyrm/static/css/vendor/shepherd.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Shepherd styles for guided tour.
Based on Shepherd v 10.0.0 styles.
*/

@use 'bulma/bulma.sass';

.shepherd-button {
@extend .button.mr-2;
}

.shepherd-button.shepherd-button-secondary {
@extend .button.is-light;
}

.shepherd-footer {
@extend .message-body;
@extend .is-info.is-light;
border-color: $info-light;
border-radius: 0 0 4px 4px;
}

.shepherd-cancel-icon{background:transparent;border:none;color:hsla(0,0%,50%,.75);cursor:pointer;font-size:2em;font-weight:400;margin:0;padding:0;transition:color .5s ease}.shepherd-cancel-icon:hover{color:rgba(0,0,0,.75)}.shepherd-has-title .shepherd-content .shepherd-cancel-icon{color:hsla(0,0%,50%,.75)}.shepherd-has-title .shepherd-content .shepherd-cancel-icon:hover{color:rgba(0,0,0,.75)}

.shepherd-header {
@extend .message-header;
@extend .is-info;
}

.shepherd-text {
@extend .message-body;
@extend .is-info.is-light;
border-radius: 0;
}

.shepherd-content {
@extend .message;
}

.shepherd-element{background:$info-light;border-radius:5px;box-shadow:4px 4px 6px rgba(0,0,0,.2);max-width:400px;opacity:0;outline:none;transition:opacity .3s,visibility .3s;visibility:hidden;width:100%;z-index:9999}.shepherd-enabled.shepherd-element{opacity:1;visibility:visible}.shepherd-element[data-popper-reference-hidden]:not(.shepherd-centered){opacity:0;pointer-events:none;visibility:hidden}.shepherd-element,.shepherd-element *,.shepherd-element :after,.shepherd-element :before{box-sizing:border-box}.shepherd-arrow,.shepherd-arrow:before{height:16px;position:absolute;width:16px;z-index:-1}.shepherd-arrow:before{background:$info-light;box-shadow:0 2px 4px rgba(0,0,0,.2);content:"";transform:rotate(45deg)}.shepherd-element[data-popper-placement^=top]>.shepherd-arrow{bottom:-8px}.shepherd-element[data-popper-placement^=bottom]>.shepherd-arrow{top:-8px}.shepherd-element[data-popper-placement^=left]>.shepherd-arrow{right:-8px}.shepherd-element[data-popper-placement^=right]>.shepherd-arrow{left:-8px}.shepherd-element.shepherd-centered>.shepherd-arrow{opacity:0}.shepherd-element.shepherd-has-title[data-popper-placement^=bottom]>.shepherd-arrow:before{background-color:$info}.shepherd-target-click-disabled.shepherd-enabled.shepherd-target,.shepherd-target-click-disabled.shepherd-enabled.shepherd-target *{pointer-events:none}

.shepherd-modal-overlay-container{height:0;left:0;opacity:0;overflow:hidden;pointer-events:none;position:fixed;top:0;transition:all .3s ease-out,height 0ms .3s,opacity .3s 0ms;width:100vw;z-index:9997}.shepherd-modal-overlay-container.shepherd-modal-is-visible{height:100vh;opacity:.5;transform:translateZ(0);transition:all .3s ease-out,height 0s 0s,opacity .3s 0s}.shepherd-modal-overlay-container.shepherd-modal-is-visible path{pointer-events:all}

.tour-element-highlight {
border: 5px solid $info;
border-radius: 5px;
box-shadow:4px 4px 6px rgba(0,0,0,.2);
}
18 changes: 18 additions & 0 deletions bookwyrm/static/js/guided_tour.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Set guided tour user value to False
* @param {csrf_token} string
* @return {undefined}
*/

/* eslint-disable no-unused-vars */
function disableGuidedTour(csrf_token) {
"use strict";
fetch("/guided-tour/False", {
headers: {
"X-CSRFToken": csrf_token,
},
method: "POST",
redirect: "follow",
mode: "same-origin",
});
}