Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

New User Onboarding Task List #9083

Merged
merged 33 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a97e505
Improve type of AccessibleButton to accurately represent available props
justjanne Jul 19, 2022
69a2563
Implement animations for progress bars
justjanne Jul 22, 2022
0cf6255
Implement hero image and initial checklist version
justjanne Jul 22, 2022
7293072
Correct analytics tracking
justjanne Jul 25, 2022
08b09fe
Trying to reduce type size to prevent buildkit OOM
justjanne Jul 25, 2022
54060d5
Update i18n
justjanne Jul 25, 2022
af5c515
Use CSS counters
justjanne Jul 25, 2022
236fc76
Use dynamic brand for i18n
justjanne Jul 25, 2022
fd192b9
Update i18n
justjanne Jul 25, 2022
196460c
Update analytics specs
justjanne Jul 25, 2022
124b2a8
Improve task list accessibility
justjanne Jul 25, 2022
a421649
Split the logic for showing the new user page into a separate function
justjanne Jul 25, 2022
97f4996
Test the condition for showing the page only to new users
justjanne Jul 25, 2022
c3112fb
Test find friends action
justjanne Jul 25, 2022
7e61d56
Make css lint happy
justjanne Jul 25, 2022
27997eb
Update analytics events
justjanne Jul 25, 2022
688e8ed
Merge remote-tracking branch 'origin/develop' into justjanne/feat/onb…
justjanne Jul 25, 2022
211a21c
Update analytics events
justjanne Jul 25, 2022
1d9a6bd
Improve image quality/size tradeoff
justjanne Jul 26, 2022
8406cf1
Merge remote-tracking branch 'origin/develop' into justjanne/feat/onb…
justjanne Jul 26, 2022
f1bd2b8
Merge remote-tracking branch 'origin/develop' into justjanne/feat/onb…
justjanne Jul 26, 2022
edf5588
Make cypress test more reliable
justjanne Jul 26, 2022
58c9ebc
Make cypress test more reliable
justjanne Jul 26, 2022
8ae66e9
Add percy snapshots to new user onboarding page
justjanne Jul 28, 2022
98e55ac
Remove unnecessary afterEach hook
justjanne Jul 28, 2022
16da89a
Merge remote-tracking branch 'origin/develop' into justjanne/feat/onb…
justjanne Jul 28, 2022
b455a9e
Fix margin as requested by design
justjanne Jul 29, 2022
60cde64
Fix animation specs as requested by design
justjanne Jul 29, 2022
cbd6b33
Color dot at the end of header title, as requested by design
justjanne Jul 29, 2022
85e0e9a
Make page more responsive, as requested by design
justjanne Jul 29, 2022
fe1539f
Reduce header margins, as requested by design
justjanne Jul 29, 2022
9695c2a
Improve entrance animation for task list, as requested by design
justjanne Jul 29, 2022
da94df9
Make style lint happy
justjanne Jul 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions cypress/e2e/user-onboarding/user-onboarding-new.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/// <reference types="cypress" />

import { MatrixClient } from "../../global";
import { SynapseInstance } from "../../plugins/synapsedocker";

describe("User Onboarding (new user)", () => {
let synapse: SynapseInstance;

const bot1Name = "BotBob";
let bot1: MatrixClient;

beforeEach(() => {
cy.startSynapse("default").then(data => {
synapse = data;
cy.initTestUser(synapse, "Jane Doe");
cy.window({ log: false }).then(win => {
win.localStorage.setItem("mx_registration_time", "1656633601");
});
cy.reload().then(() => {
// wait for the app to load
return cy.get(".mx_MatrixChat", { timeout: 15000 });
});
cy.getBot(synapse, { displayName: bot1Name }).then(_bot1 => {
bot1 = _bot1;
});
cy.get('.mx_UserOnboardingPage').should('exist');
});
});

afterEach(() => {
cy.stopSynapse(synapse);
});

it("page is shown", () => {
cy.get('.mx_UserOnboardingPage').should('exist');
cy.percySnapshot("User onboarding page");
});

it("using find friends action should increase progress", () => {
cy.get(".mx_ProgressBar").invoke("val").then((oldProgress) => {
const findPeopleAction = cy.contains(".mx_UserOnboardingTask_action", "Find friends");
expect(findPeopleAction).to.exist;
findPeopleAction.click();
cy.get(".mx_InviteDialog_editor input").type(bot1.getUserId());
cy.get(".mx_InviteDialog_buttonAndSpinner").click();
cy.get(".mx_InviteDialog_buttonAndSpinner").should("not.exist");
cy.visit("/#/home");

cy.get(".mx_ProgressBar").invoke("val").should("be.greaterThan", oldProgress);
});
});
});
46 changes: 46 additions & 0 deletions cypress/e2e/user-onboarding/user-onboarding-old.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/// <reference types="cypress" />

import { SynapseInstance } from "../../plugins/synapsedocker";

