Space flow improvements. (#4430)

* Space flow improvements

- Use a state machine to select a space.
- Add a SpaceFlowCoordinator for recursively presenting subspaces.
- Get the spaceRoomListProxy when tapping on the space so we can indicate failures.
- Fix the total room count in SpaceListScreen.

* Refactor spaceRoom → spaceRoomProxy.

* Add a UI test for the Spaces flow.
This commit is contained in:
Doug
2025-08-22 15:49:47 +01:00
committed by GitHub
parent bb5deb9c50
commit d119964d50
34 changed files with 503 additions and 73 deletions
@@ -577,14 +577,19 @@ class MockScreen: Identifiable {
appSettings: ServiceLocator.shared.settings,
mediaProvider: MediaProviderMock(configuration: .init()))
return SessionVerificationScreenCoordinator(parameters: parameters)
case .userSessionScreen, .userSessionScreenReply:
case .userSessionScreen, .userSessionScreenReply, .userSessionSpacesFlow:
let appSettings: AppSettings = ServiceLocator.shared.settings
appSettings.hasRunIdentityConfirmationOnboarding = true
appSettings.hasRunNotificationPermissionsOnboarding = true
appSettings.analyticsConsentState = .optedOut
appSettings.spacesEnabled = true
let clientProxy = ClientProxyMock(.init(userID: "@mock:client.com", deviceID: "MOCKCLIENT", roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms)))))
// The tab bar remains hidden for the non-spaces tests as we don't supply any mock spaces.
let spaceServiceProxy = SpaceServiceProxyMock(id == .userSessionSpacesFlow ? .populated : .init())
clientProxy.spaceService = spaceServiceProxy
let appMediator = AppMediatorMock.default
appMediator.underlyingWindowManager = windowManager
@@ -47,6 +47,7 @@ enum UITestsScreenIdentifier: String {
case startChatWithSearchResults
case userSessionScreen
case userSessionScreenReply
case userSessionSpacesFlow
case autoUpdatingTimeline
}