Room list: improve section in room list context menu (#33733)

* fix: hide section separator in context menu when there is no section

* fix: truncate long section name

* feat: add remove from section entry to room list item context menu

* test: update tests and stories

* test: add new test

* test: use same mocks

* test: add e2e test for "Remove from section"
This commit is contained in:
Florian Duros
2026-06-09 12:11:02 +02:00
committed by GitHub
parent 47fe4ba4d0
commit 5fa2da2a91
13 changed files with 95 additions and 34 deletions
@@ -415,6 +415,14 @@ export class RoomListItemViewModel
tagRoom(this.props.room, tag);
};
public onRemoveFromSection = (): void => {
const roomTags = this.props.room.tags;
const sectionTag = RoomListStoreV3.instance.orderedSectionTags.find((tag) => Boolean(roomTags[tag]));
if (sectionTag) {
tagRoom(this.props.room, sectionTag);
}
};
private onOrderedCustomSectionsChange = (): void => {
// Rebuild sections list to reflect new order
const sections = RoomListItemViewModel.buildSections(this.props.room.tags);