Skip to content

Commit 92da75b

Browse files
committed
feat: add new events to broadcast section state
1 parent 9d4672a commit 92da75b

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

apps/web/src/dispatcher/actions.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,4 +403,16 @@ export enum Action {
403403
* or keyboard event).
404404
*/
405405
UserActivity = "user_activity",
406+
407+
/**
408+
* Fired to request collapsing or expanding all room list sections.
409+
* Payload: {@link RoomListCollapseAllSectionsPayload}
410+
*/
411+
RoomListCollapseAllSections = "room_list_collapse_all_sections",
412+
413+
/**
414+
* Fired to report the collapse state of a given room list section.
415+
* Payload: {@link RoomListSectionsCollapseStateChangedPayload}
416+
*/
417+
RoomListSectionsCollapseStateChanged = "room_list_sections_collapse_state_changed",
406418
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright 2026 New Vector Ltd.
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5+
* Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
import { type ActionPayload } from "../payloads";
9+
import { type Action } from "../actions";
10+
11+
export interface RoomListCollapseAllSectionsPayload extends ActionPayload {
12+
action: Action.RoomListCollapseAllSections;
13+
/** true = expand all, false = collapse all */
14+
expand: boolean;
15+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2026 New Vector Ltd.
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5+
* Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
import { type ActionPayload } from "../payloads";
9+
import { type Action } from "../actions";
10+
11+
export interface RoomListSectionsCollapseStateChangedPayload extends ActionPayload {
12+
action: Action.RoomListSectionsCollapseStateChanged;
13+
/**
14+
* true = all collapsed (header shows "expand all")
15+
* false = some/all expanded (header shows "collapse all")
16+
* null = hide button (flat list or sections disabled)
17+
*/
18+
allCollapsed: boolean | null;
19+
}

0 commit comments

Comments
 (0)