Move new search experience to a Beta (#7718)

This commit is contained in:
Michael Telatynski 2022-02-08 14:02:36 +00:00 committed by GitHub
parent 5201c9b285
commit ed185240a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 329 additions and 116 deletions

View file

@ -16,9 +16,9 @@ limitations under the License.
*/
import { MatrixClient } from 'matrix-js-sdk/src/client';
import { ReactNode } from "react";
import React, { ReactNode } from "react";
import { _td } from '../languageHandler';
import { _t, _td } from '../languageHandler';
import {
NotificationBodyEnabledController,
NotificationsEnabledController,
@ -41,6 +41,7 @@ import ReducedMotionController from './controllers/ReducedMotionController';
import IncompatibleController from "./controllers/IncompatibleController";
import { ImageSize } from "./enums/ImageSize";
import { MetaSpace } from "../stores/spaces";
import SdkConfig from "../SdkConfig";
// These are just a bunch of helper arrays to avoid copy/pasting a bunch of times
const LEVELS_ROOM_SETTINGS = [
@ -155,12 +156,13 @@ interface IBaseSetting {
// XXX: Keep this around for re-use in future Betas
betaInfo?: {
title: string; // _td
caption: string; // _td
caption: () => ReactNode;
disclaimer?: (enabled: boolean) => ReactNode;
image: string; // require(...)
feedbackSubheading?: string;
feedbackLabel?: string;
extraSettings?: string[];
requiresRefresh?: boolean;
};
}
@ -336,8 +338,27 @@ export const SETTINGS: {[setting: string]: ISetting} = {
isFeature: true,
labsGroup: LabGroup.Rooms,
supportedLevels: LEVELS_FEATURE,
displayName: _td("New spotlight search experience"),
displayName: _td("New search experience"),
default: false,
betaInfo: {
title: _td("The new search"),
caption: () => <>
<p>{ _t("A new, quick way to search spaces and rooms you're in.") }</p>
<p>{ _t("This feature is a work in progress, we'd love to hear your feedback.") }</p>
</>,
disclaimer: () => <>
{ SdkConfig.get().bug_report_endpoint_url && <>
<h4>{ _t("How can I give feedback?") }</h4>
<p>{ _t("To feedback, join the beta, start a search and click on feedback.") }</p>
</> }
<h4>{ _t("How can I leave the beta?") }</h4>
<p>{ _t("To leave, just return to this page or click on the beta badge when you search.") }</p>
</>,
feedbackLabel: "spotlight-feedback",
feedbackSubheading: _td("Thank you for trying the beta, " +
"please go into as much detail as you can so we can improve it."),
image: require("../../res/img/betas/new_search_experience.gif"),
},
},
"feature_right_panel_default_open": {
isFeature: true,