Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Tweak loading animations during iOS autofill to be more fluid (#1404)

Leendert de Borst4522431b80dc
diff --git a/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj b/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
index d96069ded..77869fdc2 100644
--- a/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
+++ b/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
@@ -1495,7 +1495,8 @@
);
PRODUCT_BUNDLE_IDENTIFIER = net.aliasvault.RustCoreFramework;
PRODUCT_NAME = "$(TARGET_NAME)";
- RUST_LIB_PLATFORM = device;
+ "RUST_LIB_PLATFORM[sdk=iphoneos*]" = device;
+ "RUST_LIB_PLATFORM[sdk=iphonesimulator*]" = simulator;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -1747,7 +1748,8 @@
);
PRODUCT_BUNDLE_IDENTIFIER = net.aliasvault.RustCoreFramework;
PRODUCT_NAME = "$(TARGET_NAME)";
- RUST_LIB_PLATFORM = simulator;
+ "RUST_LIB_PLATFORM[sdk=iphoneos*]" = device;
+ "RUST_LIB_PLATFORM[sdk=iphonesimulator*]" = simulator;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
diff --git a/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift b/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
index bb5f9a613..63229f410 100644
--- a/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
+++ b/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
@@ -70,28 +70,10 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
super.viewWillAppear(animated)
// Check if we're in quick return mode
- // Setup the loading view (actual unlock happens in viewDidAppear)
+ // Don't show any UI - Face ID will appear immediately with no background
if isQuickReturnMode {
- // Determine the type of credential being retrieved
- let type: QuickUnlockType = quickReturnPasskeyRequest != nil ? .passkey : .credential
-
- // Show loading view with appropriate type
- let loadingView = QuickUnlockLoadingView(type: type)
- let hostingController = UIHostingController(rootView: loadingView)
-
- addChild(hostingController)
- view.addSubview(hostingController.view)
-
- hostingController.view.translatesAutoresizingMaskIntoConstraints = false
- NSLayoutConstraint.activate([
- hostingController.view.topAnchor.constraint(equalTo: view.topAnchor),
- hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
- hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
- hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor)
- ])
-
- hostingController.didMove(toParent: self)
- self.currentHostingController = hostingController
+ // Make the view transparent so system UI shows through
+ view.backgroundColor = .clear
return
}
@@ -167,6 +149,7 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
}
// Only biometric is enabled - try to unlock with biometric
+ // No loading view shown - Face ID will appear immediately on clean background
do {
// Try to unlock the vault with biometric
try vaultStore.unlockVault()
diff --git a/apps/mobile-app/ios/Autofill/UnlockCoordinator.swift b/apps/mobile-app/ios/Autofill/UnlockCoordinator.swift
index b9f30f185..4ad17bf46 100644
--- a/apps/mobile-app/ios/Autofill/UnlockCoordinator.swift
+++ b/apps/mobile-app/ios/Autofill/UnlockCoordinator.swift
@@ -26,14 +26,9 @@ struct UnlockCoordinatorView: View {
// Show PIN unlock view
PinUnlockView(viewModel: pinViewModel)
} else {
- // Show loading while attempting biometric unlock
- VStack {
- ProgressView()
- .progressViewStyle(CircularProgressViewStyle())
- .scaleEffect(1.5)
- }
- .frame(maxWidth: .infinity, maxHeight: .infinity)
- .background(Color(UIColor.systemBackground))
+ // Transparent for biometric unlock - Face ID appears with no background
+ Color.clear
+ .ignoresSafeArea()
}
}
.onAppear {
@@ -113,6 +108,8 @@ class UnlockCoordinator: ObservableObject {
}
private func attemptBiometricUnlock() async {
+ // Trigger Face ID immediately without showing loading spinner
+ // This prevents any UI freeze or jarring animation
do {
// Attempt to unlock with biometric
try vaultStore.unlockVault()
@@ -121,6 +118,7 @@ class UnlockCoordinator: ObservableObject {
onUnlocked()
} catch {
print("Biometric unlock failed: \(error)")
+
// If biometric fails, check if PIN is available as fallback
if vaultStore.isPinEnabled() {
createPinViewModel()
diff --git a/apps/mobile-app/ios/VaultUI/QuickUnlock/Enums/QuickUnlockType.swift b/apps/mobile-app/ios/VaultUI/QuickUnlock/Enums/QuickUnlockType.swift
deleted file mode 100644
index 454787e85..000000000
--- a/apps/mobile-app/ios/VaultUI/QuickUnlock/Enums/QuickUnlockType.swift
+++ /dev/null
@@ -1,7 +0,0 @@
-import Foundation
-
-/// Type of credential being retrieved during quick unlock
-public enum QuickUnlockType: Hashable {
- case credential
- case passkey
-}
diff --git a/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swift b/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swift
deleted file mode 100644
index 78fccafac..000000000
--- a/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swift
+++ /dev/null
@@ -1,57 +0,0 @@
-import SwiftUI
-
-/// Loading view shown during quick unlock (biometric authentication)
-public struct QuickUnlockLoadingView: View {
- @Environment(\.colorScheme) private var colorScheme
-
- private let locBundle = Bundle.vaultUI
- private let type: QuickUnlockType
-
- public init(type: QuickUnlockType) {
- self.type = type
- }
-
- private var colors: ColorConstants.Colors.Type {
- ColorConstants.colors(for: colorScheme)
- }
-
- private var localizedMessage: String {
- switch type {
- case .credential:
- return String(localized: "retrieving_credential", bundle: locBundle)
- case .passkey:
- return String(localized: "retrieving_passkey", bundle: locBundle)
- }
- }
-
- public var body: some View {
- ZStack {
- // Background
- colors.background
- .ignoresSafeArea()
-
- // Loading overlay
- LoadingOverlayView(message: localizedMessage)
- }
- }
-}
-
-#Preview("Credential - Light Mode") {
- QuickUnlockLoadingView(type: .credential)
- .preferredColorScheme(.light)
-}
-
-#Preview("Credential - Dark Mode") {
- QuickUnlockLoadingView(type: .credential)
- .preferredColorScheme(.dark)
-}
-
-#Preview("Passkey - Light Mode") {
- QuickUnlockLoadingView(type: .passkey)
- .preferredColorScheme(.light)
-}
-
-#Preview("Passkey - Dark Mode") {
- QuickUnlockLoadingView(type: .passkey)
- .preferredColorScheme(.dark)
-}
diff --git a/apps/mobile-app/ios/VaultUI/en.lproj/Localizable.strings b/apps/mobile-app/ios/VaultUI/en.lproj/Localizable.strings
index 947b7d9eb..1087271b1 100644
--- a/apps/mobile-app/ios/VaultUI/en.lproj/Localizable.strings
+++ b/apps/mobile-app/ios/VaultUI/en.lproj/Localizable.strings
@@ -23,8 +23,6 @@
"password" = "Password";
"credentials_load_error" = "Failed to load credentials. Please open the AliasVault app to check for updates.";
"no_credential_selected" = "No credential selected.";
-"retrieving_credential" = "Retrieving credential";
-"retrieving_passkey" = "Retrieving passkey";
/* Context menu strings */
"copy_username" = "Copy Username";