Skip to content

refactor: UI common metro boundary [WPB-23495]#4875

Merged
Garzas merged 6 commits into
developfrom
refactor/ui-common-metro-boundary
May 28, 2026
Merged

refactor: UI common metro boundary [WPB-23495]#4875
Garzas merged 6 commits into
developfrom
refactor/ui-common-metro-boundary

Conversation

@Garzas

@Garzas Garzas commented May 27, 2026

Copy link
Copy Markdown
Contributor

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


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

Summary

This PR extracts the core:ui-common image asset ViewModel creation path away from Hilt and routes it through a small Metro-compatible ViewModel graph boundary.

It is part of the broader incremental Metro migration and keeps the runtime behavior unchanged while removing direct Hilt dependencies from core:ui-common.

Changes

  • Removed the Hilt plugin and Hilt/resaca-hilt dependencies from core:ui-common.
  • Replaced hiltViewModel<RemoteAssetImageViewModel>() in ImageAsset.Remote.paint() with a local Metro ViewModel graph lookup.
  • Added ImageAssetViewModelFactory for constructing RemoteAssetImageViewModel.
  • Added a generic MetroViewModelGraph / metroViewModel helper in core:di.
  • Provided an app-level transitional ImageAssetViewModelGraphProvider through the existing Compose roots:
    • WireActivity
    • CallActivity
    • AppLockActivity
  • Added a small Hilt bridge for FileSizeFormatter, because some existing Hilt ViewModels still inject it while ui-common no longer owns Hilt wiring.
  • Enabled the Compose compiler plugin for core:ui-common-kmp.

Why

core:ui-common is one of the modules we want to make easier to reuse/migrate toward KMP and Compose Multiplatform. Direct Hilt usage in shared UI utilities blocks that direction and also makes the later Metro migration harder to split into reviewable PRs.

This PR keeps Hilt at the app boundary for now, but removes it from the ui-common image loading path.

@Garzas Garzas self-assigned this May 27, 2026
@Garzas Garzas requested a review from a team as a code owner May 27, 2026 06:08
@Garzas Garzas requested review from alexandreferris and ohassine and removed request for a team May 27, 2026 06:08
@pull-request-size pull-request-size Bot added size/S and removed size/L labels May 27, 2026
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.87%. Comparing base (3339c30) to head (9771af9).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
...m/wire/android/model/ImageAssetViewModelFactory.kt 0.00% 3 Missing ⚠️
...c/main/kotlin/com/wire/android/model/ImageAsset.kt 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) 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    #4875      +/-   ##
===========================================
- Coverage    51.88%   51.87%   -0.02%     
===========================================
  Files          613      614       +1     
  Lines        21289    21297       +8     
  Branches      3414     3417       +3     
===========================================
+ Hits         11045    11047       +2     
- Misses        9223     9226       +3     
- Partials      1021     1024       +3     
Files with missing lines Coverage Δ
...rc/main/kotlin/com/wire/android/ui/WireActivity.kt 0.00% <ø> (ø)
.../kotlin/com/wire/android/util/FileSizeFormatter.kt 0.00% <ø> (ø)
...c/main/kotlin/com/wire/android/model/ImageAsset.kt 68.18% <0.00%> (+2.96%) ⬆️
...m/wire/android/model/ImageAssetViewModelFactory.kt 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes


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 3339c30...9771af9. Read the comment docs.

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

@sonarqubecloud

Copy link
Copy Markdown

@Garzas Garzas added this pull request to the merge queue May 28, 2026
Merged via the queue into develop with commit 435996f May 28, 2026
18 of 19 checks passed
@Garzas Garzas deleted the refactor/ui-common-metro-boundary branch May 28, 2026 05:13
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.

3 participants