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:
Florian Duros
2026-07-08 14:20:09 +00:00
committed by GitHub
parent 67a20c57a3
commit d041669031
14 changed files with 32 additions and 762 deletions
@@ -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"
@@ -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"
@@ -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>