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
@@ -89,12 +89,14 @@ class SpaceScreenViewModel: SpaceScreenViewModelType, SpaceScreenViewModelProtoc
state.canEditBaseInfo = false
state.canEditRolesAndPermissions = false
state.canEditSecurityAndPrivacy = false
state.canEditChildren = false
return
}
state.canEditBaseInfo = powerLevels.canOwnUserEditBaseInfo()
state.canEditRolesAndPermissions = powerLevels.canOwnUserEditRolesAndPermissions()
state.canEditSecurityAndPrivacy = powerLevels.canOwnUserEditSecurityAndPrivacy(isSpace: roomInfo.isSpace,
joinRule: roomInfo.joinRule)
state.canEditChildren = powerLevels.canOwnUser(sendStateEvent: .spaceChild)
}
.store(in: &cancellables)
}
@@ -134,6 +136,8 @@ class SpaceScreenViewModel: SpaceScreenViewModelType, SpaceScreenViewModelProtoc
actionsSubject.send(.displayMembers(roomProxy: roomProxy))
case .spaceSettings(let roomProxy):
actionsSubject.send(.displaySpaceSettings(roomProxy: roomProxy))
case .addExistingRooms:
actionsSubject.send(.addExistingChildren)
case .manageChildren:
withAnimation(.easeOut(duration: 0.25).disabledDuringTests()) {
state.editMode = .transient
@@ -196,6 +200,8 @@ class SpaceScreenViewModel: SpaceScreenViewModelType, SpaceScreenViewModelProtoc
}
}
await spaceRoomListProxy.resetAndWaitForFullReload(timeout: .seconds(10))
process(viewAction: .finishManagingChildren)
}