Improve user search using the GET profile (#754)

* Add getProfile in ClientProxyProtocol

* Add fetchProfileIfNeeded

* Refactor search

* Update StartChatSuggestedUserCell UI

* Add showProfilePopover action

* Remove popover code

* Add UTs in StartChatViewModelTests

* Add UI tests

* Cleanup code

* Refine design

* Fix design

* Localise StartChatSuggestedUserCell

* Update localisations

* Update StartChatSuggestedUserCell design

* Fix UT

* Fix PR comments

* Apply suggestions

* Fix typo
This commit is contained in:
Alfonso Grillo
2023-04-04 10:47:41 +02:00
committed by GitHub
parent b089cd6b62
commit ea979d6515
17 changed files with 232 additions and 48 deletions
@@ -322,6 +322,14 @@ class MockScreen: Identifiable {
let coordinator = StartChatCoordinator(parameters: .init(userSession: MockUserSession(clientProxy: clientProxy, mediaProvider: MockMediaProvider())))
navigationStackCoordinator.setRootCoordinator(coordinator)
return navigationStackCoordinator
case .startChatSearchingNonExistingID:
let navigationStackCoordinator = NavigationStackCoordinator()
let clientProxy = MockClientProxy(userID: "@mock:client.com")
clientProxy.searchUsersResult = .success(.init(results: [.mockAlice], limited: true))
clientProxy.getProfileResult = .failure(.failedGettingUserProfile)
let coordinator = StartChatCoordinator(parameters: .init(userSession: MockUserSession(clientProxy: clientProxy, mediaProvider: MockMediaProvider())))
navigationStackCoordinator.setRootCoordinator(coordinator)
return navigationStackCoordinator
case .roomMemberDetailsAccountOwner:
let navigationStackCoordinator = NavigationStackCoordinator()
let coordinator = RoomMemberDetailsCoordinator(parameters: .init(roomMemberProxy: RoomMemberProxyMock.mockMe, mediaProvider: MockMediaProvider()))
@@ -50,6 +50,7 @@ enum UITestsScreenIdentifier: String {
case reportContent
case startChat
case startChatWithSearchResults
case startChatSearchingNonExistingID
}
extension UITestsScreenIdentifier: CustomStringConvertible {