Skip to content

refactor: prepare Android ViewModel creation boundary [WPB-23495]#4868

Merged
Garzas merged 3 commits into
developfrom
refactor/android-viewmodel-creation-boundary
May 27, 2026
Merged

refactor: prepare Android ViewModel creation boundary [WPB-23495]#4868
Garzas merged 3 commits into
developfrom
refactor/android-viewmodel-creation-boundary

Conversation

@Garzas

@Garzas Garzas commented May 25, 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

What's new in this PR?

Summary

Prepares the old login ViewModel creation boundary for the Metro migration.

This PR removes direct SavedStateHandle.navArgs() usage from the old login base/email/SSO ViewModels and passes LoginNavArgs explicitly through assisted ViewModel creation. It also moves saved login input persistence behind a small LoginSavedInputStore boundary so the ViewModels no longer own the Android saved-state mechanism directly.

Changes

  • Add wireViewModel(...) helpers for assisted Hilt ViewModel creation from Compose.
  • Change LoginViewModel, LoginEmailViewModel, and LoginSSOViewModel to receive explicit LoginNavArgs.
  • Add LoginSavedInputStore and SavedStateLoginSavedInputStore.
  • Update old login and new-login password call sites to create assisted LoginEmailViewModel / LoginSSOViewModel with nav args.
  • Keep SSO Nomad behavior intact while moving auto-login args handling out of direct SavedStateHandle.navArgs() reads.

Base automatically changed from chore/metro-build-infrastructure to develop May 26, 2026 13:53
@Garzas Garzas requested a review from a team as a code owner May 26, 2026 13:53
@Garzas Garzas requested review from alexandreferris and emmaoke-w and removed request for a team May 26, 2026 13:53
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.88%. Comparing base (de8e06d) to head (ee0ac8a).

Files with missing lines Patch % Lines
...d/ui/authentication/login/sso/LoginSSOViewModel.kt 81.08% 4 Missing and 3 partials ⚠️
...entication/login/SavedStateLoginSavedInputStore.kt 85.71% 1 Missing ⚠️
.../authentication/login/email/LoginEmailViewModel.kt 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4868      +/-   ##
===========================================
+ Coverage    51.86%   51.88%   +0.01%     
===========================================
  Files          612      613       +1     
  Lines        21270    21288      +18     
  Branches      3413     3414       +1     
===========================================
+ Hits         11032    11045      +13     
- Misses        9219     9222       +3     
- Partials      1019     1021       +2     
Files with missing lines Coverage Δ
.../android/ui/authentication/login/LoginViewModel.kt 51.72% <ø> (-10.44%) ⬇️
...entication/login/SavedStateLoginSavedInputStore.kt 85.71% <85.71%> (ø)
.../authentication/login/email/LoginEmailViewModel.kt 78.68% <83.33%> (+0.11%) ⬆️
...d/ui/authentication/login/sso/LoginSSOViewModel.kt 72.48% <81.08%> (+0.55%) ⬆️

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 de8e06d...ee0ac8a. Read the comment docs.

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

@Garzas Garzas added this pull request to the merge queue May 27, 2026
Merged via the queue into develop with commit 3339c30 May 27, 2026
19 checks passed
@Garzas Garzas deleted the refactor/android-viewmodel-creation-boundary branch May 27, 2026 06:06
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