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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user