Skip to content

Conversation

@shobhitagarwal1612
Copy link
Member

@shobhitagarwal1612 shobhitagarwal1612 commented Jan 19, 2026

Towards #1795

Similar to #3461, this PR aims at moving remaining business logic from the fragment to it's compose screen.

This would allow us to later switch to Jetpack Compose Navigation to allow for screens to be reused for iOS without having to maintain separate view screens for iOS.

Screen_recording_20260121_105250.webm

@andreia-ferreira PTAL?

- Move startup initialization logic from `StartupFragment` to a new `StartupScreen` Composable.
- Migrate error handling and progress dialog management from `StartupFragment` to `StartupViewModel` and `StartupScreen`.
- Update `StartupViewModel` and `SignInViewModel` to use `@HiltViewModel` and remove manual bindings in `ViewModelModule`.
* Migrate `SignInViewModel` to use `@HiltViewModel`.
* Move network error and loading state logic from `SignInFragment` to `SignInScreen` using `collectAsStateWithLifecycle`.
* Implement `SnackbarHost` and `LoadingDialog` within the Compose `SignInScreen`.
* Remove manual ViewModel instantiation and snackbar handling from `SignInFragment`.
* Update `ViewModelModule` to remove manual binding for `SignInViewModel`.
The sign-in progress bar is now controlled by `SignInScreen`, so the
`MainActivity`-managed modal spinner and associated logic are no longer
needed.
@shobhitagarwal1612 shobhitagarwal1612 changed the title Move business logic for SignInFragment to SignInScreen Compose Move logic from SignInFragment to SignInScreen Jan 19, 2026
@shobhitagarwal1612 shobhitagarwal1612 marked this pull request as ready for review January 19, 2026 16:32
@auto-assign auto-assign bot requested a review from anandwana001 January 19, 2026 16:33
Copy link
Collaborator

@andreia-ferreira andreia-ferreira left a comment

Choose a reason for hiding this comment

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

looks good! Just a small suggestion

The progress bar is now controlled by the `SignInScreen`, making the `OnUserSigningIn` UI state redundant.
Removes manual check for sign-in state and network availability before calling `userRepository.signIn()`.
The test case "Sign-in button should be enabled when network is not available" is removed as manual network availability checks have been moved out of the UI layer.
The sign-in progress dialog is no longer managed by `MainActivity`, making these tests obsolete.
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 81.48148% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.02%. Comparing base (359928f) to head (9d49150).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...g/groundplatform/android/ui/signin/SignInScreen.kt 82.35% 6 Missing and 3 partials ⚠️
.../groundplatform/android/system/auth/SignInState.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3462      +/-   ##
============================================
- Coverage     70.07%   70.02%   -0.06%     
+ Complexity     1613     1604       -9     
============================================
  Files           322      322              
  Lines          8634     8646      +12     
  Branches        951      949       -2     
============================================
+ Hits           6050     6054       +4     
- Misses         2007     2017      +10     
+ Partials        577      575       -2     
Files with missing lines Coverage Δ
...org/groundplatform/android/ui/main/MainActivity.kt 44.44% <ø> (-3.65%) ⬇️
.../org/groundplatform/android/ui/main/MainUiState.kt 100.00% <ø> (ø)
...rg/groundplatform/android/ui/main/MainViewModel.kt 62.66% <100.00%> (-1.34%) ⬇️
...groundplatform/android/ui/signin/SignInFragment.kt 71.42% <100.00%> (-16.08%) ⬇️
.../groundplatform/android/system/auth/SignInState.kt 80.00% <0.00%> (-20.00%) ⬇️
...g/groundplatform/android/ui/signin/SignInScreen.kt 88.29% <82.35%> (+2.02%) ⬆️

... and 1 file with indirect coverage changes

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

@shobhitagarwal1612 shobhitagarwal1612 merged commit 846344b into master Jan 21, 2026
7 checks passed
@shobhitagarwal1612 shobhitagarwal1612 deleted the compose-signinfragment branch January 21, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants