[PR #1909] [MERGED] SG-210 Account Switching in Autofill (iOS) #33714

Closed
opened 2026-04-21 01:26:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1909
Author: @fedemkr
Created: 5/16/2022
Status: Merged
Merged: 6/8/2022
Merged by: @fedemkr

Base: masterHead: SG-210-account-switching-autofill-ios


📝 Commits (10+)

  • d081816 SG-210 Set up account switching on Autofill iOS
  • eacd34f Merge branch 'master' into SG-210-account-switching-autofill-ios
  • 3b4706a Merge branch 'master' into SG-210-account-switching-autofill-ios
  • 8be702b Merge branch 'master' into SG-210-account-switching-autofill-ios
  • 502554e Merge branch 'master' into SG-210-account-switching-autofill-ios
  • 19b66f9 SG-210 Fix refresh after sync on autofill ciphers, also added account switching on lock view on autofill. Also fix possible crash when scrolling when no items were displayed and also fixed navigation when login in on an automatically logged out account.
  • 791cd9c SG-210 Added reference on iOS.Core project
  • 5785578 Merge branch 'master' into SG-210-account-switching-autofill-ios
  • 336c2a4 Fix formatting on AccountManager
  • 82ae440 Merge branch 'master' into SG-210-account-switching-autofill-ios

📊 Changes

24 files changed (+1507 additions, -424 deletions)

View changed files

📝 src/Android/MainApplication.cs (+10 -0)
src/App/Abstractions/IAccountsManager.cs (+12 -0)
src/App/Abstractions/IAccountsManagerHost.cs (+14 -0)
📝 src/App/App.csproj (+2 -0)
📝 src/App/App.xaml.cs (+47 -154)
📝 src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayView.xaml.cs (+3 -1)
src/App/Utilities/AccountManagement/AccountsManager.cs (+227 -0)
src/App/Utilities/AccountManagement/LockNavigationParams.cs (+14 -0)
src/App/Utilities/AccountManagement/LoginNavigationParams.cs (+14 -0)
src/Core/Enums/NavigationTarget.cs (+13 -0)
📝 src/iOS.Autofill/CredentialProviderViewController.cs (+61 -27)
📝 src/iOS.Autofill/LockPasswordViewController.cs (+23 -1)
📝 src/iOS.Autofill/LockPasswordViewController.designer.cs (+62 -47)
📝 src/iOS.Autofill/LoginListViewController.cs (+63 -11)
📝 src/iOS.Autofill/LoginListViewController.designer.cs (+81 -51)
📝 src/iOS.Autofill/MainInterface.storyboard (+212 -123)
📝 src/iOS.Autofill/Utilities/AutofillHelpers.cs (+1 -1)
src/iOS.Core/Controllers/BaseLockPasswordViewController.cs (+509 -0)
📝 src/iOS.Core/Controllers/LockPasswordViewController.cs (+2 -0)
src/iOS.Core/Utilities/AccountSwitchingOverlayHelper.cs (+69 -0)

...and 4 more files

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Add Account Switching in Autofill on iOS

Code changes

  • Android/MainApplication.cs: Added Account manager registration
  • AccountManager.cs: Added this class to handle navigation and message subscription regarding account (moved from App.xaml.cs given that now it's also needed from the iOS extensions). Also added params classes to pass data in the navigation process and the NavigationTarget enum to tell where it's supposed to go.
  • IAccountManagerHost.cs: Added this interface to be implemented on the hosts that perform the navigations regarding account flows
  • AccountSwitchingOverlayView.xaml.cs: Added flag to enable/disable LongPress on the account given that IMO on the extension it shouldn't be necessary and there is extra work to make it work on the extension.
  • CredentialProviderViewController.cs.cs: Implemented IAccountManagerHost and added AccountManager and handle navigation for that
  • Autofill/LockPasswordViewController.cs: Implemented account switching and changed the base class given that now we need a UIViewController to add the account switching overlay.
  • Autofill/LoginListViewController.cs.cs: Implemented account switching and changed the base class given that now we need a UIViewController to add the account switching overlay. Also, added syncCompleted message subscription to update the list after sync.
  • Autofill/MainInterface.storyboard: Changed Logins and Verify Master Password views to be UIViewController instead of UITableViewController to add the overlay.
  • iOS.Core/Controllers/BaseLockPasswordViewController.cs: Copy of LockPasswordViewController but with UIViewController as base instead of UITableViewController
  • iOS.Core/Controllers/LockPasswordViewController.cs: Set this as obsolete, left here for now given that's used on the other extensions. The plan is to change the other extensions to use the base one in next PRs.
  • AccountSwitchingOverlayHelper.cs: Added this helper to centralize account switching overlay creation, handling and avatar image toolbar.
  • ImageSourceExtensions.cs Added this to get the native image from an image source. Copied the code from Xamarin.Forms internal method.
  • iOSCoreHelpers.cs: Added AccountManager registration
  • ExtensionTableSource.cs: Added null checks to prevent crashes on scroll when list is empty

Screenshots

image Screen Shot 2022-06-03 at 19 15 39 Screen Shot 2022-06-03 at 19 16 53

Before you submit

  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1909 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 5/16/2022 **Status:** ✅ Merged **Merged:** 6/8/2022 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `master` ← **Head:** `SG-210-account-switching-autofill-ios` --- ### 📝 Commits (10+) - [`d081816`](https://github.com/bitwarden/android/commit/d081816572b97713b697977b97e076e0e94189fa) SG-210 Set up account switching on Autofill iOS - [`eacd34f`](https://github.com/bitwarden/android/commit/eacd34fad6c950b6a4a0b2f721e788eaebf5e044) Merge branch 'master' into SG-210-account-switching-autofill-ios - [`3b4706a`](https://github.com/bitwarden/android/commit/3b4706af373eaedfbd5cbc2a0dce2b65e878658a) Merge branch 'master' into SG-210-account-switching-autofill-ios - [`8be702b`](https://github.com/bitwarden/android/commit/8be702ba6ba31d11fefb91fe0b96a5f17122fb6c) Merge branch 'master' into SG-210-account-switching-autofill-ios - [`502554e`](https://github.com/bitwarden/android/commit/502554e619f65dc949d27c582e27bb409a928543) Merge branch 'master' into SG-210-account-switching-autofill-ios - [`19b66f9`](https://github.com/bitwarden/android/commit/19b66f9898a814a86f9a50a9a3222f111370bc9f) SG-210 Fix refresh after sync on autofill ciphers, also added account switching on lock view on autofill. Also fix possible crash when scrolling when no items were displayed and also fixed navigation when login in on an automatically logged out account. - [`791cd9c`](https://github.com/bitwarden/android/commit/791cd9cc9b973371c6738de25ebd747c6f1203d5) SG-210 Added reference on iOS.Core project - [`5785578`](https://github.com/bitwarden/android/commit/57855788e93737fcf48bb68721972a1f300ba342) Merge branch 'master' into SG-210-account-switching-autofill-ios - [`336c2a4`](https://github.com/bitwarden/android/commit/336c2a496e0adcd4e62240ec8d2055bc975ae56a) Fix formatting on AccountManager - [`82ae440`](https://github.com/bitwarden/android/commit/82ae44000179293ab0b9da234609f9ed7af5507b) Merge branch 'master' into SG-210-account-switching-autofill-ios ### 📊 Changes **24 files changed** (+1507 additions, -424 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/MainApplication.cs` (+10 -0) ➕ `src/App/Abstractions/IAccountsManager.cs` (+12 -0) ➕ `src/App/Abstractions/IAccountsManagerHost.cs` (+14 -0) 📝 `src/App/App.csproj` (+2 -0) 📝 `src/App/App.xaml.cs` (+47 -154) 📝 `src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayView.xaml.cs` (+3 -1) ➕ `src/App/Utilities/AccountManagement/AccountsManager.cs` (+227 -0) ➕ `src/App/Utilities/AccountManagement/LockNavigationParams.cs` (+14 -0) ➕ `src/App/Utilities/AccountManagement/LoginNavigationParams.cs` (+14 -0) ➕ `src/Core/Enums/NavigationTarget.cs` (+13 -0) 📝 `src/iOS.Autofill/CredentialProviderViewController.cs` (+61 -27) 📝 `src/iOS.Autofill/LockPasswordViewController.cs` (+23 -1) 📝 `src/iOS.Autofill/LockPasswordViewController.designer.cs` (+62 -47) 📝 `src/iOS.Autofill/LoginListViewController.cs` (+63 -11) 📝 `src/iOS.Autofill/LoginListViewController.designer.cs` (+81 -51) 📝 `src/iOS.Autofill/MainInterface.storyboard` (+212 -123) 📝 `src/iOS.Autofill/Utilities/AutofillHelpers.cs` (+1 -1) ➕ `src/iOS.Core/Controllers/BaseLockPasswordViewController.cs` (+509 -0) 📝 `src/iOS.Core/Controllers/LockPasswordViewController.cs` (+2 -0) ➕ `src/iOS.Core/Utilities/AccountSwitchingOverlayHelper.cs` (+69 -0) _...and 4 more files_ </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Add Account Switching in Autofill on iOS ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **Android/MainApplication.cs:** Added Account manager registration * **AccountManager.cs:** Added this class to handle navigation and message subscription regarding account (moved from App.xaml.cs given that now it's also needed from the iOS extensions). Also added params classes to pass data in the navigation process and the `NavigationTarget` enum to tell where it's supposed to go. * **IAccountManagerHost.cs:** Added this interface to be implemented on the hosts that perform the navigations regarding account flows * **AccountSwitchingOverlayView.xaml.cs:** Added flag to enable/disable LongPress on the account given that IMO on the extension it shouldn't be necessary and there is extra work to make it work on the extension. * **CredentialProviderViewController.cs.cs:** Implemented `IAccountManagerHost` and added `AccountManager` and handle navigation for that * **Autofill/LockPasswordViewController.cs:** Implemented account switching and changed the base class given that now we need a `UIViewController` to add the account switching overlay. * **Autofill/LoginListViewController.cs.cs:** Implemented account switching and changed the base class given that now we need a `UIViewController` to add the account switching overlay. Also, added `syncCompleted` message subscription to update the list after sync. * **Autofill/MainInterface.storyboard:** Changed `Logins` and `Verify Master Password` views to be `UIViewController` instead of `UITableViewController` to add the overlay. * **iOS.Core/Controllers/BaseLockPasswordViewController.cs:** Copy of `LockPasswordViewController` but with `UIViewController` as base instead of `UITableViewController` * **iOS.Core/Controllers/LockPasswordViewController.cs:** Set this as obsolete, left here for now given that's used on the other extensions. The plan is to change the other extensions to use the base one in next PRs. * **AccountSwitchingOverlayHelper.cs:** Added this helper to centralize account switching overlay creation, handling and avatar image toolbar. * **ImageSourceExtensions.cs** Added this to get the native image from an image source. Copied the code from Xamarin.Forms internal method. * **iOSCoreHelpers.cs:** Added `AccountManager` registration * **ExtensionTableSource.cs:** Added null checks to prevent crashes on scroll when list is empty ## Screenshots <!--Required for any UI changes. Delete if not applicable--> <img width="314" alt="image" src="https://user-images.githubusercontent.com/15682323/171961233-1a60378e-8823-402b-96be-210a18863ce6.png"> <img width="312" alt="Screen Shot 2022-06-03 at 19 15 39" src="https://user-images.githubusercontent.com/15682323/171961386-6f92c61d-1a52-4b5a-87d3-d4788fe85068.png"> <img width="310" alt="Screen Shot 2022-06-03 at 19 16 53" src="https://user-images.githubusercontent.com/15682323/171961472-dabf49ec-8ac0-41ca-a3b4-9ca61d22e0a0.png"> ## Before you submit - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [X] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-21 01:26:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#33714