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

Commit 8b84195

Browse files
authored
Move New Search Experience out of beta (#8859)
1 parent e1d6356 commit 8b84195

File tree

11 files changed

+18
-386
lines changed

11 files changed

+18
-386
lines changed

cypress/integration/12-spotlight/spotlight.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ describe("Spotlight", () => {
125125
let room2Id: string;
126126

127127
beforeEach(() => {
128-
cy.enableLabsFeature("feature_spotlight");
129128
cy.startSynapse("default").then(data => {
130129
synapse = data;
131130
cy.initTestUser(synapse, "Jim").then(() =>

res/css/structures/_RoomSearch.scss

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -38,64 +38,11 @@ limitations under the License.
3838
margin-bottom: 2px;
3939
}
4040

41-
.mx_RoomSearch_input {
42-
border: none !important; // !important to override default app-wide styles
43-
flex: 1 !important; // !important to override default app-wide styles
44-
color: $primary-content !important; // !important to override default app-wide styles
45-
padding: 0;
46-
height: 100%;
47-
width: 100%;
48-
49-
&:not(.mx_RoomSearch_inputExpanded)::placeholder {
50-
color: $tertiary-content !important; // !important to override default app-wide styles
51-
}
52-
}
53-
54-
.mx_RoomSearch_input,
5541
.mx_RoomSearch_spotlightTriggerText {
5642
font-size: $font-12px;
5743
line-height: $font-16px;
5844
}
5945

60-
&.mx_RoomSearch_hasQuery {
61-
border-color: $secondary-content;
62-
}
63-
64-
&.mx_RoomSearch_focused {
65-
box-shadow: 0 0 4px 4px rgba(0, 132, 255, 0.5);
66-
border-color: transparent;
67-
}
68-
69-
&.mx_RoomSearch_focused, &.mx_RoomSearch_hasQuery {
70-
background-color: $background;
71-
72-
.mx_RoomSearch_clearButton {
73-
width: 16px;
74-
height: 16px;
75-
margin-right: 8px;
76-
background-color: $quinary-content;
77-
border-radius: 50%;
78-
position: relative;
79-
80-
&::before {
81-
content: "";
82-
position: absolute;
83-
width: inherit;
84-
height: inherit;
85-
mask-image: url('$(res)/img/feather-customised/x.svg');
86-
mask-position: center;
87-
mask-size: 12px;
88-
mask-repeat: no-repeat;
89-
background-color: $secondary-content;
90-
}
91-
}
92-
}
93-
94-
.mx_RoomSearch_clearButton {
95-
width: 0;
96-
height: 0;
97-
}
98-
9946
&.mx_RoomSearch_minimized {
10047
height: 32px;
10148
min-height: 32px;

res/css/views/dialogs/_SpotlightDialog.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,6 @@ limitations under the License.
465465
display: flex;
466466
border-top: 1px solid $quinary-content;
467467

468-
.mx_BetaCard_betaPill {
469-
margin-right: 12px;
470-
height: min-content;
471-
align-self: center;
472-
}
473-
474468
> span {
475469
align-self: center;
476470

-887 KB
Binary file not shown.

src/accessibility/KeyboardShortcuts.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ limitations under the License.
1818
import { _td } from "../languageHandler";
1919
import { IS_MAC, Key } from "../Keyboard";
2020
import { IBaseSetting } from "../settings/Settings";
21-
import IncompatibleController from "../settings/controllers/IncompatibleController";
2221
import { KeyCombo } from "../KeyBindingsManager";
2322

2423
export enum KeyBindingAction {
@@ -485,13 +484,6 @@ export const KEYBOARD_SHORTCUTS: IKeyboardShortcuts = {
485484
},
486485
displayName: _td("Expand room list section"),
487486
},
488-
[KeyBindingAction.ClearRoomFilter]: {
489-
default: {
490-
key: Key.ESCAPE,
491-
},
492-
displayName: _td("Clear room list filter field"),
493-
controller: new IncompatibleController("feature_spotlight", { key: null }),
494-
},
495487
[KeyBindingAction.NextRoom]: {
496488
default: {
497489
key: Key.ARROW_DOWN,

src/components/structures/LeftPanel.tsx

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import SpaceStore from "../../stores/spaces/SpaceStore";
3131
import { MetaSpace, SpaceKey, UPDATE_SELECTED_SPACE } from "../../stores/spaces";
3232
import { getKeyBindingsManager } from "../../KeyBindingsManager";
3333
import UIStore from "../../stores/UIStore";
34-
import { findSiblingElement, IState as IRovingTabIndexState } from "../../accessibility/RovingTabIndex";
34+
import { IState as IRovingTabIndexState } from "../../accessibility/RovingTabIndex";
3535
import RoomListHeader from "../views/rooms/RoomListHeader";
3636
import RecentlyViewedButton from "../views/rooms/RecentlyViewedButton";
3737
import { BreadcrumbsStore } from "../../stores/BreadcrumbsStore";
@@ -64,7 +64,6 @@ interface IState {
6464

6565
export default class LeftPanel extends React.Component<IProps, IState> {
6666
private listContainerRef = createRef<HTMLDivElement>();
67-
private roomSearchRef = createRef<RoomSearch>();
6867
private roomListRef = createRef<RoomList>();
6968
private focusedElement = null;
7069
private isDoingStickyHeaders = false;
@@ -302,32 +301,6 @@ export default class LeftPanel extends React.Component<IProps, IState> {
302301
this.roomListRef.current?.focus();
303302
}
304303
break;
305-
306-
case KeyBindingAction.PrevRoom:
307-
if (state && state.activeRef === findSiblingElement(state.refs, 0)) {
308-
ev.stopPropagation();
309-
ev.preventDefault();
310-
this.roomSearchRef.current?.focus();
311-
}
312-
break;
313-
}
314-
};
315-
316-
private onRoomListKeydown = (ev: React.KeyboardEvent) => {
317-
if (ev.altKey || ev.ctrlKey || ev.metaKey) return;
318-
if (SettingsStore.getValue("feature_spotlight")) return;
319-
320-
const action = getKeyBindingsManager().getAccessibilityAction(ev);
321-
322-
// we cannot handle Space as that is an activation key for all focusable elements in this widget
323-
if (ev.key.length === 1) {
324-
ev.preventDefault();
325-
ev.stopPropagation();
326-
this.roomSearchRef.current?.appendChar(ev.key);
327-
} else if (action === KeyBindingAction.Backspace) {
328-
ev.preventDefault();
329-
ev.stopPropagation();
330-
this.roomSearchRef.current?.backspace();
331304
}
332305
};
333306

@@ -386,7 +359,6 @@ export default class LeftPanel extends React.Component<IProps, IState> {
386359
>
387360
<RoomSearch
388361
isMinimized={this.props.isMinimized}
389-
ref={this.roomSearchRef}
390362
onSelectRoom={this.selectRoom}
391363
/>
392364

@@ -436,7 +408,6 @@ export default class LeftPanel extends React.Component<IProps, IState> {
436408
// Firefox sometimes makes this element focusable due to
437409
// overflow:scroll;, so force it out of tab order.
438410
tabIndex={-1}
439-
onKeyDown={this.onRoomListKeydown}
440411
>
441412
{ roomList }
442413
</div>

src/components/structures/MatrixChat.tsx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ import SecurityCustomisations from "../../customisations/Security";
9393
import Spinner from "../views/elements/Spinner";
9494
import QuestionDialog from "../views/dialogs/QuestionDialog";
9595
import UserSettingsDialog from '../views/dialogs/UserSettingsDialog';
96-
import { UserTab } from "../views/dialogs/UserTab";
9796
import CreateRoomDialog from '../views/dialogs/CreateRoomDialog';
9897
import RoomDirectory from './RoomDirectory';
9998
import KeySignatureUploadFailedDialog from "../views/dialogs/KeySignatureUploadFailedDialog";
@@ -118,7 +117,6 @@ import { showSpaceInvite } from "../../utils/space";
118117
import AccessibleButton from "../views/elements/AccessibleButton";
119118
import { ActionPayload } from "../../dispatcher/payloads";
120119
import { SummarizedNotificationState } from "../../stores/notifications/SummarizedNotificationState";
121-
import GenericToast from '../views/toasts/GenericToast';
122120
import Views from '../../Views';
123121
import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload";
124122
import { ViewHomePagePayload } from '../../dispatcher/payloads/ViewHomePagePayload';
@@ -738,9 +736,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
738736
this.state.resizeNotifier.notifyLeftHandleResized();
739737
});
740738
break;
741-
case 'focus_room_filter': // for CtrlOrCmd+K to work by expanding the left panel first
742-
if (SettingsStore.getValue("feature_spotlight")) break; // don't expand if spotlight enabled
743-
// fallthrough
744739
case 'show_left_panel':
745740
this.setState({
746741
collapseLhs: false,
@@ -1398,42 +1393,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
13981393
showNotificationsToast(false);
13991394
}
14001395

1401-
if (!localStorage.getItem("mx_seen_feature_spotlight_toast")) {
1402-
setTimeout(() => {
1403-
// Skip the toast if the beta is already enabled or the user has changed the setting from default
1404-
if (SettingsStore.getValue("feature_spotlight") ||
1405-
SettingsStore.getValue("feature_spotlight", null, true) !== null) {
1406-
return;
1407-
}
1408-
1409-
const key = "BETA_SPOTLIGHT_TOAST";
1410-
ToastStore.sharedInstance().addOrReplaceToast({
1411-
key,
1412-
title: _t("New search beta available"),
1413-
props: {
1414-
description: _t("We're testing a new search to make finding what you want quicker.\n"),
1415-
acceptLabel: _t("Learn more"),
1416-
onAccept: () => {
1417-
dis.dispatch({
1418-
action: Action.ViewUserSettings,
1419-
initialTabId: UserTab.Labs,
1420-
});
1421-
localStorage.setItem("mx_seen_feature_spotlight_toast", "true");
1422-
ToastStore.sharedInstance().dismissToast(key);
1423-
},
1424-
rejectLabel: _t("Dismiss"),
1425-
onReject: () => {
1426-
localStorage.setItem("mx_seen_feature_spotlight_toast", "true");
1427-
ToastStore.sharedInstance().dismissToast(key);
1428-
},
1429-
},
1430-
icon: "labs",
1431-
component: GenericToast,
1432-
priority: 9,
1433-
});
1434-
}, 5 * 60 * 1000); // show after 5 minutes to not overload user with toasts on launch
1435-
}
1436-
14371396
dis.fire(Action.FocusSendMessageComposer);
14381397
this.setState({
14391398
ready: true,

0 commit comments

Comments
 (0)