Skip to content

refactor: remaining viewmodels metro boundary [WPB-25946]#4915

Merged
Garzas merged 9 commits into
developfrom
refactor/remaining-viewmodels-metro-boundary
Jun 3, 2026
Merged

refactor: remaining viewmodels metro boundary [WPB-25946]#4915
Garzas merged 9 commits into
developfrom
refactor/remaining-viewmodels-metro-boundary

Conversation

@Garzas

@Garzas Garzas commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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


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?

This PR continues the Android ViewModel migration from Hilt call sites to the Metro-backed ViewModel graph.

Main changes:

  • migrates remaining conversation ViewModels to explicit Metro factory helpers
  • migrates misc ViewModels through MiscViewModelGraph
  • localizes NewConversationViewModel ownership instead of passing it through MainNavHost
  • adds CommonViewModelFactory / CommonViewModelGraph for common UI ViewModels
  • migrates common media/gallery/location/message media ViewModels to Metro helper functions
  • removes Hilt annotations and assisted factories from the migrated ViewModels

Why?

This removes another large part of the Hilt ViewModel surface before the final session-scoped Metro graph work.

The migration keeps the same factory ownership model, but moves ViewModel creation behind explicit graph contracts. That makes the remaining work smaller and prepares the app for replacing the temporary Hilt bridge with a real session-scoped Metro graph.

@Garzas Garzas requested review from MohamadJaara and saleniuk June 2, 2026 22:55
@Garzas Garzas self-assigned this Jun 2, 2026
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.68182% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.63%. Comparing base (9142eb0) to head (42f69fb).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
.../conversations/ConversationCoreViewModelFactory.kt 0.00% 67 Missing ⚠️
...n/com/wire/android/ui/home/HomeViewModelFactory.kt 0.00% 14 Missing ⚠️
...versations/media/preview/ImagesPreviewViewModel.kt 0.00% 1 Missing ⚠️
...rsations/messagedetails/MessageDetailsViewModel.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4915      +/-   ##
===========================================
- Coverage    49.81%   49.63%   -0.18%     
===========================================
  Files          630      630              
  Lines        22451    22530      +79     
  Branches      3427     3427              
===========================================
- Hits         11183    11182       -1     
- Misses       10231    10311      +80     
  Partials      1037     1037              
Files with missing lines Coverage Δ
...rc/main/kotlin/com/wire/android/ui/WireActivity.kt 0.00% <ø> (ø)
...re/android/ui/connection/ConnectionActionButton.kt 0.00% <ø> (ø)
...d/ui/connection/ConnectionActionButtonViewModel.kt 73.78% <100.00%> (ø)
...onversations/banner/ConversationBannerViewModel.kt 56.52% <ø> (ø)
...me/conversations/info/ConversationInfoViewModel.kt 80.24% <100.00%> (ø)
...ations/media/ConversationAssetMessagesViewModel.kt 0.00% <ø> (ø)
...ations/messages/QuotedMultipartMessageViewModel.kt 88.88% <100.00%> (ø)
...messagetypes/multipart/MultipartAttachmentsView.kt 0.00% <ø> (ø)
...getypes/multipart/MultipartAttachmentsViewModel.kt 52.80% <100.00%> (ø)
...e/android/ui/home/gallery/MediaGalleryViewModel.kt 63.46% <ø> (ø)
... and 6 more

Continue to review full report in Codecov by Sentry.

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

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

@sonarqubecloud

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@Garzas Garzas merged commit ef9477a into develop Jun 3, 2026
13 of 14 checks passed
@Garzas Garzas deleted the refactor/remaining-viewmodels-metro-boundary branch June 3, 2026 07:54
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.

2 participants