-
Notifications
You must be signed in to change notification settings - Fork 927
[PM-25825] Add ImportItems navigation #5915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
β¦Vault screen This commit refactors the navigation flow by removing the direct navigation options to "My Vault" and "Import Items" from the main Vault screen and related areas. Specific changes include: - Removed `onNavigateToMyVault` and `onNavigateToImportItems` parameters and their usages from `VaultNavigation.kt`, `VaultScreen.kt`, `VaultGraphNavigation.kt`, and `VaultUnlockedNavBarScreen.kt`. - Removed `NavigateToMyVault` and `NavigateToImportItems` events from `VaultViewModel.kt`. - Updated `ImportItemsNavigation.kt` to rename `navigateToImportItemsGraph` to `navigateToImportItemsScreen` and removed `onNavigateToMyVault` from `importItemsDestination`. - Modified `ImportItemsViewModel.kt` and `ImportItemsScreen.kt` to handle sync failures with a "Try Again" option and display snackbars for import/sync status, removing the automatic navigation to the vault after import. - Adjusted tests in `ImportItemsViewModelTest.kt`, `ImportItemsScreenTest.kt`, and `VaultUnlockedNavBarScreenTest.kt` to reflect these navigation and UI changes. - Updated `SettingsNavigation.kt` to remove `onNavigateToMyVault` parameter from `settingsGraph`. - Removed `navigateToVaultGraphRoot` from `VaultGraphNavigation.kt`.
This commit refactors the navigation to the import logins screen. The `onNavigateToImportLogins` parameter is now passed down from the `settingsGraph` to the `importItemsDestination`. This makes the navigation more explicit and easier to follow.
This commit removes an unused import of `NavHostController` from `VaultUnlockedNavBarNavigation.kt`.
| data = BitwardenSnackbarData( | ||
| message = BitwardenString.syncing_complete.asText(), | ||
| ), | ||
| relay = SnackbarRelay.LOGINS_IMPORTED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this VM sending this to itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just send the ShowBasicSnackbar event here?
| onNavigateToFolders = { onNavigateToFoldersCalled = true }, | ||
| onNavigateToImportLogins = { onNavigateToImportLoginsCalled = true }, | ||
| onNavigateToImportItems = { onNavigateToImportItemsCalled = true }, | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we drop this newline
| private fun createViewModel(): VaultSettingsViewModel = VaultSettingsViewModel( | ||
| firstTimeActionManager = firstTimeActionManager, | ||
| snackbarRelayManager = snackbarRelayManager, | ||
| featureFlagManager = featureFlagManager, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a test for when the flag is set or not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed!
| message = BitwardenString | ||
| .your_items_have_been_successfully_imported_but_could_not_sync_vault | ||
| .asText(), | ||
| actionLabel = BitwardenString.try_again.asText(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here, would this event be needed anywhere. I assume that if the import process fails, we would not navigate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Now that we're not navigating we can trigger these locally. π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet, same thing for the failure too, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. We no longer need the snackbar relay manager or the VAULT_SYNC_FAILURE either, since everything is contained in the VM.
This commit refactors the `ImportItemsViewModel` to remove its dependency on `SnackbarRelayManager`. Snackbar events are now sent directly as `ImportItemsEvent`s. This change simplifies the ViewModel's logic and removes the need for `SnackbarRelayManager` in this context. Tests have been updated to reflect these changes. #5915 (comment)
The `ImportItemsClick` action in `VaultSettingsViewModelTest` now checks the `CredentialExchangeProtocolImport` feature flag. - If the flag is disabled, it emits `NavigateToImportVault`. - If the flag is enabled, it emits `NavigateToImportItems`. #5915 (comment)
This commit removes an unnecessary blank line from the `VaultSettingsScreenTest.kt` file. #5915 (comment)
| LOGINS_IMPORTED, | ||
| SEND_DELETED, | ||
| SEND_UPDATED, | ||
| VAULT_SYNC_FAILED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
Codecov Reportβ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5915 +/- ##
==========================================
+ Coverage 84.23% 84.25% +0.01%
==========================================
Files 729 713 -16
Lines 54011 53671 -340
Branches 7389 7395 +6
==========================================
- Hits 45497 45221 -276
+ Misses 5912 5854 -58
+ Partials 2602 2596 -6 β View full report in Codecov by Sentry. π New features to boost your workflow:
|

ποΈ Tracking
PM-25825
π Objective
Implement navigation for the Import items screen.
Upon completion of the import process a Snackbar or Dialog is displayed to inform the user of the result.
If the import and re-sync is successful a Snackbar is displayed, informing the user how many items were imported.
If the import is successful but sync fails, a Snackbar is displayed, along with an option to retry sync.
If the import process cannot complete, a dialog is displayed prompting the user to try again or contact support.
Additionally, the
VAULT_SYNC_FAILEDSnackbar relay has been removed as it is no longer necessary.πΈ Screenshots
Screen_recording_20250922_152043.mp4