1. Updated the space selection UI 2. Paginate spaces after room creation 3. Pre-selected space creation defaults to space members access.

This commit is contained in:
Mauro Romito
2026-02-09 15:53:55 +01:00
committed by Mauro
parent 14845d5620
commit c9cd4cb1dd
10 changed files with 80 additions and 50 deletions
@@ -41,17 +41,21 @@ class CreateRoomScreenViewModel: CreateRoomScreenViewModelType, CreateRoomScreen
var selectedSpace: SpaceServiceRoom?
var canSelectSpace = false
var selectedAccessType = CreateRoomScreenAccessType.private
switch spaceSelectionMode {
case .editableSpacesList:
canSelectSpace = true
case .preSelected(let value):
selectedSpace = value
if value.joinRule != .public {
selectedAccessType = .spaceMembers
}
case .none:
break
}
let bindings = CreateRoomScreenViewStateBindings(roomTopic: "",
selectedAccessType: .private,
selectedAccessType: selectedAccessType,
selectedSpace: selectedSpace)
super.init(initialViewState: CreateRoomScreenViewState(isSpace: isSpace,
@@ -234,13 +234,7 @@ struct CreateRoomScreen: View {
context.showSpaceSelectionSheet = true
})
} else {
ListRow(label: .avatar(title: L10n.screenCreateRoomSpaceSelectionNoSpaceTitle,
description: L10n.screenCreateRoomSpaceSelectionNoSpaceDescription,
icon: CompoundIcon(\.homeSolid, size: .small, relativeTo: .body)
.foregroundColor(.compound.iconPrimary)
.scaledFrame(size: 32)
.background(.compound.bgSubtleSecondary)
.clipAvatar(isSpace: true, size: 32)),
ListRow(label: .plain(title: L10n.screenCreateRoomSpaceSelectionNoSpaceTitle),
kind: .navigationLink {
context.showSpaceSelectionSheet = true
})
@@ -24,14 +24,7 @@ struct CreateRoomSpaceSelectionSheet: View {
NavigationStack {
List {
Section {
ListRow(label: .avatar(title: L10n.screenCreateRoomSpaceSelectionNoSpaceTitle,
description: L10n.screenCreateRoomSpaceSelectionNoSpaceDescription,
icon: CompoundIcon(\.homeSolid, size: .small, relativeTo: .body)
.foregroundColor(.compound.iconPrimary)
.scaledFrame(size: 32)
.background(.compound.bgSubtleSecondary)
.scaledFrame(size: 32)
.clipAvatar(isSpace: true, size: 32)),
ListRow(label: .plain(title: L10n.screenCreateRoomSpaceSelectionNoSpaceOption),
kind: .selection(isSelected: context.selectedSpace == nil) {
context.selectedSpace = nil
dismiss()