From 17ba9147c1d598e5ec87db0c538b8d43dcac5d4f Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Fri, 22 Jul 2022 14:25:35 +0200 Subject: [PATCH 1/8] Implement button to return to user onboarding screen --- .../user-onboarding/user-onboarding-new.ts | 5 +- .../user-onboarding/user-onboarding-old.ts | 5 +- res/css/_components.pcss | 1 + .../_UserOnboardingButton.pcss | 68 ++++++++++++++ src/components/structures/LeftPanel.tsx | 7 ++ src/components/structures/LoggedInView.tsx | 1 + .../tabs/user/PreferencesUserSettingsTab.tsx | 1 + .../user-onboarding/UserOnboardingButton.tsx | 90 +++++++++++++++++++ src/i18n/strings/en_EN.json | 2 + src/settings/Settings.tsx | 5 ++ 10 files changed, 183 insertions(+), 2 deletions(-) create mode 100644 res/css/views/user-onboarding/_UserOnboardingButton.pcss create mode 100644 src/components/views/user-onboarding/UserOnboardingButton.tsx diff --git a/cypress/e2e/user-onboarding/user-onboarding-new.ts b/cypress/e2e/user-onboarding/user-onboarding-new.ts index ca83fe8ed28..421e3632f30 100644 --- a/cypress/e2e/user-onboarding/user-onboarding-new.ts +++ b/cypress/e2e/user-onboarding/user-onboarding-new.ts @@ -47,8 +47,11 @@ describe("User Onboarding (new user)", () => { cy.stopSynapse(synapse); }); - it("page is shown", () => { + it("page is shown and preference exists", () => { cy.get('.mx_UserOnboardingPage').should('exist'); + cy.get('.mx_UserOnboardingButton').should('exist'); + cy.openUserSettings("Preferences"); + cy.contains("Show shortcut to welcome page above the room list").should("exist"); cy.percySnapshot("User onboarding page"); }); diff --git a/cypress/e2e/user-onboarding/user-onboarding-old.ts b/cypress/e2e/user-onboarding/user-onboarding-old.ts index 2be066e0a1c..f079ed9a4c3 100644 --- a/cypress/e2e/user-onboarding/user-onboarding-old.ts +++ b/cypress/e2e/user-onboarding/user-onboarding-old.ts @@ -40,7 +40,10 @@ describe("User Onboarding (old user)", () => { cy.stopSynapse(synapse); }); - it("page is hidden", () => { + it("page and preference are hidden", () => { cy.get('.mx_UserOnboardingPage').should('not.exist'); + cy.get('.mx_UserOnboardingButton').should('not.exist'); + cy.openUserSettings("Preferences"); + cy.contains("Show shortcut to welcome page above the room list").should("not.exist"); }); }); diff --git a/res/css/_components.pcss b/res/css/_components.pcss index c4a5d6a434d..c1a9d8605da 100644 --- a/res/css/_components.pcss +++ b/res/css/_components.pcss @@ -328,6 +328,7 @@ @import "./views/user-onboarding/_UserOnboardingList.pcss"; @import "./views/user-onboarding/_UserOnboardingPage.pcss"; @import "./views/user-onboarding/_UserOnboardingTask.pcss"; +@import "./views/user-onboarding/_UserOnboardingButton.pcss"; @import "./views/verification/_VerificationShowSas.pcss"; @import "./views/voip/CallView/_CallViewButtons.pcss"; @import "./views/voip/_CallPreview.pcss"; diff --git a/res/css/views/user-onboarding/_UserOnboardingButton.pcss b/res/css/views/user-onboarding/_UserOnboardingButton.pcss new file mode 100644 index 00000000000..40516b0f2bb --- /dev/null +++ b/res/css/views/user-onboarding/_UserOnboardingButton.pcss @@ -0,0 +1,68 @@ +.mx_UserOnboardingButton { + display: flex; + flex-direction: column; + align-content: stretch; + align-items: stretch; + border-radius: 8px; + margin: $spacing-8 $spacing-8 0; + padding: $spacing-12; + + &.mx_UserOnboardingButton_selected, + &:hover, + &:focus-within { + background-color: $panel-actions; + } + + .mx_UserOnboardingButton_content { + display: flex; + flex-direction: row; + gap: 5px; + align-items: center; + + .mx_Heading_h4 { + margin-right: auto; + font-size: $font-14px; + color: $primary-content; + } + + .mx_UserOnboardingButton_percentage { + font-size: $font-12px; + color: $secondary-content; + } + + .mx_UserOnboardingButton_close { + position: relative; + box-sizing: border-box; + width: 14px; + height: 14px; + border-radius: 7px; + border: 1px solid $secondary-content; + flex-shrink: 0; + + &::before { + background-color: $secondary-content; + content: ""; + mask-repeat: no-repeat; + mask-position: center; + mask-size: contain; + width: 7px; + height: 7px; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + mask-image: url("$(res)/img/element-icons/cancel-rounded.svg"); + } + } + } + + .mx_ProgressBar { + width: auto; + margin-top: $spacing-8; + background: $background; + } + + &.mx_UserOnboardingButton_completed .mx_ProgressBar { + display: none; + } +} diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index ab8620a26df..e5eee9cff74 100644 --- a/src/components/structures/LeftPanel.tsx +++ b/src/components/structures/LeftPanel.tsx @@ -45,9 +45,12 @@ import { shouldShowComponent } from "../../customisations/helpers/UIComponents"; import { UIComponent } from "../../settings/UIFeature"; import { ButtonEvent } from "../views/elements/AccessibleButton"; import PosthogTrackers from "../../PosthogTrackers"; +import PageType from "../../PageTypes"; +import { UserOnboardingButton } from "../views/user-onboarding/UserOnboardingButton"; interface IProps { isMinimized: boolean; + pageType: PageType; resizeNotifier: ResizeNotifier; } @@ -390,6 +393,10 @@ export default class LeftPanel extends React.Component { onVisibilityChange={this.refreshStickyHeaders} /> ) } +
{ data-collapsed={this.props.collapseLhs ? true : undefined} > diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index fd9dd6f4388..8e735856efe 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -44,6 +44,7 @@ interface IState { export default class PreferencesUserSettingsTab extends React.Component { static ROOM_LIST_SETTINGS = [ 'breadcrumbs', + "FTUE.userOnboardingButton", ]; static SPACES_SETTINGS = [ diff --git a/src/components/views/user-onboarding/UserOnboardingButton.tsx b/src/components/views/user-onboarding/UserOnboardingButton.tsx new file mode 100644 index 00000000000..436e034ed2e --- /dev/null +++ b/src/components/views/user-onboarding/UserOnboardingButton.tsx @@ -0,0 +1,90 @@ +/* +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. +*/ + +import classNames from "classnames"; +import React, { useCallback } from "react"; + +import { Action } from "../../../dispatcher/actions"; +import defaultDispatcher from "../../../dispatcher/dispatcher"; +import { useSettingValue } from "../../../hooks/useSettings"; +import { useUserOnboardingTasks } from "../../../hooks/useUserOnboardingTasks"; +import { _t } from "../../../languageHandler"; +import { UseCase } from "../../../settings/enums/UseCase"; +import { SettingLevel } from "../../../settings/SettingLevel"; +import SettingsStore from "../../../settings/SettingsStore"; +import AccessibleButton from "../../views/elements/AccessibleButton"; +import ProgressBar from "../../views/elements/ProgressBar"; +import Heading from "../../views/typography/Heading"; +import { showUserOnboardingPage } from "./UserOnboardingPage"; + +function toPercentage(progress: number): string { + return (progress * 100).toFixed(0); +} + +interface Props { + selected: boolean; + minimized: boolean; +} + +export function UserOnboardingButton({ selected, minimized }: Props) { + const [completedTasks, waitingTasks] = useUserOnboardingTasks(); + + const completed = completedTasks.length; + const waiting = waitingTasks.length; + const total = completed + waiting; + + const progress = waiting ? completed / total : 1; + + const onDismiss = useCallback(() => { + SettingsStore.setValue("FTUE.userOnboardingButton", null, SettingLevel.ACCOUNT, false); + }, []); + + const useCase = useSettingValue("FTUE.useCaseSelection"); + const visible = useSettingValue("FTUE.userOnboardingButton"); + if (!visible || minimized || !showUserOnboardingPage(useCase)) { + return null; + } + + return ( + defaultDispatcher.fire(Action.ViewHomePage)}> + { !minimized && ( + <> +
+ + { _t("Welcome") } + + { !completed && ( +
+ { toPercentage(progress) }% +
+ ) } + +
+ + + ) } +
+ ); +} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 00017859015..599a7c6ad6c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -951,6 +951,7 @@ "Order rooms by name": "Order rooms by name", "Show rooms with unread notifications first": "Show rooms with unread notifications first", "Show shortcuts to recently viewed rooms above the room list": "Show shortcuts to recently viewed rooms above the room list", + "Show shortcut to welcome page above the room list": "Show shortcut to welcome page above the room list", "Show hidden events in timeline": "Show hidden events in timeline", "Low bandwidth mode (requires compatible homeserver)": "Low bandwidth mode (requires compatible homeserver)", "Allow fallback call assist server turn.matrix.org when your homeserver does not offer one (your IP address would be shared during a call)": "Allow fallback call assist server turn.matrix.org when your homeserver does not offer one (your IP address would be shared during a call)", @@ -1147,6 +1148,7 @@ "Anchor": "Anchor", "Headphones": "Headphones", "Folder": "Folder", + "Welcome": "Welcome", "Secure messaging for friends and family": "Secure messaging for friends and family", "With free end-to-end encrypted messaging, and unlimited voice and video calls, %(brand)s is a great way to stay in touch.": "With free end-to-end encrypted messaging, and unlimited voice and video calls, %(brand)s is a great way to stay in touch.", "Start your first chat": "Start your first chat", diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 44d82da5cd4..773b4a79f06 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -804,6 +804,11 @@ export const SETTINGS: {[setting: string]: ISetting} = { default: true, controller: new IncompatibleController("feature_breadcrumbs_v2", true), }, + "FTUE.userOnboardingButton": { + supportedLevels: LEVELS_ACCOUNT_SETTINGS, + displayName: _td("Show shortcut to welcome page above the room list"), + default: true, + }, "showHiddenEventsInTimeline": { displayName: _td("Show hidden events in timeline"), supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS, From 3ebd0ef665e9f94a5496d15f6e1e384d781edbbf Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Mon, 1 Aug 2022 11:19:46 +0200 Subject: [PATCH 2/8] Fix copyright header --- .../user-onboarding/_UserOnboardingButton.pcss | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/res/css/views/user-onboarding/_UserOnboardingButton.pcss b/res/css/views/user-onboarding/_UserOnboardingButton.pcss index 40516b0f2bb..3eba86045ac 100644 --- a/res/css/views/user-onboarding/_UserOnboardingButton.pcss +++ b/res/css/views/user-onboarding/_UserOnboardingButton.pcss @@ -1,3 +1,19 @@ +/* +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_UserOnboardingButton { display: flex; flex-direction: column; From c601dcecf6a0efd2d706e93d2afc98c45c02d209 Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Mon, 1 Aug 2022 11:43:10 +0200 Subject: [PATCH 3/8] Add analytics events --- .../views/user-onboarding/UserOnboardingButton.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/views/user-onboarding/UserOnboardingButton.tsx b/src/components/views/user-onboarding/UserOnboardingButton.tsx index 436e034ed2e..567ed9591c5 100644 --- a/src/components/views/user-onboarding/UserOnboardingButton.tsx +++ b/src/components/views/user-onboarding/UserOnboardingButton.tsx @@ -22,10 +22,11 @@ import defaultDispatcher from "../../../dispatcher/dispatcher"; import { useSettingValue } from "../../../hooks/useSettings"; import { useUserOnboardingTasks } from "../../../hooks/useUserOnboardingTasks"; import { _t } from "../../../languageHandler"; +import PosthogTrackers from "../../../PosthogTrackers"; import { UseCase } from "../../../settings/enums/UseCase"; import { SettingLevel } from "../../../settings/SettingLevel"; import SettingsStore from "../../../settings/SettingsStore"; -import AccessibleButton from "../../views/elements/AccessibleButton"; +import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; import ProgressBar from "../../views/elements/ProgressBar"; import Heading from "../../views/typography/Heading"; import { showUserOnboardingPage } from "./UserOnboardingPage"; @@ -48,10 +49,16 @@ export function UserOnboardingButton({ selected, minimized }: Props) { const progress = waiting ? completed / total : 1; - const onDismiss = useCallback(() => { + const onDismiss = useCallback((ev: ButtonEvent) => { + PosthogTrackers.trackInteraction("WebRoomListUserOnboardingIgnoreButton", ev); SettingsStore.setValue("FTUE.userOnboardingButton", null, SettingLevel.ACCOUNT, false); }, []); + const onClick = useCallback((ev: ButtonEvent) => { + PosthogTrackers.trackInteraction("WebRoomListUserOnboardingButton", ev); + defaultDispatcher.fire(Action.ViewHomePage); + }, []); + const useCase = useSettingValue("FTUE.useCaseSelection"); const visible = useSettingValue("FTUE.userOnboardingButton"); if (!visible || minimized || !showUserOnboardingPage(useCase)) { @@ -65,7 +72,7 @@ export function UserOnboardingButton({ selected, minimized }: Props) { "mx_UserOnboardingButton_minimized": minimized, "mx_UserOnboardingButton_completed": !waiting, })} - onClick={() => defaultDispatcher.fire(Action.ViewHomePage)}> + onClick={onClick}> { !minimized && ( <>
From 79dc46f7a300320362f56e05888613ba31442364 Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Tue, 2 Aug 2022 16:56:01 +0200 Subject: [PATCH 4/8] Handle network failures more gracefully --- .../user-onboarding/UserOnboardingButton.tsx | 13 +++++--- .../user-onboarding/UserOnboardingPage.tsx | 4 ++- src/hooks/useUserOnboardingContext.ts | 32 +++++++++++-------- src/hooks/useUserOnboardingTasks.ts | 7 ++-- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/components/views/user-onboarding/UserOnboardingButton.tsx b/src/components/views/user-onboarding/UserOnboardingButton.tsx index 567ed9591c5..26904829e85 100644 --- a/src/components/views/user-onboarding/UserOnboardingButton.tsx +++ b/src/components/views/user-onboarding/UserOnboardingButton.tsx @@ -20,6 +20,7 @@ import React, { useCallback } from "react"; import { Action } from "../../../dispatcher/actions"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import { useSettingValue } from "../../../hooks/useSettings"; +import { useUserOnboardingContext } from "../../../hooks/useUserOnboardingContext"; import { useUserOnboardingTasks } from "../../../hooks/useUserOnboardingTasks"; import { _t } from "../../../languageHandler"; import PosthogTrackers from "../../../PosthogTrackers"; @@ -41,13 +42,17 @@ interface Props { } export function UserOnboardingButton({ selected, minimized }: Props) { - const [completedTasks, waitingTasks] = useUserOnboardingTasks(); + const context = useUserOnboardingContext(); + const [completedTasks, waitingTasks] = useUserOnboardingTasks(context); const completed = completedTasks.length; const waiting = waitingTasks.length; const total = completed + waiting; - const progress = waiting ? completed / total : 1; + let progress = 1; + if (context && waiting) { + progress = completed / total; + } const onDismiss = useCallback((ev: ButtonEvent) => { PosthogTrackers.trackInteraction("WebRoomListUserOnboardingIgnoreButton", ev); @@ -70,7 +75,7 @@ export function UserOnboardingButton({ selected, minimized }: Props) { className={classNames("mx_UserOnboardingButton", { "mx_UserOnboardingButton_selected": selected, "mx_UserOnboardingButton_minimized": minimized, - "mx_UserOnboardingButton_completed": !waiting, + "mx_UserOnboardingButton_completed": !waiting || !context, })} onClick={onClick}> { !minimized && ( @@ -79,7 +84,7 @@ export function UserOnboardingButton({ selected, minimized }: Props) { { _t("Welcome") } - { !completed && ( + { context && !completed && (
{ toPercentage(progress) }%
diff --git a/src/components/views/user-onboarding/UserOnboardingPage.tsx b/src/components/views/user-onboarding/UserOnboardingPage.tsx index 7ca13232986..cc90a3d09d5 100644 --- a/src/components/views/user-onboarding/UserOnboardingPage.tsx +++ b/src/components/views/user-onboarding/UserOnboardingPage.tsx @@ -19,6 +19,7 @@ import * as React from "react"; import { useInitialSyncComplete } from "../../../hooks/useIsInitialSyncComplete"; import { useSettingValue } from "../../../hooks/useSettings"; +import { useUserOnboardingContext } from "../../../hooks/useUserOnboardingContext"; import { useUserOnboardingTasks } from "../../../hooks/useUserOnboardingTasks"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import SdkConfig from "../../../SdkConfig"; @@ -47,7 +48,8 @@ export function UserOnboardingPage({ justRegistered = false }: Props) { const pageUrl = getHomePageUrl(config); const useCase = useSettingValue("FTUE.useCaseSelection"); - const [completedTasks, waitingTasks] = useUserOnboardingTasks(); + const context = useUserOnboardingContext(); + const [completedTasks, waitingTasks] = useUserOnboardingTasks(context); const initialSyncComplete = useInitialSyncComplete(); const [showList, setShowList] = useState(false); diff --git a/src/hooks/useUserOnboardingContext.ts b/src/hooks/useUserOnboardingContext.ts index 8b1d6bcfb4f..d1f45217f81 100644 --- a/src/hooks/useUserOnboardingContext.ts +++ b/src/hooks/useUserOnboardingContext.ts @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { useCallback, useEffect, useState } from "react"; +import { logger } from "matrix-js-sdk/src/logger"; import { ClientEvent, IMyDevice, Room } from "matrix-js-sdk/src/matrix"; +import { useCallback, useEffect, useState } from "react"; import { MatrixClientPeg } from "../MatrixClientPeg"; import DMRoomMap from "../utils/DMRoomMap"; @@ -33,18 +34,23 @@ export function useUserOnboardingContext(): UserOnboardingContext | null { const cli = MatrixClientPeg.get(); const handler = useCallback(async () => { - const profile = await cli.getProfileInfo(cli.getUserId()); - - const myDevice = cli.getDeviceId(); - const devices = await cli.getDevices(); - - const dmRooms = DMRoomMap.shared().getUniqueRoomsWithIndividuals() ?? {}; - setContext({ - avatar: profile?.avatar_url ?? null, - myDevice, - devices: devices.devices, - dmRooms: dmRooms, - }); + try { + const profile = await cli.getProfileInfo(cli.getUserId()); + + const myDevice = cli.getDeviceId(); + const devices = await cli.getDevices(); + + const dmRooms = DMRoomMap.shared().getUniqueRoomsWithIndividuals() ?? {}; + setContext({ + avatar: profile?.avatar_url ?? null, + myDevice, + devices: devices.devices, + dmRooms: dmRooms, + }); + } catch (e) { + logger.warn("Could not load context for user onboarding task list: ", e); + setContext(null); + } }, [cli]); useEventEmitter(cli, ClientEvent.AccountData, handler); diff --git a/src/hooks/useUserOnboardingTasks.ts b/src/hooks/useUserOnboardingTasks.ts index daef154de02..9ac0b5d98b5 100644 --- a/src/hooks/useUserOnboardingTasks.ts +++ b/src/hooks/useUserOnboardingTasks.ts @@ -27,7 +27,7 @@ import { Notifier } from "../Notifier"; import PosthogTrackers from "../PosthogTrackers"; import { UseCase } from "../settings/enums/UseCase"; import { useSettingValue } from "./useSettings"; -import { UserOnboardingContext, useUserOnboardingContext } from "./useUserOnboardingContext"; +import { UserOnboardingContext } from "./useUserOnboardingContext"; export interface UserOnboardingTask { id: string; @@ -140,13 +140,12 @@ const tasks: InternalUserOnboardingTask[] = [ }, ]; -export function useUserOnboardingTasks(): [UserOnboardingTask[], UserOnboardingTask[]] { +export function useUserOnboardingTasks(context: UserOnboardingContext): [UserOnboardingTask[], UserOnboardingTask[]] { const useCase = useSettingValue("FTUE.useCaseSelection") ?? UseCase.Skip; const relevantTasks = useMemo( () => tasks.filter(it => !it.relevant || it.relevant.includes(useCase)), [useCase], ); - const onboardingInfo = useUserOnboardingContext(); - const completedTasks = relevantTasks.filter(it => onboardingInfo && it.completed(onboardingInfo)); + const completedTasks = relevantTasks.filter(it => context && it.completed(context)); return [completedTasks, relevantTasks.filter(it => !completedTasks.includes(it))]; } From b0cc9ed3928e3f663ec0c5679c2ef8ca42ae1b0a Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Tue, 2 Aug 2022 17:20:43 +0200 Subject: [PATCH 5/8] Increase stability of lazy loading test --- cypress/e2e/lazy-loading/lazy-loading.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/lazy-loading/lazy-loading.spec.ts b/cypress/e2e/lazy-loading/lazy-loading.spec.ts index af4d7ef6aec..7d26b48676d 100644 --- a/cypress/e2e/lazy-loading/lazy-loading.spec.ts +++ b/cypress/e2e/lazy-loading/lazy-loading.spec.ts @@ -115,21 +115,21 @@ describe("Lazy Loading", () => { }); } - function getMembersInMemberlist(): Chainable { - return cy.get(".mx_MemberList .mx_EntityTile_name"); + function getMemberInMemberlist(name: string): Chainable { + return cy.contains(".mx_MemberList .mx_EntityTile_name", name); } function checkMemberList(charlies: Charly[]) { - getMembersInMemberlist().contains("Alice").should("exist"); - getMembersInMemberlist().contains("Bob").should("exist"); + getMemberInMemberlist("Alice").should("exist"); + getMemberInMemberlist("Bob").should("exist"); charlies.forEach(charly => { - getMembersInMemberlist().contains(charly.displayName).should("exist"); + getMemberInMemberlist(charly.displayName).should("exist"); }); } function checkMemberListLacksCharlies(charlies: Charly[]) { charlies.forEach(charly => { - getMembersInMemberlist().contains(charly.displayName).should("not.exist"); + getMemberInMemberlist(charly.displayName).should("not.exist"); }); } From 95df0da6c223146fb79c6f8f81d6f312a28303fa Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Thu, 11 Aug 2022 11:11:15 +0200 Subject: [PATCH 6/8] Change setting naming --- src/settings/Settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 5c5ad46a265..9113080cf97 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -799,7 +799,7 @@ export const SETTINGS: {[setting: string]: ISetting} = { }, "FTUE.userOnboardingButton": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, - displayName: _td("Show shortcut to welcome page above the room list"), + displayName: _td("Show shortcut to welcome checklist above the room list"), default: true, }, "showHiddenEventsInTimeline": { From f1b27589fdf27cf3d509a3594e09d651bf00e828 Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Thu, 11 Aug 2022 12:00:36 +0200 Subject: [PATCH 7/8] Update test to work with new virtual composer for DMs changes --- .../user-onboarding/user-onboarding-new.ts | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/user-onboarding/user-onboarding-new.ts b/cypress/e2e/user-onboarding/user-onboarding-new.ts index 287e3e639f1..cef27803edf 100644 --- a/cypress/e2e/user-onboarding/user-onboarding-new.ts +++ b/cypress/e2e/user-onboarding/user-onboarding-new.ts @@ -40,6 +40,13 @@ describe("User Onboarding (new user)", () => { bot1 = _bot1; }); cy.get('.mx_UserOnboardingPage').should('exist'); + cy.get('.mx_UserOnboardingButton').should('exist'); + cy.get('.mx_UserOnboardingList') + .should('exist') + .should(($list) => { + const list = $list.get(0); + expect(getComputedStyle(list).opacity).to.be.eq("1"); + }); }); }); @@ -48,22 +55,13 @@ describe("User Onboarding (new user)", () => { }); it("page is shown and preference exists", () => { - cy.get('.mx_UserOnboardingPage').should('exist'); - cy.get('.mx_UserOnboardingButton').should('exist'); - cy.get('.mx_UserOnboardingList') - .should('exist') - .should(($list) => { - const list = $list.get(0); - expect(getComputedStyle(list).opacity).to.be.eq("1"); - }); cy.get('.mx_UserOnboardingPage') .percySnapshotElement("User onboarding page"); cy.openUserSettings("Preferences"); - cy.contains("Show shortcut to welcome page above the room list").should("exist"); + cy.contains("Show shortcut to welcome checklist above the room list").should("exist"); }); it("app download dialog", () => { - cy.get('.mx_UserOnboardingPage').should('exist'); cy.contains(".mx_UserOnboardingTask_action", "Download apps").click(); cy.get('[role=dialog]') .contains("#mx_BaseDialog_title", "Download Element") @@ -82,8 +80,7 @@ describe("User Onboarding (new user)", () => { 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_SendMessageComposer").type("Hi!{enter}"); cy.get(".mx_ProgressBar").invoke("val").should("be.greaterThan", oldProgress); }); }); From 94175ab31a06498df468cd8f6c480d9fa6a83ad9 Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski Date: Thu, 11 Aug 2022 12:11:02 +0200 Subject: [PATCH 8/8] Updated i18n --- src/i18n/strings/en_EN.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 4f2979ef2aa..98727224b52 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -951,7 +951,7 @@ "Order rooms by name": "Order rooms by name", "Show rooms with unread notifications first": "Show rooms with unread notifications first", "Show shortcuts to recently viewed rooms above the room list": "Show shortcuts to recently viewed rooms above the room list", - "Show shortcut to welcome page above the room list": "Show shortcut to welcome page above the room list", + "Show shortcut to welcome checklist above the room list": "Show shortcut to welcome checklist above the room list", "Show hidden events in timeline": "Show hidden events in timeline", "Low bandwidth mode (requires compatible homeserver)": "Low bandwidth mode (requires compatible homeserver)", "Allow fallback call assist server turn.matrix.org when your homeserver does not offer one (your IP address would be shared during a call)": "Allow fallback call assist server turn.matrix.org when your homeserver does not offer one (your IP address would be shared during a call)",