-
Notifications
You must be signed in to change notification settings - Fork 927
[PM-26110] Add verify password screen for item export #5935
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
|
New Issues (1)Checkmarx found the following issues in this Pull Request
|
5946e5c to
82886e3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5935 +/- ##
==========================================
+ Coverage 84.30% 84.36% +0.05%
==========================================
Files 721 725 +4
Lines 54077 54432 +355
Branches 7436 7478 +42
==========================================
+ Hits 45591 45920 +329
- Misses 5877 5895 +18
- Partials 2609 2617 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b7037f6 to
b55f0cf
Compare
82886e3 to
80a30bb
Compare
b55f0cf to
0795385
Compare
fb4eeba to
9eada31
Compare
...m/x8bit/bitwarden/ui/vault/feature/exportitems/verifypassword/VerifyPasswordViewModelTest.kt
Dismissed
Show dismissed
Hide dismissed
9eada31 to
73849a6
Compare
0a4dd22 to
b731a50
Compare
| showPasswordTestTag = "PasswordVisibilityToggle", | ||
| imeAction = ImeAction.Done, | ||
| keyboardActions = KeyboardActions( | ||
| onDone = remember { { onUnlockClick() } }, |
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 this just be:
onDone = onUnlockClick,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.
Actually, we need to verify that this is an action they are allowed to take. Something like this:
onDone = {
if (isUnlockButtonEnabled) {
onUnlockClick()
} else {
defaultKeyboardAction(ImeAction.Done)
}
}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.
No, because onDone isn't a parameterless lambda.
val onDone: (KeyboardActionScope.() -> Unit)? = null,b731a50 to
5e3aceb
Compare
| .userStateFlow | ||
| .value | ||
| ?.accounts | ||
| ?.firstOrNull { it.userId == args.userId } |
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.
So this screen can be displayed for the non-active user?
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.
Yes
| @Serializable(with = VerifyPasswordRoute.Serializer::class) | ||
| @OmitFromCoverage | ||
| data class VerifyPasswordRoute( | ||
| val userId: String, |
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 you explain this a bit more? I would expect the screen to be displayed for the active user and switch the user if needed. Specifying the userId could lead to a misconfiguration that the repositories are not equipped to deal with since they assume the active user when doing most operations.
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.
This informs the screen which account's password needs to be verified. Account switching does take place prior to performing password validation, if it's needed.
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.
If the account switching already happened, do we need this value?
Can we just use the activeAccount?
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.
Discussed offline and improved documentation.
Since account switching can be a costly operation when the vault is already unlocked, switching is deferred until absolutely necessary to perform password verification. This eliminates unnecessary account switching when the user navigates between Select Account and Verify Password screens.
5e3aceb to
35f3ff8
Compare
| if (state.isUnlockButtonEnabled) { | ||
| onUnlockClick() | ||
| } else { | ||
| defaultKeyboardAction(ImeAction.Done) |
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.
👍
This commit introduces the verify password screen as part of the item export flow. After selecting an account, the user is prompted to verify their password before any items can be exported. It includes: - `VerifyPasswordNavigation.kt`: Navigation logic for the verify password screen. - `VerifyPasswordViewModel.kt`: ViewModel for the verify password screen, handling password validation and account switching if necessary. - `VerifyPasswordScreen.kt`: Composable UI for the verify password screen. - `VerifyPasswordHandler.kt`: Handler for user interactions on the verify password screen. - Updates to `ExportItemsNavigation.kt` to integrate the verify password screen into the export flow. - Updates to `RootNavScreen.kt` to pass the `navController` to `exportItemsGraph`.
35f3ff8 to
51db52c
Compare


🎟️ Tracking
PM-26110
📔 Objective
This commit introduces the verify password screen as part of the item export flow.
After selecting an account, the user is prompted to verify their password before any items can be exported.
It includes:
VerifyPasswordNavigation.kt: Navigation logic for the verify password screen.VerifyPasswordViewModel.kt: ViewModel for the verify password screen, handling password validation and account switching if necessary.VerifyPasswordScreen.kt: Composable UI for the verify password screen.VerifyPasswordHandler.kt: Handler for user interactions on the verify password screen.ExportItemsNavigation.ktto integrate the verify password screen into the export flow.RootNavScreen.ktto pass thenavControllertoexportItemsGraph.📸 Screenshots
Coming soon!
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes