Skip to content

refactor: extract user search into module [WPB-25049]#4956

Merged
saleniuk merged 10 commits into
developfrom
refactor/user-search-into-dedicated-module
Jun 11, 2026
Merged

refactor: extract user search into module [WPB-25049]#4956
saleniuk merged 10 commits into
developfrom
refactor/user-search-into-dedicated-module

Conversation

@saleniuk

@saleniuk saleniuk commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-25049


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

User search logic is inside our app module which makes it unusable by other modules.

Solutions

Extracted everything needed for the user search into a dedicated core/search module, so that it can be re-used by other modules.
The PR mainly contains moving classes, ViewModels and Composables related to user searches to a separate module, but it also includes some other changes required to make it work:

  • ViewModelScoped moved to common module so that it can be also used in other modules, so the part related to ViewModelScopedPreviews, which are generated by ksp, is changed to be a parameter for these functions, so that in each module previews from that module can be passed as a PreviewProvider
  • SearchUsersAndAppsScreen parameters got simplified, removed types so that it's more versatile now and bottom actions extracted out of that composable, so there's no need to pass lambdas that are used by only one specific type
  • some utility classes like CustomTabsHelper, VisibilityState or WireSnackbar finally moved to common module as well

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Search for users when creating a new conversation or adding to existing conversation.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@pull-request-size

Copy link
Copy Markdown

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

@saleniuk saleniuk requested a review from a team as a code owner June 10, 2026 10:00
@saleniuk saleniuk requested review from Garzas, MohamadJaara, alexandreferris, sbakhtiarov and typfel and removed request for a team June 10, 2026 10:00
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.03509% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.02%. Comparing base (e764421) to head (e8514af).

⚠️ Current head e8514af differs from pull request most recent head 1953de0

Please upload reports for the commit 1953de0 to get more accurate results.

Files with missing lines Patch % Lines
.../com/wire/android/search/SearchViewModelFactory.kt 0.00% 32 Missing ⚠️
...erprofile/other/OtherUserProfileInfoMessageType.kt 0.00% 10 Missing ⚠️
...wire/android/mapper/MessagePreviewContentMapper.kt 0.00% 1 Missing ⚠️
...wire/android/mapper/RegularMessageContentMapper.kt 0.00% 1 Missing ⚠️
...dia/audiomessage/ConversationAudioMessagePlayer.kt 0.00% 1 Missing ⚠️
...in/com/wire/android/ui/home/HomeSnackBarMessage.kt 50.00% 1 Missing ⚠️
...me/conversations/info/ConversationInfoViewModel.kt 0.00% 0 Missing and 1 partial ⚠️
...ome/conversationslist/ConversationListViewModel.kt 0.00% 1 Missing ⚠️
...in/com/wire/android/search/SearchViewModelGraph.kt 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (14.03%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4956      +/-   ##
===========================================
- Coverage    49.09%   49.02%   -0.07%     
===========================================
  Files          643      648       +5     
  Lines        23014    22876     -138     
  Branches      3518     3501      -17     
===========================================
- Hits         11298    11216      -82     
+ Misses       10669    10616      -53     
+ Partials      1047     1044       -3     
Files with missing lines Coverage Δ
...tlin/com/wire/android/mapper/ConversationMapper.kt 53.17% <ø> (ø)
...in/kotlin/com/wire/android/mapper/MessageMapper.kt 62.38% <100.00%> (ø)
...in/kotlin/com/wire/android/mapper/UIAssetMapper.kt 80.00% <ø> (ø)
...alling/ongoing/participantsview/ParticipantTile.kt 0.00% <ø> (ø)
...ations/ConversationSearchFolderViewModelFactory.kt 0.00% <ø> (ø)
...rsations/ConversationSearchFolderViewModelGraph.kt 0.00% <ø> (ø)
.../ui/home/conversations/MessageComposerViewState.kt 86.48% <ø> (ø)
.../home/conversations/ScopedMessageViewModelGraph.kt 0.00% <ø> (ø)
...s/participants/GroupConversationParticipantList.kt 0.00% <ø> (ø)
...id/ui/home/conversations/messages/QuotedMessage.kt 0.00% <ø> (ø)
... and 36 more

... and 23 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e764421...1953de0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread crowdin.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saleniuk added 4 commits June 10, 2026 15:35
…ch-into-dedicated-module

# Conflicts:
#	app/src/main/kotlin/com/wire/android/di/metro/AppSessionViewModelGraph.kt
#	app/src/main/kotlin/com/wire/android/ui/common/CommonViewModelFactory.kt
#	app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationSearchFolderViewModelGraph.kt
#	app/src/main/kotlin/com/wire/android/ui/home/conversations/ScopedMessageViewModelGraph.kt
#	app/stability/app-devDebug.stability
#	core/di/src/main/kotlin/com/wire/android/di/ViewModelScoped.kt
#	core/di/src/main/kotlin/com/wire/android/di/metro/MetroViewModelGraph.kt
#	core/di/stability/di-debug.stability
@sonarqubecloud

Copy link
Copy Markdown

@saleniuk saleniuk added this pull request to the merge queue Jun 11, 2026
Merged via the queue into develop with commit 6d486f9 Jun 11, 2026
19 of 20 checks passed
@saleniuk saleniuk deleted the refactor/user-search-into-dedicated-module branch June 11, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants