-
Notifications
You must be signed in to change notification settings - Fork 927
[PM-26095] Add account selection screen for Credential Exchange #5932
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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5932 +/- ##
==========================================
+ Coverage 84.26% 84.28% +0.01%
==========================================
Files 713 717 +4
Lines 53690 53899 +209
Branches 7401 7416 +15
==========================================
+ Hits 45244 45429 +185
- Misses 5851 5864 +13
- Partials 2595 2606 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
46c1b67 to
5877d24
Compare
5877d24 to
5effc5c
Compare
...kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountScreen.kt
Show resolved
Hide resolved
...kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountScreen.kt
Show resolved
Hide resolved
...kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountScreen.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountScreen.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountScreen.kt
Outdated
Show resolved
Hide resolved
5946e5c to
b7037f6
Compare
| */ | ||
| @OptIn(ExperimentalMaterial3Api::class) | ||
| @Composable | ||
| fun ExportItemsScaffold( |
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.
Does this buy us much?
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.
Not sure what you mean.
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 it worth the custom component to wrap the toolbar?
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.
Ah... buy us much. Got it.
It saves us from duplicating everything but the title and nav icon in every screen. Plus it makes the screens easier to consume (as a lowly human 🤖 ).
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.
Sorry about the typo... I fixed it 😄
Fair enough, carry on
...kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountScreen.kt
Outdated
Show resolved
Hide resolved
...lin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountViewModel.kt
Outdated
Show resolved
Hide resolved
| * - "First" -> "FI" | ||
| * - name is `null`, email is "test@bitwarden.com" -> "TE" | ||
| */ | ||
| val UserState.Account.initials: 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.
Doesn't this already exist?
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.
Not as an extension of UserState.Account. The other one is an extension of AccountSummary.
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.
Hmmm, it looks like this exists for the AccountSummary not the UserState.Account.
Do we need more data than the AccountSummary provides?
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, we need different data entirely.
data class AccountSelectionListItem(
val userId: String,
val isItemRestricted: Boolean,
val avatarColorHex: String,
val initials: String,
val email: String,
) : Parcelable
compared to the heavier
@Parcelize
data class AccountSummary(
val userId: String,
val name: String?,
val email: String,
val avatarColorHex: String,
val environmentLabel: String,
val isActive: Boolean,
val isLoggedIn: Boolean,
val isVaultUnlocked: Boolean,
) : Parcelable {
// other stuff omitted
}
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.
Sounds good!
b7037f6 to
b55f0cf
Compare
This commit introduces a new screen that allows users to select an account when importing items via the Credential Exchange Framework (CXF). When a Credential Exchange import request is received the user is prompted to confirm which account to export items from. Should the user choose to close the screen, the export process will be cancelled and the user returned to the requesting application. Key changes include: - Added `SelectAccountScreen.kt` for the UI of the account selection. - Added `SelectAccountViewModel.kt` to manage the state and logic for account selection. - Added `ExportItemsScaffold` a reusable scaffold for the export items screens. - Included `AccountSelectionListItem.kt` to model the items displayed in the account list. - Implemented `SelectAccountHandlers.kt` to manage user interactions on the screen. - Added unit tests for the new screen (`SelectAccountScreenTest.kt`) and view model (`SelectAccountViewModelTest.kt`). - Added new string resources for the account selection screen. - Updated `BitwardenComposeTest.kt` and `LocalManagerProvider.kt` to include `CredentialExchangeCompletionManager`.
b55f0cf to
0795385
Compare

🎟️ Tracking
PM-26095
📔 Objective
This commit introduces a new screen that allows users to select an account when importing items via the Credential Exchange Framework (CXF).
When a Credential Exchange import request is received the user is prompted to confirm which account to export items from.
Should the user choose to close the screen, the export process will be cancelled and the user returned to the requesting application.
Key changes include:
SelectAccountScreen.ktfor the UI of the account selection.SelectAccountViewModel.ktto manage the state and logic for account selection.AccountSelectionListItem.ktto model the items displayed in the account list.SelectAccountHandlers.ktto manage user interactions on the screen.SelectAccountScreenTest.kt) and view model (SelectAccountViewModelTest.kt).BitwardenComposeTest.ktandLocalManagerProvider.ktto includeCredentialExchangeCompletionManager.📸 Screenshots
⏰ 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