diff --git a/src/components/views/context_menus/RoomGeneralContextMenu.tsx b/src/components/views/context_menus/RoomGeneralContextMenu.tsx index 714f97ed98..4dac4b2d2b 100644 --- a/src/components/views/context_menus/RoomGeneralContextMenu.tsx +++ b/src/components/views/context_menus/RoomGeneralContextMenu.tsx @@ -218,40 +218,21 @@ export const RoomGeneralContextMenu: React.FC = ({ /> ); - let leaveOption: JSX.Element; - if (roomTags.includes(DefaultTagID.Archived)) { - leaveOption = ( - - dis.dispatch({ - action: "forget_room", - room_id: room.roomId, - }), - onPostForgetClick, - )} - /> - ); - } else { - leaveOption = ( - - dis.dispatch({ - action: "leave_room", - room_id: room.roomId, - }), - onPostLeaveClick, - )} - label={_t("action|leave")} - className="mx_IconizedContextMenu_option_red" - iconClassName="mx_RoomGeneralContextMenu_iconSignOut" - /> - ); - } + const leaveOption = ( + + dis.dispatch({ + action: "leave_room", + room_id: room.roomId, + }), + onPostLeaveClick, + )} + label={_t("action|leave")} + className="mx_IconizedContextMenu_option_red" + iconClassName="mx_RoomGeneralContextMenu_iconSignOut" + /> + ); const { level } = useUnreadNotifications(room); const markAsReadOption: JSX.Element | null = (() => { @@ -266,7 +247,7 @@ export const RoomGeneralContextMenu: React.FC = ({ iconClassName="mx_RoomGeneralContextMenu_iconMarkAsRead" /> ); - } else if (!roomTags.includes(DefaultTagID.Archived)) { + } else { return ( { @@ -277,8 +258,6 @@ export const RoomGeneralContextMenu: React.FC = ({ iconClassName="mx_RoomGeneralContextMenu_iconMarkAsUnread" /> ); - } else { - return null; } })(); @@ -291,15 +270,11 @@ export const RoomGeneralContextMenu: React.FC = ({ {markAsReadOption} - {!roomTags.includes(DefaultTagID.Archived) && ( - <> - {favoriteOption} - {lowPriorityOption} - {inviteOption} - {copyLinkOption} - {settingsOption} - - )} + {favoriteOption} + {lowPriorityOption} + {inviteOption} + {copyLinkOption} + {settingsOption} {developerToolsOption} {leaveOption} diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx index 853bebc4fe..b34d38124e 100644 --- a/src/components/views/rooms/RoomList.tsx +++ b/src/components/views/rooms/RoomList.tsx @@ -83,10 +83,6 @@ export const TAG_ORDER: TagID[] = [ DefaultTagID.LowPriority, DefaultTagID.ServerNotice, DefaultTagID.Suggested, - // DefaultTagID.Archived isn't here any more: we don't show it at all. - // The section still exists in the code as a place for rooms that we know - // about but aren't joined. At some point it could be removed entirely - // but we'd have to make sure that rooms you weren't in were hidden. ]; const ALWAYS_VISIBLE_TAGS: TagID[] = [DefaultTagID.DM, DefaultTagID.Untagged]; @@ -405,13 +401,6 @@ const TAG_AESTHETICS: TagAestheticsMap = { defaultHidden: false, }, - // TODO: Replace with archived view: https://github.com/vector-im/element-web/issues/14038 - [DefaultTagID.Archived]: { - sectionLabel: _td("common|historical"), - isInvite: false, - defaultHidden: true, - }, - [DefaultTagID.Suggested]: { sectionLabel: _td("room_list|suggested_rooms_heading"), isInvite: false, diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index 8351c176ff..891f6503c4 100644 --- a/src/components/views/rooms/RoomTile.tsx +++ b/src/components/views/rooms/RoomTile.tsx @@ -284,12 +284,7 @@ export class RoomTile extends React.PureComponent { }; private renderNotificationsMenu(isActive: boolean): React.ReactElement | null { - if ( - MatrixClientPeg.safeGet().isGuest() || - this.props.tag === DefaultTagID.Archived || - !this.showContextMenu || - this.props.isMinimized - ) { + if (MatrixClientPeg.safeGet().isGuest() || !this.showContextMenu || this.props.isMinimized) { // the menu makes no sense in these cases so do not show one return null; } diff --git a/src/stores/room-list/SlidingRoomListStore.ts b/src/stores/room-list/SlidingRoomListStore.ts index 26d3291625..2f46d41410 100644 --- a/src/stores/room-list/SlidingRoomListStore.ts +++ b/src/stores/room-list/SlidingRoomListStore.ts @@ -61,7 +61,6 @@ const filterConditions: Record = { // TODO https://github.com/vector-im/element-web/issues/23207 // DefaultTagID.ServerNotice, // DefaultTagID.Suggested, - // DefaultTagID.Archived, }; export const LISTS_UPDATE_EVENT = RoomListStoreEvent.ListsUpdate; diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index c3450d70cf..fd0d5e798a 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -490,11 +490,6 @@ export class Algorithm extends EventEmitter { for (const room of memberships[EffectiveMembership.Invite]) { newTags[DefaultTagID.Invite].push(room); } - for (const room of memberships[EffectiveMembership.Leave]) { - // We may not have had an archived section previously, so make sure its there. - if (newTags[DefaultTagID.Archived] === undefined) newTags[DefaultTagID.Archived] = []; - newTags[DefaultTagID.Archived].push(room); - } // Now process all the joined rooms. This is a bit more complicated for (const room of memberships[EffectiveMembership.Join]) { @@ -549,9 +544,7 @@ export class Algorithm extends EventEmitter { if (membership === EffectiveMembership.Invite) { tags.push(DefaultTagID.Invite); - } else if (membership === EffectiveMembership.Leave) { - tags.push(DefaultTagID.Archived); - } else { + } else if (membership === EffectiveMembership.Join) { tags.push(...this.getTagsOfJoinedRoom(room)); } diff --git a/src/stores/room-list/models.ts b/src/stores/room-list/models.ts index 50cecda665..4b35f5d18f 100644 --- a/src/stores/room-list/models.ts +++ b/src/stores/room-list/models.ts @@ -9,7 +9,6 @@ Please see LICENSE files in the repository root for full details. export enum DefaultTagID { Invite = "im.vector.fake.invite", Untagged = "im.vector.fake.recent", // legacy: used to just be 'recent rooms' but now it's all untagged rooms - Archived = "im.vector.fake.archived", LowPriority = "m.lowpriority", Favourite = "m.favourite", DM = "im.vector.fake.direct", @@ -27,7 +26,6 @@ export const OrderedDefaultTagIDs = [ DefaultTagID.LowPriority, DefaultTagID.ServerNotice, DefaultTagID.Suggested, - DefaultTagID.Archived, ]; export type TagID = string | DefaultTagID; diff --git a/test/unit-tests/components/views/context_menus/RoomGeneralContextMenu-test.tsx b/test/unit-tests/components/views/context_menus/RoomGeneralContextMenu-test.tsx index 9fc32dda29..3f4a40ca9a 100644 --- a/test/unit-tests/components/views/context_menus/RoomGeneralContextMenu-test.tsx +++ b/test/unit-tests/components/views/context_menus/RoomGeneralContextMenu-test.tsx @@ -86,13 +86,6 @@ describe("RoomGeneralContextMenu", () => { await clearAllModals(); }); - it("renders an empty context menu for archived rooms", async () => { - jest.spyOn(RoomListStore.instance, "getTagsForRoom").mockReturnValueOnce([DefaultTagID.Archived]); - - const { container } = getComponent({}); - expect(container).toMatchSnapshot(); - }); - it("renders the default context menu", async () => { const { container } = getComponent({}); expect(container).toMatchSnapshot();