describe("User Onboarding (old user)", () => {
let synapse: SynapseInstance;

beforeEach(() => {
cy.startSynapse("default").then(data => {
synapse = data;
cy.initTestUser(synapse, "Jane Doe");
cy.window({ log: false }).then(win => {
win.localStorage.setItem("mx_registration_time", "2");
});
cy.reload().then(() => {
// wait for the app to load
return cy.get(".mx_MatrixChat", { timeout: 15000 });
});
});
});

afterEach(() => {
cy.visit("/#/home");
cy.stopSynapse(synapse);
});

it("page is hidden", () => {
cy.get('.mx_UserOnboardingPage').should('not.exist');
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@matrix-org/analytics-events": "^0.1.2",
"@matrix-org/analytics-events": "^0.2.0",
"@matrix-org/react-sdk-module-api": "^0.0.3",
"@sentry/browser": "^6.11.0",
"@sentry/tracing": "^6.11.0",
Expand Down
4 changes: 4 additions & 0 deletions res/css/_components.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@
@import "./views/toasts/_IncomingCallToast.pcss";
@import "./views/toasts/_NonUrgentEchoFailureToast.pcss";
@import "./views/typography/_Heading.pcss";
@import "./views/user-onboarding/_UserOnboardingHeader.pcss";
@import "./views/user-onboarding/_UserOnboardingList.pcss";
@import "./views/user-onboarding/_UserOnboardingPage.pcss";
@import "./views/user-onboarding/_UserOnboardingTask.pcss";
@import "./views/verification/_VerificationShowSas.pcss";
@import "./views/voip/CallView/_CallViewButtons.pcss";
@import "./views/voip/_CallPreview.pcss";
Expand Down
2 changes: 2 additions & 0 deletions res/css/_spacing.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ $spacing-24: 24px;
$spacing-28: 28px;
$spacing-32: 32px;
$spacing-40: 40px;
$spacing-48: 48px;
$spacing-64: 64px;
101 changes: 101 additions & 0 deletions res/css/views/user-onboarding/_UserOnboardingHeader.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_UserOnboardingHeader {
display: flex;
flex-direction: row;
padding: $spacing-32;
border-radius: 16px;
background: $system;
gap: $spacing-64;

animation-delay: 1500ms;
animation-duration: 300ms;
animation-timing-function: cubic-bezier(0, 0, 0.58, 1);
animation-name: mx_UserOnboardingHeader_slideIn;
animation-fill-mode: backwards;
will-change: opacity, transform;

@media (max-width: 1280px) {
margin: $spacing-32;
}

.mx_UserOnboardingHeader_dot {
color: $accent;
}

.mx_UserOnboardingHeader_content {
display: flex;
flex-direction: column;
flex-basis: 50%;
flex-shrink: 1;
flex-grow: 1;
min-width: 0;
gap: $spacing-24;
margin-right: auto;

p {
margin: 0;
}

.mx_AccessibleButton {
margin-top: auto;
align-self: flex-start;
padding: $spacing-12 $spacing-24;
}
}

.mx_UserOnboardingHeader_image {
flex-basis: 30%;
flex-shrink: 1;
flex-grow: 1;
align-self: center;
height: calc(100% + $spacing-64 + $spacing-64);
aspect-ratio: 4 / 3;
object-fit: contain;
min-width: 0;
min-height: 0;
margin-top: -$spacing-64;
margin-bottom: -$spacing-64;

animation-delay: 1500ms;
animation-duration: 300ms;
animation-timing-function: cubic-bezier(0, 0, 0.58, 1);
animation-name: mx_UserOnboardingHeader_slideInLong;
animation-fill-mode: backwards;
will-change: opacity, transform;
}
}

@keyframes mx_UserOnboardingHeader_slideIn {
0% {
transform: translate(0, 8px);
opacity: 0;
}
100% {
transform: translate(0, 0);
opacity: 1;
}
}

@keyframes mx_UserOnboardingHeader_slideInLong {
0% {
transform: translate(0, 32px);
}
100% {
transform: translate(0, 0);
}
}
79 changes: 79 additions & 0 deletions res/css/views/user-onboarding/_UserOnboardingList.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_UserOnboardingList {
display: flex;
flex-direction: column;
margin: 0 $spacing-32;

animation-duration: 300ms;
animation-timing-function: cubic-bezier(0, 0, 0.58, 1);
animation-name: mx_UserOnboardingList_slideIn;
animation-fill-mode: backwards;
will-change: opacity;

.mx_UserOnboardingList_header {
display: flex;
flex-direction: row;
gap: 12px;
align-items: center;

.mx_UserOnboardingList_hint {
color: $secondary-content;
}
}

.mx_UserOnboardingList_progress {
display: flex;
flex-direction: column;
counter-reset: user-onboarding;

.mx_ProgressBar {
width: auto;
margin-top: $spacing-16;
height: 16px;

@mixin ProgressBarBorderRadius 16px;
}

.mx_UserOnboardingFeedback {
margin-top: $spacing-16;
}
}

.mx_UserOnboardingList_list {
display: grid;
grid-template-columns: max-content 1fr max-content;

appearance: none;
list-style: none;
margin: $spacing-32 0 0;
padding: 0;

grid-gap: $spacing-24;
}
}

@keyframes mx_UserOnboardingList_slideIn {
0% {
transform: translate(0, 8px);
opacity: 0;
}
100% {
transform: translate(0, 0);
opacity: 1;
}
}
35 changes: 35 additions & 0 deletions res/css/views/user-onboarding/_UserOnboardingPage.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_UserOnboardingPage {
width: 100%;
height: 100%;

align-self: stretch;
max-width: 1200px;
margin: 0 auto auto;

display: flex;
flex-direction: column;
box-sizing: border-box;

gap: $spacing-64;
padding: $spacing-64 100px;

@media (max-width: 1280px) {
padding: $spacing-48 $spacing-32;
}
}
Loading