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
@@ -128,15 +128,43 @@ class SpaceAddRoomsScreenViewModel: SpaceAddRoomsScreenViewModelType, SpaceAddRo
}
private func save() async {
showSavingIndicator()
defer { hideSavingIndicator() }
for room in state.selectedRooms {
if case .failure(let error) = await spaceServiceProxy.addChild(room.id, to: spaceRoomListProxy.id) {
MXLog.error("Failed adding room to space: \(error)")
userIndicatorController.submitIndicator(UserIndicator(title: L10n.errorUnknown))
showErrorIndicator()
updateRooms() // Hide any rooms that were already added.
return
}
}
await spaceRoomListProxy.resetAndWaitForFullReload(timeout: .seconds(10))
actionsSubject.send(.dismiss)
}
// MARK: User Indicators
private var savingIndicatorID: String { "\(Self.self)-Saving" }
private var failureIndicatorID: String { "\(Self.self)-Failure" }
private func showSavingIndicator() {
userIndicatorController.submitIndicator(UserIndicator(id: savingIndicatorID,
type: .modal(progress: .indeterminate, interactiveDismissDisabled: true, allowsInteraction: false),
title: L10n.commonSaving,
persistent: true))
}
private func hideSavingIndicator() {
userIndicatorController.retractIndicatorWithId(savingIndicatorID)
}
private func showErrorIndicator() {
userIndicatorController.submitIndicator(UserIndicator(id: failureIndicatorID,
type: .toast,
title: L10n.errorUnknown,
iconName: "xmark"))
}
}