Remove dead code on favourite and people metaspaces (#34187)
* Remove unused Favourites and People metaspaces * Update existing tests * Update snapshots * Update i18n lang
This commit is contained in:
@@ -35,7 +35,6 @@ import {
|
||||
RoomIcon,
|
||||
SpaceIcon,
|
||||
UserProfileIcon,
|
||||
FavouriteIcon,
|
||||
HomeIcon,
|
||||
GroupIcon,
|
||||
CloseIcon,
|
||||
@@ -156,10 +155,6 @@ function metaspaceToIcon(key: MetaSpace): JSX.Element | undefined {
|
||||
switch (key) {
|
||||
case MetaSpace.Home:
|
||||
return <HomeIcon />;
|
||||
case MetaSpace.Favourites:
|
||||
return <FavouriteIcon />;
|
||||
case MetaSpace.People:
|
||||
return <UserProfileIcon />;
|
||||
case MetaSpace.Orphans:
|
||||
return <RoomIcon />;
|
||||
}
|
||||
|
||||
@@ -34,14 +34,7 @@ export const onMetaSpaceChangeFactory =
|
||||
PosthogTrackers.trackInteraction(
|
||||
interactionName,
|
||||
e,
|
||||
[
|
||||
MetaSpace.Home,
|
||||
null,
|
||||
MetaSpace.Favourites,
|
||||
MetaSpace.People,
|
||||
MetaSpace.Orphans,
|
||||
MetaSpace.VideoRooms,
|
||||
].indexOf(metaSpace),
|
||||
[MetaSpace.Home, null, MetaSpace.Orphans, MetaSpace.VideoRooms].indexOf(metaSpace),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -25,11 +25,9 @@ import { DragDropContext, Draggable, Droppable, type DroppableProvidedProps } fr
|
||||
import classNames from "classnames";
|
||||
import { type Room } from "matrix-js-sdk/src/matrix";
|
||||
import {
|
||||
FavouriteSolidIcon,
|
||||
HomeSolidIcon,
|
||||
RoomIcon,
|
||||
VideoCallSolidIcon,
|
||||
UserProfileSolidIcon,
|
||||
PlusIcon,
|
||||
ChevronRightIcon,
|
||||
} from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||
@@ -178,34 +176,6 @@ const HomeButton: React.FC<MetaSpaceButtonProps> = ({ selected, isPanelCollapsed
|
||||
);
|
||||
};
|
||||
|
||||
const FavouritesButton: React.FC<MetaSpaceButtonProps> = ({ selected, isPanelCollapsed }) => {
|
||||
return (
|
||||
<MetaSpaceButton
|
||||
spaceKey={MetaSpace.Favourites}
|
||||
selected={selected}
|
||||
isPanelCollapsed={isPanelCollapsed}
|
||||
label={getMetaSpaceName(MetaSpace.Favourites)}
|
||||
notificationState={SpaceStore.instance.getNotificationState(MetaSpace.Favourites)}
|
||||
size="32px"
|
||||
icon={<FavouriteSolidIcon />}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const PeopleButton: React.FC<MetaSpaceButtonProps> = ({ selected, isPanelCollapsed }) => {
|
||||
return (
|
||||
<MetaSpaceButton
|
||||
spaceKey={MetaSpace.People}
|
||||
selected={selected}
|
||||
isPanelCollapsed={isPanelCollapsed}
|
||||
label={getMetaSpaceName(MetaSpace.People)}
|
||||
notificationState={SpaceStore.instance.getNotificationState(MetaSpace.People)}
|
||||
size="32px"
|
||||
icon={<UserProfileSolidIcon />}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const OrphansButton: React.FC<MetaSpaceButtonProps> = ({ selected, isPanelCollapsed }) => {
|
||||
return (
|
||||
<MetaSpaceButton
|
||||
@@ -286,8 +256,6 @@ const CreateSpaceButton: React.FC<Pick<IInnerSpacePanelProps, "isPanelCollapsed"
|
||||
|
||||
const metaSpaceComponentMap: Record<MetaSpace, typeof HomeButton> = {
|
||||
[MetaSpace.Home]: HomeButton,
|
||||
[MetaSpace.Favourites]: FavouritesButton,
|
||||
[MetaSpace.People]: PeopleButton,
|
||||
[MetaSpace.Orphans]: OrphansButton,
|
||||
[MetaSpace.VideoRooms]: VideoRoomsButton,
|
||||
};
|
||||
|
||||
@@ -480,7 +480,6 @@
|
||||
"encrypted": "Encrypted",
|
||||
"error": "Error",
|
||||
"faq": "FAQ",
|
||||
"favourites": "Favourites",
|
||||
"feedback": "Feedback",
|
||||
"filter_results": "Filter results",
|
||||
"forward_message": "Forward message",
|
||||
|
||||
@@ -134,8 +134,6 @@ describe("SpaceStore", () => {
|
||||
|
||||
await SettingsStore.setValue("Spaces.enabledMetaSpaces", null, SettingLevel.DEVICE, {
|
||||
[MetaSpace.Home]: true,
|
||||
[MetaSpace.Favourites]: true,
|
||||
[MetaSpace.People]: true,
|
||||
[MetaSpace.Orphans]: true,
|
||||
});
|
||||
|
||||
@@ -444,12 +442,6 @@ describe("SpaceStore", () => {
|
||||
expect(store.isRoomInSpace(MetaSpace.Home, room1)).toBeTruthy();
|
||||
});
|
||||
|
||||
it("people space does contain people even if they are also shown in a space", async () => {
|
||||
expect(store.isRoomInSpace(MetaSpace.People, dm1)).toBeTruthy();
|
||||
expect(store.isRoomInSpace(MetaSpace.People, dm2)).toBeTruthy();
|
||||
expect(store.isRoomInSpace(MetaSpace.People, dm3)).toBeTruthy();
|
||||
});
|
||||
|
||||
it("orphans space does contain orphans even if they are also shown in all rooms", async () => {
|
||||
await setShowAllRooms(true);
|
||||
expect(store.isRoomInSpace(MetaSpace.Orphans, orphan1)).toBeTruthy();
|
||||
@@ -1259,8 +1251,6 @@ describe("SpaceStore", () => {
|
||||
expect(SpaceStore.instance.spacePanelSpaces).toStrictEqual([rootSpace]);
|
||||
expect(SpaceStore.instance.isRoomInSpace(space1, room1)).toBeTruthy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Home, room1)).toBeFalsy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Favourites, room1)).toBeFalsy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.People, room1)).toBeFalsy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Orphans, room1)).toBeFalsy();
|
||||
|
||||
// receive room invite
|
||||
@@ -1273,8 +1263,6 @@ describe("SpaceStore", () => {
|
||||
expect(SpaceStore.instance.spacePanelSpaces).toStrictEqual([rootSpace]);
|
||||
expect(SpaceStore.instance.isRoomInSpace(space1, room2)).toBeTruthy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Home, room2)).toBeTruthy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Favourites, room2)).toBeFalsy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.People, room2)).toBeFalsy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Orphans, room2)).toBeFalsy();
|
||||
|
||||
// start DM in space
|
||||
@@ -1314,8 +1302,6 @@ describe("SpaceStore", () => {
|
||||
expect(SpaceStore.instance.spacePanelSpaces).toStrictEqual([rootSpace]);
|
||||
expect(SpaceStore.instance.isRoomInSpace(space1, dm1)).toBeTruthy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Home, dm1)).toBeTruthy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Favourites, dm1)).toBeFalsy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.People, dm1)).toBeTruthy();
|
||||
expect(SpaceStore.instance.isRoomInSpace(MetaSpace.Orphans, dm1)).toBeFalsy();
|
||||
|
||||
// join subspace
|
||||
|
||||
@@ -29,7 +29,6 @@ import SettingsStore from "../../settings/SettingsStore";
|
||||
import DMRoomMap from "../../utils/DMRoomMap";
|
||||
import { SpaceNotificationState } from "../notifications/SpaceNotificationState";
|
||||
import { RoomNotificationStateStore } from "../notifications/RoomNotificationStateStore";
|
||||
import { DefaultTagID } from "../room-list-v3/skip-list/tag";
|
||||
import { EnhancedMap, mapDiff } from "../../utils/maps";
|
||||
import { setDiff, setHasDiff } from "../../utils/sets";
|
||||
import { Action } from "../../dispatcher/actions";
|
||||
@@ -451,7 +450,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
}
|
||||
// beyond this point we know this is a DM
|
||||
|
||||
if (space === MetaSpace.Home || space === MetaSpace.People) {
|
||||
if (space === MetaSpace.Home) {
|
||||
// these spaces contain all DMs
|
||||
return true;
|
||||
}
|
||||
@@ -648,13 +647,6 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
this.roomIdsBySpace.delete(MetaSpace.Home);
|
||||
}
|
||||
|
||||
if (enabledMetaSpaces.has(MetaSpace.Favourites)) {
|
||||
const favourites = visibleRooms.filter((r) => r.tags[DefaultTagID.Favourite]);
|
||||
this.roomIdsBySpace.set(MetaSpace.Favourites, new Set(favourites.map((r) => r.roomId)));
|
||||
} else {
|
||||
this.roomIdsBySpace.delete(MetaSpace.Favourites);
|
||||
}
|
||||
|
||||
// The People metaspace doesn't need maintaining
|
||||
|
||||
// Populate the orphans space if the Home space is enabled as it is a superset of it.
|
||||
@@ -678,18 +670,13 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
const visibleRooms = this.matrixClient.getVisibleRooms(this._msc3946ProcessDynamicPredecessor);
|
||||
|
||||
let dmBadgeSpace: MetaSpace | undefined;
|
||||
// only show badges on dms on the most relevant space if such exists
|
||||
if (enabledMetaSpaces.has(MetaSpace.People)) {
|
||||
dmBadgeSpace = MetaSpace.People;
|
||||
} else if (enabledMetaSpaces.has(MetaSpace.Home)) {
|
||||
// only show badges on home
|
||||
if (enabledMetaSpaces.has(MetaSpace.Home)) {
|
||||
dmBadgeSpace = MetaSpace.Home;
|
||||
}
|
||||
|
||||
if (!spaces) {
|
||||
spaces = [...this.roomIdsBySpace.keys()];
|
||||
if (dmBadgeSpace === MetaSpace.People) {
|
||||
spaces.push(MetaSpace.People);
|
||||
}
|
||||
if (enabledMetaSpaces.has(MetaSpace.Home) && !this.allRoomsInHome) {
|
||||
spaces.push(MetaSpace.Home);
|
||||
}
|
||||
@@ -703,10 +690,6 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
// Update NotificationStates
|
||||
this.getNotificationState(s).setRooms(
|
||||
visibleRooms.filter((room) => {
|
||||
if (s === MetaSpace.People) {
|
||||
return this.isRoomInSpace(MetaSpace.People, room.roomId);
|
||||
}
|
||||
|
||||
if (room.isSpaceRoom() || !flattenedRoomsForSpace.has(room.roomId)) return false;
|
||||
|
||||
if (dmBadgeSpace && DMRoomMap.shared().getUserIdForRoomId(room.roomId)) {
|
||||
@@ -717,10 +700,6 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
if (dmBadgeSpace !== MetaSpace.People) {
|
||||
this.notificationStateMap.delete(MetaSpace.People);
|
||||
}
|
||||
};
|
||||
|
||||
private showInHomeSpace = (room: Room): boolean => {
|
||||
@@ -885,13 +864,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
this.switchSpaceIfNeeded();
|
||||
}
|
||||
|
||||
const notificationStatesToUpdate = [...changeSet];
|
||||
// We update the People metaspace even if we didn't detect any changes
|
||||
// as roomIdsBySpace does not pre-calculate it so we have to assume it could have changed
|
||||
if (this.enabledMetaSpaces.includes(MetaSpace.People)) {
|
||||
notificationStatesToUpdate.push(MetaSpace.People);
|
||||
}
|
||||
this.updateNotificationStates(notificationStatesToUpdate);
|
||||
this.updateNotificationStates([...changeSet]);
|
||||
};
|
||||
|
||||
private switchSpaceIfNeeded = (roomId = SDKContextClass.instance.roomViewStore.getRoomId()): void => {
|
||||
@@ -1070,27 +1043,9 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
if (order !== lastOrder) {
|
||||
this.notifyIfOrderChanged();
|
||||
}
|
||||
} else if (ev.getType() === EventType.Tag) {
|
||||
// If the room was in favourites and now isn't or the opposite then update its position in the trees
|
||||
const oldTags = lastEv?.getContent()?.tags || {};
|
||||
const newTags = ev.getContent()?.tags || {};
|
||||
if (!!oldTags[DefaultTagID.Favourite] !== !!newTags[DefaultTagID.Favourite]) {
|
||||
this.onRoomFavouriteChange(room);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private onRoomFavouriteChange(room: Room): void {
|
||||
if (this.enabledMetaSpaces.includes(MetaSpace.Favourites)) {
|
||||
if (room.tags[DefaultTagID.Favourite]) {
|
||||
this.roomIdsBySpace.get(MetaSpace.Favourites)?.add(room.roomId);
|
||||
} else {
|
||||
this.roomIdsBySpace.get(MetaSpace.Favourites)?.delete(room.roomId);
|
||||
}
|
||||
this.emit(MetaSpace.Favourites);
|
||||
}
|
||||
}
|
||||
|
||||
private onRoomDmChange(room: Room, isDm: boolean): void {
|
||||
const enabledMetaSpaces = new Set(this.enabledMetaSpaces);
|
||||
|
||||
@@ -1105,10 +1060,6 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
this.emit(MetaSpace.Home);
|
||||
}
|
||||
|
||||
if (enabledMetaSpaces.has(MetaSpace.People)) {
|
||||
this.emit(MetaSpace.People);
|
||||
}
|
||||
|
||||
if (enabledMetaSpaces.has(MetaSpace.Orphans) || enabledMetaSpaces.has(MetaSpace.Home)) {
|
||||
if (isDm && this.roomIdsBySpace.get(MetaSpace.Orphans)?.delete(room.roomId)) {
|
||||
this.emit(MetaSpace.Orphans);
|
||||
@@ -1204,8 +1155,6 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
const enabled = new Set(this.enabledMetaSpaces);
|
||||
PosthogAnalytics.instance.setProperty("WebMetaSpaceHomeEnabled", enabled.has(MetaSpace.Home));
|
||||
PosthogAnalytics.instance.setProperty("WebMetaSpaceHomeAllRooms", this.allRoomsInHome);
|
||||
PosthogAnalytics.instance.setProperty("WebMetaSpacePeopleEnabled", enabled.has(MetaSpace.People));
|
||||
PosthogAnalytics.instance.setProperty("WebMetaSpaceFavouritesEnabled", enabled.has(MetaSpace.Favourites));
|
||||
PosthogAnalytics.instance.setProperty("WebMetaSpaceOrphansEnabled", enabled.has(MetaSpace.Orphans));
|
||||
}
|
||||
|
||||
@@ -1292,13 +1241,9 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
const newValue = SettingsStore.getValue("Spaces.enabledMetaSpaces");
|
||||
const enabledMetaSpaces = metaSpaceOrder.filter((k) => newValue[k]);
|
||||
if (arrayHasDiff(this._enabledMetaSpaces, enabledMetaSpaces)) {
|
||||
const hadPeopleOrHomeEnabled = this.enabledMetaSpaces.some((s) => {
|
||||
return s === MetaSpace.Home || s === MetaSpace.People;
|
||||
});
|
||||
const hadHomeEnabled = this.enabledMetaSpaces.some((s) => s === MetaSpace.Home);
|
||||
this._enabledMetaSpaces = enabledMetaSpaces;
|
||||
const hasPeopleOrHomeEnabled = this.enabledMetaSpaces.some((s) => {
|
||||
return s === MetaSpace.Home || s === MetaSpace.People;
|
||||
});
|
||||
const hasHomeEnabled = this.enabledMetaSpaces.some((s) => s === MetaSpace.Home);
|
||||
|
||||
// if a metaspace currently being viewed was removed, go to another one
|
||||
if (isMetaSpace(this.activeSpace) && !newValue[this.activeSpace]) {
|
||||
@@ -1306,7 +1251,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
}
|
||||
this.rebuildMetaSpaces();
|
||||
|
||||
if (hadPeopleOrHomeEnabled !== hasPeopleOrHomeEnabled) {
|
||||
if (hadHomeEnabled !== hasHomeEnabled) {
|
||||
// in this case we have to rebuild everything as DM badges will move to/from real spaces
|
||||
this.updateNotificationStates();
|
||||
} else {
|
||||
@@ -1323,7 +1268,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<EmptyObject> {
|
||||
if (payload.roomId) {
|
||||
// getSpaceFilteredUserIds will return the appropriate value
|
||||
this.emit(payload.roomId);
|
||||
if (!this.enabledMetaSpaces.some((s) => s === MetaSpace.Home || s === MetaSpace.People)) {
|
||||
if (!this.enabledMetaSpaces.some((s) => s === MetaSpace.Home)) {
|
||||
this.updateNotificationStates([payload.roomId]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@ export const UPDATE_SUGGESTED_ROOMS = Symbol("suggested-rooms");
|
||||
|
||||
export enum MetaSpace {
|
||||
Home = "home-space",
|
||||
Favourites = "favourites-space",
|
||||
People = "people-space",
|
||||
Orphans = "orphans-space",
|
||||
VideoRooms = "video-rooms-space",
|
||||
}
|
||||
@@ -31,10 +29,6 @@ export const getMetaSpaceName = (spaceKey: MetaSpace, allRoomsInHome = false): s
|
||||
switch (spaceKey) {
|
||||
case MetaSpace.Home:
|
||||
return allRoomsInHome ? _t("common|all_chats") : _t("common|home");
|
||||
case MetaSpace.Favourites:
|
||||
return _t("common|favourites");
|
||||
case MetaSpace.People:
|
||||
return _t("common|people");
|
||||
case MetaSpace.Orphans:
|
||||
return _t("common|orphan_rooms");
|
||||
case MetaSpace.VideoRooms:
|
||||
@@ -57,11 +51,5 @@ export interface ISuggestedRoom extends HierarchyRoom {
|
||||
}
|
||||
|
||||
export function isMetaSpace(spaceKey?: SpaceKey): spaceKey is MetaSpace {
|
||||
return (
|
||||
spaceKey === MetaSpace.Home ||
|
||||
spaceKey === MetaSpace.Favourites ||
|
||||
spaceKey === MetaSpace.People ||
|
||||
spaceKey === MetaSpace.Orphans ||
|
||||
spaceKey === MetaSpace.VideoRooms
|
||||
);
|
||||
return spaceKey === MetaSpace.Home || spaceKey === MetaSpace.Orphans || spaceKey === MetaSpace.VideoRooms;
|
||||
}
|
||||
|
||||
@@ -706,24 +706,19 @@ describe("Spotlight Dialog", () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(SpaceStore.instance, "enabledMetaSpaces", "get").mockReturnValue([
|
||||
MetaSpace.Home,
|
||||
MetaSpace.Favourites,
|
||||
MetaSpace.People,
|
||||
MetaSpace.Orphans,
|
||||
]);
|
||||
});
|
||||
|
||||
it.each([MetaSpace.Home, MetaSpace.Favourites, MetaSpace.People])(
|
||||
"should show metaspace %s",
|
||||
async (metaSpace) => {
|
||||
const onFinished = jest.fn();
|
||||
const { asFragment, container } = render(
|
||||
<SpotlightDialog initialText={metaSpace.split("-")[0]} onFinished={onFinished} />,
|
||||
);
|
||||
await waitFor(() =>
|
||||
expect(container.querySelector(".mx_SpotlightDialog_metaspaceResult")).toBeInTheDocument(),
|
||||
);
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
},
|
||||
);
|
||||
it("should show Home metaspace", async () => {
|
||||
const onFinished = jest.fn();
|
||||
const { asFragment, container } = render(
|
||||
<SpotlightDialog initialText={MetaSpace.Home.split("-")[0]} onFinished={onFinished} />,
|
||||
);
|
||||
await waitFor(() =>
|
||||
expect(container.querySelector(".mx_SpotlightDialog_metaspaceResult")).toBeInTheDocument(),
|
||||
);
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+1
-507
@@ -1,256 +1,6 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`Spotlight Dialog metaspaces should show metaspace favourites-space 1`] = `
|
||||
<DocumentFragment>
|
||||
<div
|
||||
id="mx_SpotlightDialog_keyboardPrompt"
|
||||
>
|
||||
<span>
|
||||
Use
|
||||
<kbd>
|
||||
↓
|
||||
</kbd>
|
||||
<kbd>
|
||||
↑
|
||||
</kbd>
|
||||
to scroll
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
data-focus-guard="true"
|
||||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
aria-label="Search Dialog"
|
||||
class="mx_SpotlightDialog mx_Dialog_fixedWidth"
|
||||
data-focus-lock-disabled="false"
|
||||
role="dialog"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div
|
||||
class="mx_Dialog_header"
|
||||
/>
|
||||
<div
|
||||
class="mx_SpotlightDialog_searchBox mx_textinput"
|
||||
>
|
||||
<input
|
||||
aria-activedescendant="mx_SpotlightDialog_button_result_Favourites"
|
||||
aria-describedby="mx_SpotlightDialog_keyboardPrompt"
|
||||
aria-label="Search"
|
||||
aria-owns="mx_SpotlightDialog_content"
|
||||
autocapitalize="off"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
placeholder="Search"
|
||||
spellcheck="false"
|
||||
type="text"
|
||||
value="favourites"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
aria-activedescendant="mx_SpotlightDialog_button_result_Favourites"
|
||||
aria-describedby="mx_SpotlightDialog_keyboardPrompt"
|
||||
id="mx_SpotlightDialog_content"
|
||||
role="listbox"
|
||||
>
|
||||
<div
|
||||
aria-labelledby="mx_SpotlightDialog_section_spaces"
|
||||
class="mx_SpotlightDialog_section mx_SpotlightDialog_results"
|
||||
role="group"
|
||||
>
|
||||
<h4
|
||||
id="mx_SpotlightDialog_section_spaces"
|
||||
>
|
||||
Spaces you're in
|
||||
</h4>
|
||||
<div>
|
||||
<li
|
||||
aria-selected="true"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_result_Favourites"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div
|
||||
class="mx_SpotlightDialog_metaspaceResult"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M13.905 9.378 12 5.52l-1.905 3.86-4.259.618 3.082 3.004-.727 4.242L12 15.24l3.81 2.003-.728-4.242 3.082-3.004zM8.767 7.55l2.336-4.733a1 1 0 0 1 1.794 0l2.336 4.733 5.223.76a1 1 0 0 1 .555 1.705L17.23 13.7l.892 5.202a1 1 0 0 1-1.45 1.054L12 17.5l-4.672 2.456a1 1 0 0 1-1.451-1.054l.892-5.202-3.78-3.685a1 1 0 0 1 .555-1.706z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
Favourites
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-labelledby="mx_SpotlightDialog_section_otherSearches"
|
||||
class="mx_SpotlightDialog_section mx_SpotlightDialog_otherSearches"
|
||||
role="group"
|
||||
>
|
||||
<h4
|
||||
id="mx_SpotlightDialog_section_otherSearches"
|
||||
>
|
||||
Use "favourites" to search
|
||||
</h4>
|
||||
<div>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_explorePublicSpaces"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M6 21q-1.65 0-2.825-1.175T2 17t1.175-2.825T6 13t2.825 1.175T10 17t-1.175 2.825T6 21m12 0q-1.65 0-2.825-1.175T14 17t1.175-2.825T18 13t2.825 1.175T22 17t-1.175 2.825T18 21M6 19q.824 0 1.412-.587Q8 17.825 8 17t-.588-1.412A1.93 1.93 0 0 0 6 15q-.824 0-1.412.588A1.93 1.93 0 0 0 4 17q0 .824.588 1.413Q5.175 19 6 19m12 0q.824 0 1.413-.587Q20 17.825 20 17t-.587-1.412A1.93 1.93 0 0 0 18 15q-.824 0-1.413.588A1.93 1.93 0 0 0 16 17q0 .824.587 1.413Q17.176 19 18 19m-6-8q-1.65 0-2.825-1.175T8 7t1.175-2.825T12 3t2.825 1.175T16 7t-1.175 2.825T12 11m0-2q.825 0 1.412-.588Q14 7.826 14 7q0-.824-.588-1.412A1.93 1.93 0 0 0 12 5q-.825 0-1.412.588A1.93 1.93 0 0 0 10 7q0 .824.588 1.412Q11.175 9 12 9"
|
||||
/>
|
||||
</svg>
|
||||
Public spaces
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_explorePublicRooms"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="m8.566 17-.944 4.094q-.086.406-.372.656t-.687.25q-.543 0-.887-.469a1.18 1.18 0 0 1-.2-1.031l.801-3.5H3.158q-.572 0-.916-.484a1.27 1.27 0 0 1-.2-1.078 1.12 1.12 0 0 1 1.116-.938H6.85l1.145-5h-3.12q-.57 0-.915-.484a1.27 1.27 0 0 1-.2-1.078A1.12 1.12 0 0 1 4.875 7h3.691l.945-4.094q.085-.406.372-.656.286-.25.686-.25.544 0 .887.469.345.468.2 1.031l-.8 3.5h4.578l.944-4.094q.085-.406.372-.656.286-.25.687-.25.543 0 .887.469t.2 1.031L17.723 7h3.119q.573 0 .916.484.343.485.2 1.079a1.12 1.12 0 0 1-1.116.937H17.15l-1.145 5h3.12q.57 0 .915.484.343.485.2 1.079a1.12 1.12 0 0 1-1.116.937h-3.691l-.944 4.094q-.087.406-.373.656t-.686.25q-.544 0-.887-.469a1.18 1.18 0 0 1-.2-1.031l.8-3.5zm.573-2.5h4.578l1.144-5h-4.578z"
|
||||
/>
|
||||
</svg>
|
||||
Public rooms
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_startChat"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M9.175 13.825Q10.35 15 12 15t2.825-1.175T16 11t-1.175-2.825T12 7 9.175 8.175 8 11t1.175 2.825m4.237-1.412A1.93 1.93 0 0 1 12 13q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 11q0-.825.588-1.412A1.93 1.93 0 0 1 12 9q.825 0 1.412.588Q14 10.175 14 11t-.588 1.412"
|
||||
/>
|
||||
<path
|
||||
d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10m-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0"
|
||||
/>
|
||||
<path
|
||||
d="M16.23 18.792a13 13 0 0 0-1.455-.455 11.6 11.6 0 0 0-5.55 0q-.73.18-1.455.455a8 8 0 0 1-1.729-1.454q1.336-.618 2.709-.95A13.8 13.8 0 0 1 12 16q1.65 0 3.25.387 1.373.333 2.709.95a8 8 0 0 1-1.73 1.455"
|
||||
/>
|
||||
</svg>
|
||||
People
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_searchMessages"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="m1.5 21.25 1.45-4.95a10.2 10.2 0 0 1-.712-2.1A10.2 10.2 0 0 1 2 12q0-2.075.788-3.9a10.1 10.1 0 0 1 2.137-3.175q1.35-1.35 3.175-2.137A9.7 9.7 0 0 1 12 2q2.075 0 3.9.788a10.1 10.1 0 0 1 3.175 2.137q1.35 1.35 2.137 3.175A9.7 9.7 0 0 1 22 12a9.7 9.7 0 0 1-.788 3.9 10.1 10.1 0 0 1-2.137 3.175q-1.35 1.35-3.175 2.137A9.7 9.7 0 0 1 12 22q-1.125 0-2.2-.238a10.2 10.2 0 0 1-2.1-.712L2.75 22.5a.94.94 0 0 1-1-.25.94.94 0 0 1-.25-1m2.45-1.2 3.2-.95a1 1 0 0 1 .275-.062q.15-.013.275-.013.225 0 .438.038.212.036.412.137a7.4 7.4 0 0 0 1.675.6Q11.1 20 12 20q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4 6.325 6.325 4 12q0 .9.2 1.775t.6 1.675q.176.325.188.688t-.088.712z"
|
||||
/>
|
||||
</svg>
|
||||
Messages
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
data-focus-guard="true"
|
||||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
|
||||
tabindex="0"
|
||||
/>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
|
||||
exports[`Spotlight Dialog metaspaces should show metaspace home-space 1`] = `
|
||||
exports[`Spotlight Dialog metaspaces should show Home metaspace 1`] = `
|
||||
<DocumentFragment>
|
||||
<div
|
||||
id="mx_SpotlightDialog_keyboardPrompt"
|
||||
@@ -501,259 +251,3 @@ exports[`Spotlight Dialog metaspaces should show metaspace home-space 1`] = `
|
||||
/>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
|
||||
exports[`Spotlight Dialog metaspaces should show metaspace people-space 1`] = `
|
||||
<DocumentFragment>
|
||||
<div
|
||||
id="mx_SpotlightDialog_keyboardPrompt"
|
||||
>
|
||||
<span>
|
||||
Use
|
||||
<kbd>
|
||||
↓
|
||||
</kbd>
|
||||
<kbd>
|
||||
↑
|
||||
</kbd>
|
||||
to scroll
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
data-focus-guard="true"
|
||||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
aria-label="Search Dialog"
|
||||
class="mx_SpotlightDialog mx_Dialog_fixedWidth"
|
||||
data-focus-lock-disabled="false"
|
||||
role="dialog"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div
|
||||
class="mx_Dialog_header"
|
||||
/>
|
||||
<div
|
||||
class="mx_SpotlightDialog_searchBox mx_textinput"
|
||||
>
|
||||
<input
|
||||
aria-activedescendant="mx_SpotlightDialog_button_result_People"
|
||||
aria-describedby="mx_SpotlightDialog_keyboardPrompt"
|
||||
aria-label="Search"
|
||||
aria-owns="mx_SpotlightDialog_content"
|
||||
autocapitalize="off"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
placeholder="Search"
|
||||
spellcheck="false"
|
||||
type="text"
|
||||
value="people"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
aria-activedescendant="mx_SpotlightDialog_button_result_People"
|
||||
aria-describedby="mx_SpotlightDialog_keyboardPrompt"
|
||||
id="mx_SpotlightDialog_content"
|
||||
role="listbox"
|
||||
>
|
||||
<div
|
||||
aria-labelledby="mx_SpotlightDialog_section_spaces"
|
||||
class="mx_SpotlightDialog_section mx_SpotlightDialog_results"
|
||||
role="group"
|
||||
>
|
||||
<h4
|
||||
id="mx_SpotlightDialog_section_spaces"
|
||||
>
|
||||
Spaces you're in
|
||||
</h4>
|
||||
<div>
|
||||
<li
|
||||
aria-selected="true"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_result_People"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div
|
||||
class="mx_SpotlightDialog_metaspaceResult"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M9.175 13.825Q10.35 15 12 15t2.825-1.175T16 11t-1.175-2.825T12 7 9.175 8.175 8 11t1.175 2.825m4.237-1.412A1.93 1.93 0 0 1 12 13q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 11q0-.825.588-1.412A1.93 1.93 0 0 1 12 9q.825 0 1.412.588Q14 10.175 14 11t-.588 1.412"
|
||||
/>
|
||||
<path
|
||||
d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10m-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0"
|
||||
/>
|
||||
<path
|
||||
d="M16.23 18.792a13 13 0 0 0-1.455-.455 11.6 11.6 0 0 0-5.55 0q-.73.18-1.455.455a8 8 0 0 1-1.729-1.454q1.336-.618 2.709-.95A13.8 13.8 0 0 1 12 16q1.65 0 3.25.387 1.373.333 2.709.95a8 8 0 0 1-1.73 1.455"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
People
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-labelledby="mx_SpotlightDialog_section_otherSearches"
|
||||
class="mx_SpotlightDialog_section mx_SpotlightDialog_otherSearches"
|
||||
role="group"
|
||||
>
|
||||
<h4
|
||||
id="mx_SpotlightDialog_section_otherSearches"
|
||||
>
|
||||
Use "people" to search
|
||||
</h4>
|
||||
<div>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_explorePublicSpaces"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M6 21q-1.65 0-2.825-1.175T2 17t1.175-2.825T6 13t2.825 1.175T10 17t-1.175 2.825T6 21m12 0q-1.65 0-2.825-1.175T14 17t1.175-2.825T18 13t2.825 1.175T22 17t-1.175 2.825T18 21M6 19q.824 0 1.412-.587Q8 17.825 8 17t-.588-1.412A1.93 1.93 0 0 0 6 15q-.824 0-1.412.588A1.93 1.93 0 0 0 4 17q0 .824.588 1.413Q5.175 19 6 19m12 0q.824 0 1.413-.587Q20 17.825 20 17t-.587-1.412A1.93 1.93 0 0 0 18 15q-.824 0-1.413.588A1.93 1.93 0 0 0 16 17q0 .824.587 1.413Q17.176 19 18 19m-6-8q-1.65 0-2.825-1.175T8 7t1.175-2.825T12 3t2.825 1.175T16 7t-1.175 2.825T12 11m0-2q.825 0 1.412-.588Q14 7.826 14 7q0-.824-.588-1.412A1.93 1.93 0 0 0 12 5q-.825 0-1.412.588A1.93 1.93 0 0 0 10 7q0 .824.588 1.412Q11.175 9 12 9"
|
||||
/>
|
||||
</svg>
|
||||
Public spaces
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_explorePublicRooms"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="m8.566 17-.944 4.094q-.086.406-.372.656t-.687.25q-.543 0-.887-.469a1.18 1.18 0 0 1-.2-1.031l.801-3.5H3.158q-.572 0-.916-.484a1.27 1.27 0 0 1-.2-1.078 1.12 1.12 0 0 1 1.116-.938H6.85l1.145-5h-3.12q-.57 0-.915-.484a1.27 1.27 0 0 1-.2-1.078A1.12 1.12 0 0 1 4.875 7h3.691l.945-4.094q.085-.406.372-.656.286-.25.686-.25.544 0 .887.469.345.468.2 1.031l-.8 3.5h4.578l.944-4.094q.085-.406.372-.656.286-.25.687-.25.543 0 .887.469t.2 1.031L17.723 7h3.119q.573 0 .916.484.343.485.2 1.079a1.12 1.12 0 0 1-1.116.937H17.15l-1.145 5h3.12q.57 0 .915.484.343.485.2 1.079a1.12 1.12 0 0 1-1.116.937h-3.691l-.944 4.094q-.087.406-.373.656t-.686.25q-.544 0-.887-.469a1.18 1.18 0 0 1-.2-1.031l.8-3.5zm.573-2.5h4.578l1.144-5h-4.578z"
|
||||
/>
|
||||
</svg>
|
||||
Public rooms
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_startChat"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M9.175 13.825Q10.35 15 12 15t2.825-1.175T16 11t-1.175-2.825T12 7 9.175 8.175 8 11t1.175 2.825m4.237-1.412A1.93 1.93 0 0 1 12 13q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 11q0-.825.588-1.412A1.93 1.93 0 0 1 12 9q.825 0 1.412.588Q14 10.175 14 11t-.588 1.412"
|
||||
/>
|
||||
<path
|
||||
d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10m-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0"
|
||||
/>
|
||||
<path
|
||||
d="M16.23 18.792a13 13 0 0 0-1.455-.455 11.6 11.6 0 0 0-5.55 0q-.73.18-1.455.455a8 8 0 0 1-1.729-1.454q1.336-.618 2.709-.95A13.8 13.8 0 0 1 12 16q1.65 0 3.25.387 1.373.333 2.709.95a8 8 0 0 1-1.73 1.455"
|
||||
/>
|
||||
</svg>
|
||||
People
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_AccessibleButton mx_SpotlightDialog_option"
|
||||
id="mx_SpotlightDialog_button_searchMessages"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="m1.5 21.25 1.45-4.95a10.2 10.2 0 0 1-.712-2.1A10.2 10.2 0 0 1 2 12q0-2.075.788-3.9a10.1 10.1 0 0 1 2.137-3.175q1.35-1.35 3.175-2.137A9.7 9.7 0 0 1 12 2q2.075 0 3.9.788a10.1 10.1 0 0 1 3.175 2.137q1.35 1.35 2.137 3.175A9.7 9.7 0 0 1 22 12a9.7 9.7 0 0 1-.788 3.9 10.1 10.1 0 0 1-2.137 3.175q-1.35 1.35-3.175 2.137A9.7 9.7 0 0 1 12 22q-1.125 0-2.2-.238a10.2 10.2 0 0 1-2.1-.712L2.75 22.5a.94.94 0 0 1-1-.25.94.94 0 0 1-.25-1m2.45-1.2 3.2-.95a1 1 0 0 1 .275-.062q.15-.013.275-.013.225 0 .438.038.212.036.412.137a7.4 7.4 0 0 0 1.675.6Q11.1 20 12 20q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4 6.325 6.325 4 12q0 .9.2 1.775t.6 1.675q.176.325.188.688t-.088.712z"
|
||||
/>
|
||||
</svg>
|
||||
Messages
|
||||
<div
|
||||
class="mx_SpotlightDialog_option--endAdornment"
|
||||
>
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
class="mx_SpotlightDialog_enterPrompt"
|
||||
>
|
||||
↵
|
||||
</kbd>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
data-focus-guard="true"
|
||||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
|
||||
tabindex="0"
|
||||
/>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
|
||||
-4
@@ -50,8 +50,6 @@ describe("<SidebarUserSettingsTab />", () => {
|
||||
if (settingName === "Spaces.enabledMetaSpaces") {
|
||||
return {
|
||||
[MetaSpace.Home]: true,
|
||||
[MetaSpace.Favourites]: true,
|
||||
[MetaSpace.People]: true,
|
||||
[MetaSpace.Orphans]: true,
|
||||
};
|
||||
}
|
||||
@@ -77,8 +75,6 @@ describe("<SidebarUserSettingsTab />", () => {
|
||||
if (settingName === "Spaces.enabledMetaSpaces") {
|
||||
return {
|
||||
[MetaSpace.Home]: false,
|
||||
[MetaSpace.Favourites]: true,
|
||||
[MetaSpace.People]: true,
|
||||
[MetaSpace.Orphans]: true,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -135,13 +135,7 @@ describe("<SpacePanel />", () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
SpaceStore.instance.enabledMetaSpaces.push(
|
||||
MetaSpace.Home,
|
||||
MetaSpace.Favourites,
|
||||
MetaSpace.People,
|
||||
MetaSpace.Orphans,
|
||||
MetaSpace.VideoRooms,
|
||||
);
|
||||
SpaceStore.instance.enabledMetaSpaces.push(MetaSpace.Home, MetaSpace.Orphans, MetaSpace.VideoRooms);
|
||||
mocked(shouldShowComponent).mockClear().mockReturnValue(true);
|
||||
});
|
||||
afterEach(() => {
|
||||
|
||||
@@ -81,9 +81,9 @@ describe("SpaceButton", () => {
|
||||
it("activates the metaspace on click", () => {
|
||||
const { container } = render(
|
||||
<SpaceButton
|
||||
spaceKey={MetaSpace.People}
|
||||
spaceKey={MetaSpace.Home}
|
||||
selected={false}
|
||||
label="People"
|
||||
label="Home"
|
||||
data-testid="create-space-button"
|
||||
size="32px"
|
||||
/>,
|
||||
@@ -91,15 +91,15 @@ describe("SpaceButton", () => {
|
||||
|
||||
expect(SpaceStore.instance.setActiveSpace).not.toHaveBeenCalled();
|
||||
fireEvent.click(getByTestId(container, "create-space-button"));
|
||||
expect(SpaceStore.instance.setActiveSpace).toHaveBeenCalledWith(MetaSpace.People);
|
||||
expect(SpaceStore.instance.setActiveSpace).toHaveBeenCalledWith(MetaSpace.Home);
|
||||
});
|
||||
|
||||
it("does nothing on click if already active", () => {
|
||||
const { container } = render(
|
||||
<SpaceButton
|
||||
spaceKey={MetaSpace.People}
|
||||
spaceKey={MetaSpace.Home}
|
||||
selected={true}
|
||||
label="People"
|
||||
label="Home"
|
||||
data-testid="create-space-button"
|
||||
size="32px"
|
||||
/>,
|
||||
@@ -108,7 +108,7 @@ describe("SpaceButton", () => {
|
||||
fireEvent.click(getByTestId(container, "create-space-button"));
|
||||
expect(dispatchSpy).not.toHaveBeenCalled();
|
||||
// Re-activating the metaspace is a no-op
|
||||
expect(SpaceStore.instance.setActiveSpace).toHaveBeenCalledWith(MetaSpace.People);
|
||||
expect(SpaceStore.instance.setActiveSpace).toHaveBeenCalledWith(MetaSpace.Home);
|
||||
});
|
||||
|
||||
it("should render notificationState if one is provided", () => {
|
||||
@@ -116,9 +116,9 @@ describe("SpaceButton", () => {
|
||||
|
||||
const { container, asFragment } = render(
|
||||
<SpaceButton
|
||||
spaceKey={MetaSpace.People}
|
||||
spaceKey={MetaSpace.Home}
|
||||
selected={true}
|
||||
label="People"
|
||||
label="Home"
|
||||
data-testid="create-space-button"
|
||||
notificationState={notificationState}
|
||||
size="32px"
|
||||
|
||||
-83
@@ -120,89 +120,6 @@ exports[`<SpacePanel /> should show all activated MetaSpaces in the correct orde
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_SpaceItem collapsed"
|
||||
role="treeitem"
|
||||
>
|
||||
<div
|
||||
aria-label="Favourites"
|
||||
class="mx_AccessibleButton mx_SpaceButton mx_SpaceButton_narrow mx_SpaceButton_withIcon"
|
||||
role="button"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div
|
||||
class="mx_SpaceButton_selectionWrapper"
|
||||
>
|
||||
<div
|
||||
class="mx_SpaceButton_avatarWrapper"
|
||||
>
|
||||
<div
|
||||
class="mx_SpaceButton_avatarPlaceholder"
|
||||
>
|
||||
<div
|
||||
class="mx_SpaceButton_icon"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="m12.897 2.817 2.336 4.733 5.223.76a1 1 0 0 1 .555 1.705L17.23 13.7l.892 5.202a1 1 0 0 1-1.45 1.054L12 17.5l-4.672 2.456a1 1 0 0 1-1.451-1.054l.892-5.202-3.78-3.685a1 1 0 0 1 .555-1.706l5.223-.759 2.336-4.733a1 1 0 0 1 1.794 0"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_SpaceItem collapsed"
|
||||
role="treeitem"
|
||||
>
|
||||
<div
|
||||
aria-label="People"
|
||||
class="mx_AccessibleButton mx_SpaceButton mx_SpaceButton_narrow mx_SpaceButton_withIcon"
|
||||
role="button"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div
|
||||
class="mx_SpaceButton_selectionWrapper"
|
||||
>
|
||||
<div
|
||||
class="mx_SpaceButton_avatarWrapper"
|
||||
>
|
||||
<div
|
||||
class="mx_SpaceButton_avatarPlaceholder"
|
||||
>
|
||||
<div
|
||||
class="mx_SpaceButton_icon"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M12 15q-1.65 0-2.825-1.175T8 11t1.175-2.825T12 7t2.825 1.175T16 11t-1.175 2.825T12 15"
|
||||
/>
|
||||
<path
|
||||
d="M19.528 18.583A9.96 9.96 0 0 0 22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 2.52.933 4.824 2.472 6.583A9.98 9.98 0 0 0 12 22a9.98 9.98 0 0 0 7.528-3.417M8.75 16.388q-1.373.332-2.709.95a8 8 0 1 1 11.918 0 14.7 14.7 0 0 0-2.709-.95A13.8 13.8 0 0 0 12 16q-1.65 0-3.25.387"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
aria-selected="false"
|
||||
class="mx_SpaceItem collapsed"
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
exports[`SpaceButton metaspace should render notificationState if one is provided 1`] = `
|
||||
<DocumentFragment>
|
||||
<div
|
||||
aria-label="People"
|
||||
aria-label="Home"
|
||||
class="mx_AccessibleButton mx_SpaceButton mx_SpaceButton_active"
|
||||
data-testid="create-space-button"
|
||||
role="button"
|
||||
@@ -41,7 +41,7 @@ exports[`SpaceButton metaspace should render notificationState if one is provide
|
||||
<span
|
||||
class="mx_SpaceButton_name"
|
||||
>
|
||||
People
|
||||
Home
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user