From 09eefe14eac74fc9c199213d52aa63b0188fc664 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 5 Apr 2023 12:17:25 +0100
Subject: [PATCH] Remove feedback buttons from onboarding, search, and spaces
(#10506)
---
res/css/_components.pcss | 1 -
res/css/structures/_SpaceRoomView.pcss | 14 -----
res/css/views/dialogs/_SpotlightDialog.pcss | 20 -------
res/css/views/spaces/_SpaceCreateMenu.pcss | 25 --------
.../_UserOnboardingFeedback.pcss | 41 -------------
.../user-onboarding/_UserOnboardingList.pcss | 4 --
src/components/structures/SpaceRoomView.tsx | 2 -
src/components/structures/UserMenu.tsx | 3 +-
.../dialogs/spotlight/SpotlightDialog.tsx | 31 ----------
.../views/spaces/SpaceCreateMenu.tsx | 41 -------------
.../UserOnboardingFeedback.tsx | 59 -------------------
.../user-onboarding/UserOnboardingList.tsx | 2 -
src/i18n/strings/en_EN.json | 9 +--
.../views/dialogs/SpotlightDialog-test.tsx | 23 --------
.../UserOnboardingList-test.tsx | 34 +----------
15 files changed, 4 insertions(+), 305 deletions(-)
delete mode 100644 res/css/views/user-onboarding/_UserOnboardingFeedback.pcss
delete mode 100644 src/components/views/user-onboarding/UserOnboardingFeedback.tsx
diff --git a/res/css/_components.pcss b/res/css/_components.pcss
index a7c7a54cfd..2b0cf70b9c 100644
--- a/res/css/_components.pcss
+++ b/res/css/_components.pcss
@@ -365,7 +365,6 @@
@import "./views/toasts/_NonUrgentEchoFailureToast.pcss";
@import "./views/typography/_Heading.pcss";
@import "./views/user-onboarding/_UserOnboardingButton.pcss";
-@import "./views/user-onboarding/_UserOnboardingFeedback.pcss";
@import "./views/user-onboarding/_UserOnboardingHeader.pcss";
@import "./views/user-onboarding/_UserOnboardingList.pcss";
@import "./views/user-onboarding/_UserOnboardingPage.pcss";
diff --git a/res/css/structures/_SpaceRoomView.pcss b/res/css/structures/_SpaceRoomView.pcss
index 633c94dfa3..433febae48 100644
--- a/res/css/structures/_SpaceRoomView.pcss
+++ b/res/css/structures/_SpaceRoomView.pcss
@@ -96,10 +96,6 @@ $SpaceRoomViewInnerWidth: 428px;
}
}
- &:not(.mx_SpaceRoomView_landing) .mx_SpaceFeedbackPrompt {
- width: $SpaceRoomViewInnerWidth;
- }
-
.mx_SpaceRoomView_buttons {
display: block;
margin-top: 44px;
@@ -153,16 +149,6 @@ $SpaceRoomViewInnerWidth: 428px;
border-radius: 12px;
}
}
-
- /* XXX: Temporary for the Spaces release only */
- .mx_SpaceFeedbackPrompt {
- padding: 7px; /* 8px - 1px border */
- border: 1px solid rgba($primary-content, 0.1);
- border-radius: 8px;
- width: max-content;
- height: fit-content;
- margin-left: 24px;
- }
}
.mx_SpaceRoomView_landing_name {
diff --git a/res/css/views/dialogs/_SpotlightDialog.pcss b/res/css/views/dialogs/_SpotlightDialog.pcss
index c1a78b7784..b9fa634825 100644
--- a/res/css/views/dialogs/_SpotlightDialog.pcss
+++ b/res/css/views/dialogs/_SpotlightDialog.pcss
@@ -511,24 +511,4 @@ limitations under the License.
}
}
}
-
- .mx_SpotlightDialog_footer {
- font-size: $font-12px;
- line-height: $font-15px;
- color: $secondary-content;
- padding: $spacing-12 $spacing-16 $spacing-16;
- display: flex;
- border-top: 1px solid $quinary-content;
-
- > span {
- align-self: center;
- }
-
- .mx_AccessibleButton_kind_primary_outline {
- padding: $spacing-4 $spacing-8;
- border-color: $secondary-content;
- color: $secondary-content;
- margin-left: auto;
- }
- }
}
diff --git a/res/css/views/spaces/_SpaceCreateMenu.pcss b/res/css/views/spaces/_SpaceCreateMenu.pcss
index 9bb95de2b6..972c7461f3 100644
--- a/res/css/views/spaces/_SpaceCreateMenu.pcss
+++ b/res/css/views/spaces/_SpaceCreateMenu.pcss
@@ -42,13 +42,6 @@ $spacePanelWidth: 68px;
font-size: $font-15px;
color: $secondary-content;
}
-
- /* XXX: Temporary for the Spaces release only */
- .mx_SpaceFeedbackPrompt {
- border-top: 1px solid $input-border-color;
- padding-top: 12px;
- margin-top: 16px;
- }
}
.mx_SpaceCreateMenuType {
@@ -100,21 +93,3 @@ $spacePanelWidth: 68px;
}
}
}
-
-.mx_SpaceFeedbackPrompt {
- font-size: $font-15px;
- line-height: $font-24px;
-
- > span {
- color: $secondary-content;
- position: relative;
- font-size: inherit;
- line-height: inherit;
- margin-right: 8px;
- }
-
- .mx_AccessibleButton_kind_link {
- color: $accent;
- position: relative;
- }
-}
diff --git a/res/css/views/user-onboarding/_UserOnboardingFeedback.pcss b/res/css/views/user-onboarding/_UserOnboardingFeedback.pcss
deleted file mode 100644
index 92aaac2cbd..0000000000
--- a/res/css/views/user-onboarding/_UserOnboardingFeedback.pcss
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-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_UserOnboardingFeedback {
- display: flex;
- flex-direction: row;
- padding: $spacing-32;
- border-radius: 8px;
- background: $system;
- gap: $spacing-64;
-
- .mx_UserOnboardingFeedback_content {
- display: flex;
- flex-direction: column;
- margin-right: auto;
- gap: 6px;
-
- .mx_UserOnboardingFeedback_text {
- color: $secondary-content;
- }
- }
-
- .mx_UserOnboardingFeedback_action.mx_AccessibleButton {
- background: transparent;
- min-width: 180px;
- align-self: center;
- }
-}
diff --git a/res/css/views/user-onboarding/_UserOnboardingList.pcss b/res/css/views/user-onboarding/_UserOnboardingList.pcss
index bcaf713ad3..f00906888a 100644
--- a/res/css/views/user-onboarding/_UserOnboardingList.pcss
+++ b/res/css/views/user-onboarding/_UserOnboardingList.pcss
@@ -48,10 +48,6 @@ limitations under the License.
@mixin ProgressBarBorderRadius 16px;
}
-
- .mx_UserOnboardingFeedback {
- margin-top: $spacing-16;
- }
}
.mx_UserOnboardingList_list {
diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx
index 6389b113c4..b8b020f039 100644
--- a/src/components/structures/SpaceRoomView.tsx
+++ b/src/components/structures/SpaceRoomView.tsx
@@ -71,7 +71,6 @@ import RoomTopic from "../views/elements/RoomTopic";
import withValidation from "../views/elements/Validation";
import RoomInfoLine from "../views/rooms/RoomInfoLine";
import RoomPreviewCard from "../views/rooms/RoomPreviewCard";
-import { SpaceFeedbackPrompt } from "../views/spaces/SpaceCreateMenu";
import SpacePublicShare from "../views/spaces/SpacePublicShare";
import { ChevronFace, ContextMenuButton, useContextMenu } from "./ContextMenu";
import MainSplit from "./MainSplit";
@@ -269,7 +268,6 @@ const SpaceLanding: React.FC<{ space: Room }> = ({ space }) => {
-
diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx
index 0f9569d6bf..5d2ba897ba 100644
--- a/src/components/structures/UserMenu.tsx
+++ b/src/components/structures/UserMenu.tsx
@@ -51,6 +51,7 @@ import { ViewHomePagePayload } from "../../dispatcher/payloads/ViewHomePagePaylo
import { Icon as LiveIcon } from "../../../res/img/compound/live-8px.svg";
import { VoiceBroadcastRecording, VoiceBroadcastRecordingsStoreEvent } from "../../voice-broadcast";
import { SDKContext } from "../../contexts/SDKContext";
+import { shouldShowFeedback } from "../../utils/Feedback";
interface IProps {
isPanelCollapsed: boolean;
@@ -333,7 +334,7 @@ export default class UserMenu extends React.Component {
}
let feedbackButton: JSX.Element | undefined;
- if (SettingsStore.getValue(UIFeature.Feedback)) {
+ if (shouldShowFeedback()) {
feedbackButton = (
= ({ initialText = "", initialFilter = n
}
};
- const openFeedback = shouldShowFeedback()
- ? () => {
- Modal.createDialog(FeedbackDialog, {
- feature: "spotlight",
- });
- }
- : null;
-
const activeDescendant = rovingContext.state.activeRef?.current?.id;
return (
@@ -1242,26 +1231,6 @@ const SpotlightDialog: React.FC = ({ initialText = "", initialFilter = n
>
{content}
-
-
- {openFeedback &&
- _t(
- "Results not as expected? Please
give feedback.",
- {},
- {
- a: (sub) => (
-
- {sub}
-
- ),
- },
- )}
- {openFeedback && (
-
- {_t("Feedback")}
-
- )}
-
>
);
diff --git a/src/components/views/spaces/SpaceCreateMenu.tsx b/src/components/views/spaces/SpaceCreateMenu.tsx
index fca2ce706d..344067203d 100644
--- a/src/components/views/spaces/SpaceCreateMenu.tsx
+++ b/src/components/views/spaces/SpaceCreateMenu.tsx
@@ -41,14 +41,9 @@ import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton";
import Field from "../elements/Field";
import withValidation from "../elements/Validation";
import RoomAliasField from "../elements/RoomAliasField";
-import Modal from "../../../Modal";
-import GenericFeatureFeedbackDialog from "../dialogs/GenericFeatureFeedbackDialog";
-import SettingsStore from "../../../settings/SettingsStore";
import { getKeyBindingsManager } from "../../../KeyBindingsManager";
import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts";
import { MatrixClientPeg } from "../../../MatrixClientPeg";
-import { shouldShowFeedback } from "../../../utils/Feedback";
-
export const createSpace = async (
name: string,
isPublic: boolean,
@@ -118,40 +113,6 @@ const nameToLocalpart = (name: string): string => {
.replace(/[^a-z0-9_-]+/gi, "");
};
-// XXX: Temporary for the Spaces release only
-export const SpaceFeedbackPrompt: React.FC<{
- onClick?(): void;
-}> = ({ onClick }) => {
- if (!shouldShowFeedback()) return null;
-
- return (
-
-
{_t("Spaces are a new feature.")}
-
{
- if (onClick) onClick();
- Modal.createDialog(GenericFeatureFeedbackDialog, {
- title: _t("Spaces feedback"),
- subheading: _t(
- "Thank you for trying Spaces. " + "Your feedback will help inform the next versions.",
- ),
- rageshakeLabel: "spaces-feedback",
- rageshakeData: Object.fromEntries(
- ["Spaces.allRoomsInHome", "Spaces.enabledMetaSpaces"].map((k) => [
- k,
- SettingsStore.getValue(k),
- ]),
- ),
- });
- }}
- >
- {_t("Give feedback.")}
-
-
- );
-};
-
type BProps = Omit
, "nameDisabled" | "topicDisabled" | "avatarDisabled">;
interface ISpaceCreateFormProps extends BProps {
busy: boolean;
@@ -316,8 +277,6 @@ const SpaceCreateMenu: React.FC<{
/>
{_t("To join a space you'll need an invite.")}
-
-
);
} else {
diff --git a/src/components/views/user-onboarding/UserOnboardingFeedback.tsx b/src/components/views/user-onboarding/UserOnboardingFeedback.tsx
deleted file mode 100644
index ee827e2603..0000000000
--- a/src/components/views/user-onboarding/UserOnboardingFeedback.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-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 React from "react";
-
-import { _t } from "../../../languageHandler";
-import Modal from "../../../Modal";
-import SdkConfig from "../../../SdkConfig";
-import AccessibleButton from "../../views/elements/AccessibleButton";
-import Heading from "../../views/typography/Heading";
-import FeedbackDialog from "../dialogs/FeedbackDialog";
-import { shouldShowFeedback } from "../../../utils/Feedback";
-
-export function UserOnboardingFeedback(): JSX.Element {
- if (!shouldShowFeedback()) {
- return <>>;
- }
-
- return (
-
-
-
- {_t("How are you finding %(brand)s so far?", {
- brand: SdkConfig.get("brand"),
- })}
-
-
- {_t("We’d appreciate any feedback on how you’re finding %(brand)s.", {
- brand: SdkConfig.get("brand"),
- })}
-
-
-
{
- Modal.createDialog(FeedbackDialog, {
- feature: "use-case-selection",
- });
- }}
- >
- {_t("Feedback")}
-
-
- );
-}
diff --git a/src/components/views/user-onboarding/UserOnboardingList.tsx b/src/components/views/user-onboarding/UserOnboardingList.tsx
index 1bee17ae88..6c7688f7e3 100644
--- a/src/components/views/user-onboarding/UserOnboardingList.tsx
+++ b/src/components/views/user-onboarding/UserOnboardingList.tsx
@@ -21,7 +21,6 @@ import { _t } from "../../../languageHandler";
import SdkConfig from "../../../SdkConfig";
import ProgressBar from "../../views/elements/ProgressBar";
import Heading from "../../views/typography/Heading";
-import { UserOnboardingFeedback } from "./UserOnboardingFeedback";
import { UserOnboardingTask } from "./UserOnboardingTask";
export const getUserOnboardingCounters = (
@@ -66,7 +65,6 @@ export function UserOnboardingList({ tasks }: Props): JSX.Element {
{tasks.map((task) => (
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 12d6924357..dbf812d79a 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -1238,9 +1238,6 @@
"Headphones": "Headphones",
"Folder": "Folder",
"Welcome": "Welcome",
- "How are you finding %(brand)s so far?": "How are you finding %(brand)s so far?",
- "We’d appreciate any feedback on how you’re finding %(brand)s.": "We’d appreciate any feedback on how you’re finding %(brand)s.",
- "Feedback": "Feedback",
"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",
@@ -1278,10 +1275,6 @@
"No results": "No results",
"Search %(spaceName)s": "Search %(spaceName)s",
"Please enter a name for the space": "Please enter a name for the space",
- "Spaces are a new feature.": "Spaces are a new feature.",
- "Spaces feedback": "Spaces feedback",
- "Thank you for trying Spaces. Your feedback will help inform the next versions.": "Thank you for trying Spaces. Your feedback will help inform the next versions.",
- "Give feedback.": "Give feedback.",
"e.g. my-space": "e.g. my-space",
"Address": "Address",
"Create a space": "Create a space",
@@ -2846,6 +2839,7 @@
"Feedback sent": "Feedback sent",
"Comment": "Comment",
"Your platform and username will be noted to help us use your feedback as much as we can.": "Your platform and username will be noted to help us use your feedback as much as we can.",
+ "Feedback": "Feedback",
"You may contact me if you want to follow up or to let me test out upcoming ideas": "You may contact me if you want to follow up or to let me test out upcoming ideas",
"PRO TIP: If you start a bug, please submit debug logs to help us track down the problem.": "PRO TIP: If you start a bug, please submit debug logs to help us track down the problem.",
"Report a bug": "Report a bug",
@@ -3123,7 +3117,6 @@
"Use to scroll": "Use to scroll",
"Search Dialog": "Search Dialog",
"Remove search filter for %(filter)s": "Remove search filter for %(filter)s",
- "Results not as expected? Please give feedback.": "Results not as expected? Please give feedback.",
"Wrong file type": "Wrong file type",
"Looks good!": "Looks good!",
"Wrong Security Key": "Wrong Security Key",
diff --git a/test/components/views/dialogs/SpotlightDialog-test.tsx b/test/components/views/dialogs/SpotlightDialog-test.tsx
index 8e15ed390d..2cc95324ff 100644
--- a/test/components/views/dialogs/SpotlightDialog-test.tsx
+++ b/test/components/views/dialogs/SpotlightDialog-test.tsx
@@ -26,7 +26,6 @@ import { LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../../../src/models/LocalRoo
import { DirectoryMember, startDmOnFirstMessage } from "../../../../src/utils/direct-messages";
import DMRoomMap from "../../../../src/utils/DMRoomMap";
import { flushPromisesWithFakeTimers, mkRoom, stubClient } from "../../../test-utils";
-import { shouldShowFeedback } from "../../../../src/utils/Feedback";
import SettingsStore from "../../../../src/settings/SettingsStore";
import { SettingLevel } from "../../../../src/settings/SettingLevel";
import defaultDispatcher from "../../../../src/dispatcher/dispatcher";
@@ -387,28 +386,6 @@ describe("Spotlight Dialog", () => {
);
});
- describe("Feedback prompt", () => {
- it("should show feedback prompt if feedback is enabled", async () => {
- mocked(shouldShowFeedback).mockReturnValue(true);
-
- render( null} />);
- jest.advanceTimersByTime(200);
- await flushPromisesWithFakeTimers();
-
- expect(screen.getByText("give feedback")).toBeInTheDocument();
- });
-
- it("should hide feedback prompt if feedback is disabled", async () => {
- mocked(shouldShowFeedback).mockReturnValue(false);
-
- render( null} />);
- jest.advanceTimersByTime(200);
- await flushPromisesWithFakeTimers();
-
- expect(screen.queryByText("give feedback")).not.toBeInTheDocument();
- });
- });
-
describe("nsfw public rooms filter", () => {
const nsfwNameRoom: IPublicRoomsChunkRoom = {
room_id: "@room1:matrix.org",
diff --git a/test/components/views/user-onboarding/UserOnboardingList-test.tsx b/test/components/views/user-onboarding/UserOnboardingList-test.tsx
index 4c63b391eb..bfd0579470 100644
--- a/test/components/views/user-onboarding/UserOnboardingList-test.tsx
+++ b/test/components/views/user-onboarding/UserOnboardingList-test.tsx
@@ -14,14 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-import React from "react";
-import { screen, render } from "@testing-library/react";
-
-import {
- getUserOnboardingCounters,
- UserOnboardingList,
-} from "../../../../src/components/views/user-onboarding/UserOnboardingList";
-import SdkConfig from "../../../../src/SdkConfig";
+import { getUserOnboardingCounters } from "../../../../src/components/views/user-onboarding/UserOnboardingList";
const tasks = [
{
@@ -61,28 +54,3 @@ describe("getUserOnboardingCounters()", () => {
expect(result).toStrictEqual(expectation);
});
});
-
-describe("UserOnboardingList", () => {
- // This configuration affects rendering of the feedback and needs to be set.
- beforeAll(() => {
- SdkConfig.put({
- bug_report_endpoint_url: "https://bug_report_endpoint_url.com",
- });
- });
-
- it("should not display feedback when there are waiting tasks", async () => {
- render();
-
- expect(await screen.findByText("Only 1 step to go")).toBeVisible();
- expect(await screen.queryByTestId("user-onboarding-feedback")).toBeNull();
- expect(await screen.findAllByTestId("user-onboarding-task")).toHaveLength(2);
- });
-
- it("should display feedback when all tasks are completed", async () => {
- render( ({ ...task, completed: true }))} />);
-
- expect(await screen.findByText("You did it!")).toBeVisible();
- expect(await screen.findByTestId("user-onboarding-feedback")).toBeInTheDocument();
- expect(await screen.queryAllByTestId("user-onboarding-task")).toHaveLength(2);
- });
-});