Add space management to the flows. (#4978)

* Add the menu entries to add/remove rooms to/from a space.

* Add a user indicator to SpaceAddRoomsScreen.

* Reset the SpaceRoomListProxy after adding/removing any children.

* Calm the animations down a bit when entering EditMode on the SpaceScreen.
This commit is contained in:
Doug
2026-01-21 12:46:02 +00:00
committed by GitHub
parent 5577acac19
commit 3dccdf6685
29 changed files with 237 additions and 89 deletions
@@ -60,6 +60,10 @@ class SpaceRoomListProxy: SpaceRoomListProxyProtocol {
}
}
func reset() async {
await spaceRoomList.reset()
}
// MARK: - Private
private func handleUpdates(_ updates: [SpaceListUpdate]) {
@@ -22,4 +22,20 @@ protocol SpaceRoomListProxyProtocol {
var paginationStatePublisher: CurrentValuePublisher<SpaceRoomListPaginationState, Never> { get }
func paginate() async
func reset() async
}
extension SpaceRoomListProxyProtocol {
/// Resets the list and then waits everything to be paginated back in again before returning.
///
/// **Note:** It's the caller's responsibility to handle the calls to ``paginate``. This method
/// purely acts as a helper to wait until the list has reloaded.
func resetAndWaitForFullReload(timeout: Duration) async {
await reset()
let runner = ExpiringTaskRunner { [paginationStatePublisher] in
await _ = paginationStatePublisher.values.first { $0 == .idle(endReached: true) }
}
try? await runner.run(timeout: timeout)
}
}