feat: add searching for apps - WPB-20362#4243
Conversation
50c2e3d to
a258b8b
Compare
…search-for-apps-WPB-20362
…search-for-apps-WPB-20362
…apps-request-WPB-20362
…d-search-requests-WPB-20362 # Conflicts: # WireNetwork/Sources/WireNetwork/APIs/Rest/TeamsAPI/TeamsAPIV15.swift # WireNetwork/Tests/WireNetworkTests/APIs/Rest/TeamsAPI/TeamsAPITests.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…d-search-requests-WPB-20362
…h-for-apps-WPB-20362
johnxnguyen
left a comment
There was a problem hiding this comment.
Looks good, just a few minor questions.
There was a problem hiding this comment.
Pull request overview
Adds app-specific searching to the Start/Add Participants search UI, differentiating between apps (MLS) and bots (Proteus), and updates underlying data/model/search plumbing to support user types.
Changes:
- Introduces new search groups (
apps,bots) and updates UI flows to query/display apps vs bots. - Updates service/app detail handling and app/bot conversation entrypoints, including new user-type migration.
- Refactors sync-engine search aggregation and data-model user typing; updates/extends snapshot + unit tests accordingly.
Reviewed changes
Copilot reviewed 64 out of 64 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| wire-ios/Wire-iOS/Sources/UserInterface/StartUI/StartUI/StartUIViewController.swift | Wires new group selector and routes queries to apps vs bots search. |
| wire-ios/Wire-iOS/Sources/UserInterface/StartUI/StartUI/StartUIViewController+SearchResults.swift | Updates selection handling for app/bot detail presentation and result callbacks. |
| wire-ios/Wire-iOS/Sources/UserInterface/StartUI/StartUI/SearchResultsViewControllerDelegate.swift | Splits delegate callbacks into app vs bot taps. |
| wire-ios/Wire-iOS/Sources/UserInterface/StartUI/StartUI/SearchResultsViewController.swift | Adds apps/bots groups/sections and routes selection by user type. |
| wire-ios/Wire-iOS/Sources/UserInterface/StartUI/StartUI/SearchGroupSelector.swift | Makes group selector protocol-aware (MLS vs Proteus). |
| wire-ios/Wire-iOS/Sources/UserInterface/StartUI/Common/SectionControllers/Services/SearchServicesSectionController.swift | Renames/refactors services section into apps/bots section controller. |
| wire-ios/Wire-iOS/Sources/UserInterface/StartUI/Common/EmptySearchResultsView.swift | Renames services empty states to apps and updates UI state logic. |
| wire-ios/Wire-iOS/Sources/UserInterface/StartUI/Common/Cells/OpenServicesAdminCell.swift | Renames the admin cell to bots admin cell. |
| wire-ios/Wire-iOS/Sources/UserInterface/Services/ServiceView.swift | Passes userSession to image view and switches to service.user. |
| wire-ios/Wire-iOS/Sources/UserInterface/Services/ServiceDetailViewController.swift | Extends details flow for apps vs legacy bots; adds async add/open flows. |
| wire-ios/Wire-iOS/Sources/UserInterface/Helpers/UserDetailViewControllerFactory.swift | Updates service detail controller init for new API and removal action. |
| wire-ios/Wire-iOS/Sources/UserInterface/Conversation/ConversationViewController+ProfileViewControllerDelegate.swift | Removes an outdated TODO comment. |
| wire-ios/Wire-iOS/Sources/UserInterface/Components/Views/UserCell.swift | Renames subtitle helper for app/bot search users. |
| wire-ios/Wire-iOS/Sources/UserInterface/AddContacts/AddParticipantsViewController.swift | Updates search group behavior and routes to apps/bots search + detail actions. |
| wire-ios/Wire-iOS.xcodeproj/project.pbxproj | Adds WireData/WireNetwork support dependencies to test targets. |
| wire-ios/Wire-iOS UnitTests/ZMUserMentionsTest.swift | Updates mentions tests to use bot mock semantics. |
| wire-ios/Wire-iOS Tests/Utils/CoreDataSnapshotTestCase.swift | Renames fixture helper to create a bot. |
| wire-ios/Wire-iOS Tests/UserSearchResultsViewControllerTests.swift | Updates snapshot fixture to bot mock. |
| wire-ios/Wire-iOS Tests/ReferenceImages/EmptySearchResultsViewTests/testServicesNotEnabled.1.png | Updates snapshot reference for empty apps/bots state. |
| wire-ios/Wire-iOS Tests/ReferenceImages/EmptySearchResultsViewTests/testNoResultsForServices.1.png | Updates snapshot reference for empty apps/bots state. |
| wire-ios/Wire-iOS Tests/EmptySearchResultsViewTests.swift | Re-enables/updates snapshots for apps/bots empty results states. |
| wire-ios/Wire-iOS Tests/ConversationViewControllerSnapshotTests.swift | Updates snapshot fixture to bot creation helper. |
| wire-ios/Wire-iOS Tests/ConversationMessageCell/ConversationSystemMessageTests.swift | Updates mock service user to bot. |
| wire-ios/Wire-iOS Tests/ConversationMessageCell/ConversationMessageFailedRecipientsTests.swift | Updates snapshot fixture to bot creation helper. |
| wire-ios/Wire-iOS Tests/ConversationDetail/ServiceDetailViewControllerSnapshotTests.swift | Updates snapshots to new ServiceDetail VC init + bot mock. |
| wire-ios/Tests/Mocks/MockUserType.swift | Adds appInfo to mock user type. |
| wire-ios/Tests/Mocks/MockServiceUserType+Creation.swift | Renames service-user factory to bot factory. |
| wire-ios/Tests/Fixture/CoreDataFixture.swift | Renames service-user creation to bot creation. |
| wire-ios-sync-engine/Tests/Source/UserSession/ZMUserSession/AppVersionMigrations/AppVersionMigration_4_18_0Tests.swift | Adds test for new migration that forces user refresh for type fetching. |
| wire-ios-sync-engine/Tests/Source/UserSession/Search/SearchTaskTests.swift | Updates tests for renamed bots remote search. |
| wire-ios-sync-engine/Tests/Source/UserSession/Search/SearchDirectoryTests.swift | Updates ZMSearchUser init for new type parameter. |
| wire-ios-sync-engine/Tests/Source/SessionManager/URLActionTests.swift | Makes test class final and adds connect-bot URL parsing assertion. |
| wire-ios-sync-engine/Source/UserSession/ZMUserSession/ZMUserSession.swift | Registers new app-version migration 4.18.0. |
| wire-ios-sync-engine/Source/UserSession/ZMUserSession/AppVersionMigrations/AppVersionMigration_4_18_0.swift | Implements migration to mark users for backend refresh to populate type. |
| wire-ios-sync-engine/Source/UserSession/URLActionProcessors/ConnectToBotURLActionProcessor.swift | Updates connect-bot action payload parsing and sets search user type to bot. |
| wire-ios-sync-engine/Source/UserSession/Search/SearchTask.swift | Adds apps local/remote handling and renames services search to bots search. |
| wire-ios-sync-engine/Source/UserSession/Search/SearchResult.swift | Adds union helpers for apps/bots results. |
| wire-ios-sync-engine/Source/UserSession/Search/SearchRequest.swift | Adds CustomDebugStringConvertible for easier SearchOptions debugging. |
| wire-ios-sync-engine/Source/SessionManager/URLActions.swift | Changes connect-bot action signature to providerID/serviceID. |
| wire-ios-sync-engine/Source/Data Model/ServiceUser.swift | Refactors service/bot add/fetch helpers and adds cancelled to AddBotResult. |
| wire-ios-data-model/Tests/Source/Model/UserTypeTests+Materialize.swift | Updates ZMSearchUser init calls for new type parameter. |
| wire-ios-data-model/Tests/Source/Model/User/ZMSearchUserTests.m | Updates Objective-C initializers for new type parameter. |
| wire-ios-data-model/Tests/Source/Model/User/ZMSearchUserTests+TeamUser.swift | Updates ZMSearchUser init calls for new type parameter. |
| wire-ios-data-model/Tests/Source/Model/User/ZMSearchUserTests+ProfileImages.swift | Updates helper to pass type through to ZMSearchUser. |
| wire-ios-data-model/Tests/Source/Model/User/ZMSearchUserTests+Connections.swift | Updates ZMSearchUser init calls for new type parameter. |
| wire-ios-data-model/Tests/Source/Model/TeamTests.swift | Updates team member search to filter by regular user type. |
| wire-ios-data-model/Tests/Source/Model/Observer/SearchUserSnapshotTests.swift | Updates helper to pass type through to ZMSearchUser. |
| wire-ios-data-model/Tests/Source/Model/Observer/SearchUserObserverTests.swift | Updates helper to pass type through to ZMSearchUser. |
| wire-ios-data-model/Tests/Source/Model/Observer/SearchUserObserverCenterTests.swift | Updates helper to pass type through to ZMSearchUser. |
| wire-ios-data-model/Source/Model/User/ZMSearchUser.swift | Adds internal user type + summary, ObjC wrapper for type, and app/bot detection. |
| wire-ios-data-model/Source/Model/User/UserType.swift | Extends UserType with teamIdentifier and appInfo to support apps. |
| wire-ios-data-model/Source/Model/Teams/Team.swift | Adds server-side type filtering to team member search. |
| WireNetwork/Tests/WireNetworkTests/APIs/Rest/TeamsAPI/Snapshots/TeamsAPITests/testGetApp_givenV14AndAbove_AndSuccessResponse200_thenSucceeds.request-0-v15.txt | Removes obsolete app endpoint request snapshot for V14/V15 loop. |
| WireNetwork/Tests/WireNetworkTests/APIs/Rest/TeamsAPI/Snapshots/TeamsAPITests/testGetApp_givenV14AndAbove_AndSuccessResponse200_thenSucceeds.request-0-v14.txt | Removes obsolete app endpoint request snapshot for V14/V15 loop. |
| WireNetwork/Tests/WireNetworkTests/APIs/Rest/TeamsAPI/Snapshots/TeamsAPITests/testGetApp_FailureResponse_AppFound_V14AndAbove.request-0-v15.txt | Removes obsolete app endpoint error snapshot for V14/V15 loop. |
| WireNetwork/Tests/WireNetworkTests/APIs/Rest/TeamsAPI/Snapshots/TeamsAPITests/testGetApp_FailureResponse_AppFound_V14AndAbove.request-0-v14.txt | Removes obsolete app endpoint error snapshot for V14/V15 loop. |
| WireNetwork/Tests/WireNetworkTests/APIs/Rest/TeamsAPI/TeamsAPITests.swift | Removes deprecated V14 get-app tests. |
| WireNetwork/Tests/WireNetworkTests/APIs/Rest/TeamsAPI/Resources/GetAppSuccessResponseV14.json | Removes deprecated V14 response fixture. |
| WireNetwork/Sources/WireNetwork/Models/Team/TmpApp.swift | Removes temporary app model used only by deprecated V14 endpoint. |
| WireNetwork/Sources/WireNetwork/APIs/Rest/TeamsAPI/TeamsAPIV14.swift | Removes V14 app endpoint implementation. |
| WireNetwork/Sources/WireNetwork/APIs/Rest/TeamsAPI/TeamsAPIV0.swift | Removes unsupported get-app stub from base API. |
| WireNetwork/Sources/WireNetwork/APIs/Rest/TeamsAPI/TeamsAPIError.swift | Removes app-not-found error for deleted endpoint. |
| WireNetwork/Sources/WireNetwork/APIs/Rest/TeamsAPI/TeamsAPI.swift | Removes get-app from TeamsAPI protocol. |
| WireData/Tests/WireDataTests/WireDataTests.swift | Replaces placeholder test with a UI delegate protocol (likely misplaced). |
Comments suppressed due to low confidence (5)
wire-ios/Wire-iOS/Sources/UserInterface/Services/ServiceDetailViewController.swift:1
- The app/bot branches appear inverted:
isLegacyBotis set fromuser.isBot, so!service.isLegacyBotcorresponds to an app, but it callsopenConversationWithBot, and vice versa. Swap these calls so apps useopenConversationWithApp(...)and legacy bots useopenConversationWithBot(...).
wire-ios/Wire-iOS/Sources/UserInterface/StartUI/StartUI/SearchResultsViewController.swift:1 - Apps represented as
ZMSearchUser(or any non-ZMUserconformingUserType) will fall intouser.isAppOrBotand be reported asdidTapOnBot, even whenuser.isApp == true. This breaks downstream flows that distinguish app vs bot (e.g., AddParticipants chooses.addAppvs.addBot). Route based onuser.isApp/user.isBotrather than onlyZMUser.type.
wire-ios/Wire-iOS/Sources/UserInterface/AddContacts/AddParticipantsViewController.swift:1 - This behavior used to apply to the old
.servicestab; after splitting into.appsand.bots, the same UX issue applies to the.botsgroup as well. Update the condition to clear input/hide confirm when switching to either.appsor.bots.
wire-ios-data-model/Tests/Source/Model/UserTypeTests+Materialize.swift:1 - The helper accepts a
typeparameter but always passestype: .regulartoZMSearchUser, ignoring the argument. This makes it impossible for tests to create.app/.botsearch users and can mask issues. Pass thetypeparameter through to the initializer.
//
wire-ios-sync-engine/Tests/Source/SessionManager/URLActionTests.swift:1
- The test name
testThatItis non-descriptive and doesn’t convey the behavior under test. Rename it to reflect what’s asserted (e.g., parsing awire://connect?...URL into.connectBot(providerID:serviceID:)).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…h-for-apps-WPB-20362
|



Issue
This PR adds support for searching apps to the search UI.
Testing
Have a team with MLS and apps enabled, add apps to the team and observe that apps are listed and filtered in the search UI.
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: