Skip to content

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

Add quick unlock type enum to show custom label in view (#520)

Leendert de Borste1318e214768
diff --git a/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift b/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
index 7a1d397ad..fd6ef5dad 100644
--- a/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
+++ b/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
@@ -69,8 +69,11 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
// Check if we're in quick return mode
// Setup the loading view (actual unlock happens in viewDidAppear)
if isQuickReturnMode {
- // Show loading view
- let loadingView = QuickUnlockLoadingView()
+ // 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)
diff --git a/apps/mobile-app/ios/VaultUI/QuickUnlock/Enums/QuickUnlockType.swift b/apps/mobile-app/ios/VaultUI/QuickUnlock/Enums/QuickUnlockType.swift
new file mode 100644
index 000000000..454787e85
--- /dev/null
+++ b/apps/mobile-app/ios/VaultUI/QuickUnlock/Enums/QuickUnlockType.swift
@@ -0,0 +1,7 @@
+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
index e87a60673..031dcbf77 100644
--- a/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swift
+++ b/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swift
@@ -3,10 +3,22 @@ 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
+ }
- public init() {}
+ 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 {
@@ -15,17 +27,27 @@ public struct QuickUnlockLoadingView: View {
.ignoresSafeArea()
// Loading overlay
- LoadingOverlayView(message: String(localized: "retrieving_credential", bundle: locBundle))
+ LoadingOverlayView(message: localizedMessage)
}
}
}
-#Preview("Light Mode") {
- QuickUnlockLoadingView()
+#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("Dark Mode") {
- QuickUnlockLoadingView()
+#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 1c204537f..c309e8f57 100644
Binary files a/apps/mobile-app/ios/VaultUI/en.lproj/Localizable.strings and b/apps/mobile-app/ios/VaultUI/en.lproj/Localizable.strings differ