From b6b7710ce72ca6fff1db307f55a492e62d60f04f Mon Sep 17 00:00:00 2001 From: Katherine Bertelsen Date: Thu, 2 Oct 2025 13:17:44 -0500 Subject: [PATCH 1/5] Move toast --- .../Application/Views/ToastBannerView.swift | 0 .../Views/ToastDisplayHelper.swift | 7 +++---- .../Views/ToastDisplayHelperTests.swift | 3 +-- .../Application/Views/ToastView.swift | 19 ++++++++++++------- .../Application/Views/ToastViewTests.swift | 3 +-- .../UI/Vault/VaultItem/LoginItemState.swift | 1 + 6 files changed, 18 insertions(+), 15 deletions(-) rename {BitwardenShared => BitwardenKit}/UI/Platform/Application/Views/ToastBannerView.swift (100%) rename {BitwardenShared => BitwardenKit}/UI/Platform/Application/Views/ToastDisplayHelper.swift (97%) rename {BitwardenShared => BitwardenKit}/UI/Platform/Application/Views/ToastDisplayHelperTests.swift (97%) rename {BitwardenShared => BitwardenKit}/UI/Platform/Application/Views/ToastView.swift (90%) rename {BitwardenShared => BitwardenKit}/UI/Platform/Application/Views/ToastViewTests.swift (94%) diff --git a/BitwardenShared/UI/Platform/Application/Views/ToastBannerView.swift b/BitwardenKit/UI/Platform/Application/Views/ToastBannerView.swift similarity index 100% rename from BitwardenShared/UI/Platform/Application/Views/ToastBannerView.swift rename to BitwardenKit/UI/Platform/Application/Views/ToastBannerView.swift diff --git a/BitwardenShared/UI/Platform/Application/Views/ToastDisplayHelper.swift b/BitwardenKit/UI/Platform/Application/Views/ToastDisplayHelper.swift similarity index 97% rename from BitwardenShared/UI/Platform/Application/Views/ToastDisplayHelper.swift rename to BitwardenKit/UI/Platform/Application/Views/ToastDisplayHelper.swift index 5e8d69b2b7..54cccbb897 100644 --- a/BitwardenShared/UI/Platform/Application/Views/ToastDisplayHelper.swift +++ b/BitwardenKit/UI/Platform/Application/Views/ToastDisplayHelper.swift @@ -1,8 +1,7 @@ -import BitwardenKit import SwiftUI import UIKit -enum ToastDisplayHelper { +public enum ToastDisplayHelper { // MARK: Type Properties /// The duration in seconds of the show and hide transitions. @@ -10,7 +9,7 @@ enum ToastDisplayHelper { /// A value that is used to identify the toast within the view hierarchy in /// order to remove it. - static let toastTag = 2000 + public static let toastTag = 2000 // MARK: Type Methods @@ -22,7 +21,7 @@ enum ToastDisplayHelper { /// - additionalBottomPadding: Additional padding to apply to the bottom of the toast. /// - duration: The number of seconds the toast should display for. /// - static func show( + public static func show( in parentViewController: UIViewController, toast: Toast, additionalBottomPadding: CGFloat = 0, diff --git a/BitwardenShared/UI/Platform/Application/Views/ToastDisplayHelperTests.swift b/BitwardenKit/UI/Platform/Application/Views/ToastDisplayHelperTests.swift similarity index 97% rename from BitwardenShared/UI/Platform/Application/Views/ToastDisplayHelperTests.swift rename to BitwardenKit/UI/Platform/Application/Views/ToastDisplayHelperTests.swift index b6b23267db..67d2e1d430 100644 --- a/BitwardenShared/UI/Platform/Application/Views/ToastDisplayHelperTests.swift +++ b/BitwardenKit/UI/Platform/Application/Views/ToastDisplayHelperTests.swift @@ -1,9 +1,8 @@ +import BitwardenKit import SwiftUI import TestHelpers import XCTest -@testable import BitwardenShared - class ToastDisplayHelperTests: BitwardenTestCase { /// `show(in:state:)` shows the toast in the parent view controller. func test_show() throws { diff --git a/BitwardenShared/UI/Platform/Application/Views/ToastView.swift b/BitwardenKit/UI/Platform/Application/Views/ToastView.swift similarity index 90% rename from BitwardenShared/UI/Platform/Application/Views/ToastView.swift rename to BitwardenKit/UI/Platform/Application/Views/ToastView.swift index 472c2cc851..d5bfc6d3c3 100644 --- a/BitwardenShared/UI/Platform/Application/Views/ToastView.swift +++ b/BitwardenKit/UI/Platform/Application/Views/ToastView.swift @@ -5,11 +5,11 @@ import SwiftUI /// A data model for a toast. /// -struct Toast: Equatable, Identifiable { +public struct Toast: Equatable, Identifiable { // MARK: Types /// A mode that captures what sort of toast this is. - enum ToastMode { + public enum ToastMode { /// The toast should dismiss itself after a few seconds. case automaticDismiss @@ -20,7 +20,7 @@ struct Toast: Equatable, Identifiable { // MARK: Properties /// A unique identifier of the toast. - let id = UUID() + public let id = UUID() /// The mode of the toast. let mode: ToastMode @@ -40,13 +40,13 @@ struct Toast: Equatable, Identifiable { /// - subtitle: The subtitle text displayed in the toast. /// - mode: The mode for the toast /// - init(title: String, subtitle: String? = nil, mode: ToastMode = .automaticDismiss) { + public init(title: String, subtitle: String? = nil, mode: ToastMode = .automaticDismiss) { self.title = title self.subtitle = subtitle self.mode = mode } - static func == (lhs: Toast, rhs: Toast) -> Bool { + public static func == (lhs: Toast, rhs: Toast) -> Bool { // Exclude `id` from `Equatable`, it's only used by the view to handle animations between toasts. lhs.title == rhs.title && lhs.subtitle == rhs.subtitle @@ -58,13 +58,13 @@ struct Toast: Equatable, Identifiable { /// A view that displays a toast message which is shown when the binding has a value and is hidden /// after a delay. /// -struct ToastView: View { +public struct ToastView: View { // MARK: Properties /// A binding to the toast to show. @Binding var toast: Toast? - var body: some View { + public var body: some View { if let toast { VStack(alignment: .leading, spacing: 4) { Text(toast.title) @@ -109,6 +109,11 @@ struct ToastView: View { } } } + + /// Public version of synthesized initializer. + public init(toast: Binding) { + self._toast = toast + } } // MARK: - View diff --git a/BitwardenShared/UI/Platform/Application/Views/ToastViewTests.swift b/BitwardenKit/UI/Platform/Application/Views/ToastViewTests.swift similarity index 94% rename from BitwardenShared/UI/Platform/Application/Views/ToastViewTests.swift rename to BitwardenKit/UI/Platform/Application/Views/ToastViewTests.swift index 3f3e2a95eb..b8d47ff9a8 100644 --- a/BitwardenShared/UI/Platform/Application/Views/ToastViewTests.swift +++ b/BitwardenKit/UI/Platform/Application/Views/ToastViewTests.swift @@ -1,9 +1,8 @@ +import BitwardenKit import SnapshotTesting import SwiftUI import XCTest -@testable import BitwardenShared - final class ToastViewTests: BitwardenTestCase { // MARK: Snapshots diff --git a/BitwardenShared/UI/Vault/VaultItem/LoginItemState.swift b/BitwardenShared/UI/Vault/VaultItem/LoginItemState.swift index 2b6f8f1042..770185e153 100644 --- a/BitwardenShared/UI/Vault/VaultItem/LoginItemState.swift +++ b/BitwardenShared/UI/Vault/VaultItem/LoginItemState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import BitwardenSdk import Foundation From c683388510e55065d004f637b8b8430807ae47b3 Mon Sep 17 00:00:00 2001 From: Katherine Bertelsen Date: Thu, 2 Oct 2025 13:24:57 -0500 Subject: [PATCH 2/5] Imports --- .../UI/Platform/Application/Views/ToastBannerView.swift | 2 +- .../UI/Platform/Application/Views/ToastView.swift | 8 ++++---- .../CompleteRegistration/CompleteRegistrationAction.swift | 2 ++ BitwardenShared/UI/Auth/Landing/LandingAction.swift | 2 ++ .../LoginDecryptionOptionsProcessor.swift | 1 + .../LoginDecryptionOptionsState.swift | 2 ++ .../UI/Auth/Login/TwoFactorAuth/TwoFactorAuthAction.swift | 2 ++ .../UI/Auth/Login/TwoFactorAuth/TwoFactorAuthState.swift | 1 + .../UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift | 1 + .../Auth/StartRegistration/StartRegistrationAction.swift | 2 ++ .../UI/Auth/VaultUnlock/VaultUnlockAction.swift | 2 ++ .../UI/Platform/Application/Utilities/Coordinator.swift | 1 + .../UI/Platform/Settings/Settings/About/AboutAction.swift | 2 ++ .../UI/Platform/Settings/Settings/About/AboutState.swift | 1 + .../FlightRecorderLogs/FlightRecorderLogsAction.swift | 2 ++ .../FlightRecorderLogs/FlightRecorderLogsProcessor.swift | 1 + .../FlightRecorderLogs/FlightRecorderLogsState.swift | 2 ++ .../PendingRequests/PendingRequestsAction.swift | 2 ++ .../PendingRequests/PendingRequestsProcessor.swift | 1 + .../PendingRequests/PendingRequestsState.swift | 2 ++ .../Settings/Settings/Other/OtherSettingsAction.swift | 2 ++ .../Settings/Settings/Other/OtherSettingsProcessor.swift | 1 + .../Settings/Settings/Other/OtherSettingsState.swift | 1 + .../ExportVault/ExportVaultToFile/ExportVaultAction.swift | 2 ++ .../ExportVault/ExportVaultToFile/ExportVaultState.swift | 1 + .../Settings/Settings/Vault/Folders/FoldersAction.swift | 2 ++ .../Settings/Vault/Folders/FoldersProcessor.swift | 1 + .../Settings/Settings/Vault/Folders/FoldersState.swift | 1 + .../UI/Tools/Generator/Generator/GeneratorAction.swift | 2 ++ .../PasswordHistoryList/PasswordHistoryListAction.swift | 1 + .../PasswordHistoryListProcessor.swift | 1 + .../PasswordHistoryList/PasswordHistoryListState.swift | 1 + .../UI/Tools/Send/Send/SendList/SendListAction.swift | 2 ++ .../UI/Tools/Send/Send/SendList/SendListProcessor.swift | 1 + .../UI/Tools/Send/Send/SendList/SendListState.swift | 1 + .../SendItem/AddEditSendItem/AddEditSendItemAction.swift | 1 + .../Send/SendItem/ViewSendItem/ViewSendItemAction.swift | 2 ++ .../SendItem/ViewSendItem/ViewSendItemProcessor.swift | 1 + .../Send/SendItem/ViewSendItem/ViewSendItemState.swift | 1 + .../UI/Vault/Helpers/VaultItemMoreOptionsHelper.swift | 1 + .../Vault/AutofillList/VaultAutofillListAction.swift | 1 + .../Vault/AutofillList/VaultAutofillListProcessor.swift | 1 + .../Vault/Vault/AutofillList/VaultAutofillListState.swift | 1 + .../UI/Vault/Vault/VaultGroup/VaultGroupAction.swift | 2 ++ .../UI/Vault/Vault/VaultGroup/VaultGroupProcessor.swift | 1 + .../UI/Vault/Vault/VaultGroup/VaultGroupState.swift | 1 + .../VaultItemSelection/VaultItemSelectionAction.swift | 1 + .../VaultItemSelection/VaultItemSelectionProcessor.swift | 1 + .../VaultItemSelection/VaultItemSelectionState.swift | 1 + .../UI/Vault/Vault/VaultList/VaultListAction.swift | 1 + .../UI/Vault/Vault/VaultList/VaultListState.swift | 1 + .../Vault/VaultItem/AddEditItem/AddEditItemAction.swift | 1 + .../VaultItem/AddEditItem/AddEditItemProcessor.swift | 1 + .../UI/Vault/VaultItem/AddEditItem/AddEditItemState.swift | 1 + .../Vault/VaultItem/Attachments/AttachmentsAction.swift | 1 + .../UI/Vault/VaultItem/Attachments/AttachmentsState.swift | 1 + BitwardenShared/UI/Vault/VaultItem/CipherItemState.swift | 1 + .../UI/Vault/VaultItem/VaultItemCoordinator.swift | 1 + .../UI/Vault/VaultItem/ViewItem/ViewItemAction.swift | 1 + .../UI/Vault/VaultItem/ViewItem/ViewItemState.swift | 1 + 60 files changed, 81 insertions(+), 5 deletions(-) diff --git a/BitwardenKit/UI/Platform/Application/Views/ToastBannerView.swift b/BitwardenKit/UI/Platform/Application/Views/ToastBannerView.swift index e03b10f32a..407324748c 100644 --- a/BitwardenKit/UI/Platform/Application/Views/ToastBannerView.swift +++ b/BitwardenKit/UI/Platform/Application/Views/ToastBannerView.swift @@ -92,7 +92,7 @@ struct ToastBannerView: View { // MARK: - View -extension View { +public extension View { /// Displays a toast banner view in an overlay at the bottom of the view. /// /// - Parameters: diff --git a/BitwardenKit/UI/Platform/Application/Views/ToastView.swift b/BitwardenKit/UI/Platform/Application/Views/ToastView.swift index d5bfc6d3c3..1734c57183 100644 --- a/BitwardenKit/UI/Platform/Application/Views/ToastView.swift +++ b/BitwardenKit/UI/Platform/Application/Views/ToastView.swift @@ -5,11 +5,11 @@ import SwiftUI /// A data model for a toast. /// -public struct Toast: Equatable, Identifiable { +public struct Toast: Equatable, Identifiable, Sendable { // MARK: Types /// A mode that captures what sort of toast this is. - public enum ToastMode { + public enum ToastMode: Sendable { /// The toast should dismiss itself after a few seconds. case automaticDismiss @@ -112,13 +112,13 @@ public struct ToastView: View { /// Public version of synthesized initializer. public init(toast: Binding) { - self._toast = toast + _toast = toast } } // MARK: - View -extension View { +public extension View { /// Adds a toast view in an overlay at the bottom of the view. /// /// - Parameters: diff --git a/BitwardenShared/UI/Auth/CompleteRegistration/CompleteRegistrationAction.swift b/BitwardenShared/UI/Auth/CompleteRegistration/CompleteRegistrationAction.swift index b9c558d53a..ad68e24b51 100644 --- a/BitwardenShared/UI/Auth/CompleteRegistration/CompleteRegistrationAction.swift +++ b/BitwardenShared/UI/Auth/CompleteRegistration/CompleteRegistrationAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - CompleteRegistrationAction /// Actions that can be processed by a `CompleteRegistrationProcessor`. diff --git a/BitwardenShared/UI/Auth/Landing/LandingAction.swift b/BitwardenShared/UI/Auth/Landing/LandingAction.swift index 9b5e16250e..aede0e202a 100644 --- a/BitwardenShared/UI/Auth/Landing/LandingAction.swift +++ b/BitwardenShared/UI/Auth/Landing/LandingAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - LandingAction /// Actions that can be processed by a `LandingProcessor`. diff --git a/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsProcessor.swift b/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsProcessor.swift index b7c9d01b3c..ce21974b7c 100644 --- a/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsProcessor.swift +++ b/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources // MARK: - LoginDecryptionOptionsProcessor diff --git a/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsState.swift b/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsState.swift index 172acc885a..8adfb16799 100644 --- a/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsState.swift +++ b/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsState.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - LoginDecryptionOptionsState /// An object that defines the current state of a `LoginDecryptionOptionsView`. diff --git a/BitwardenShared/UI/Auth/Login/TwoFactorAuth/TwoFactorAuthAction.swift b/BitwardenShared/UI/Auth/Login/TwoFactorAuth/TwoFactorAuthAction.swift index 1b009d5987..82e590c51e 100644 --- a/BitwardenShared/UI/Auth/Login/TwoFactorAuth/TwoFactorAuthAction.swift +++ b/BitwardenShared/UI/Auth/Login/TwoFactorAuth/TwoFactorAuthAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - TwoFactorAuthAction /// Actions that can be processed by a `TwoFactorAuthProcessor`. diff --git a/BitwardenShared/UI/Auth/Login/TwoFactorAuth/TwoFactorAuthState.swift b/BitwardenShared/UI/Auth/Login/TwoFactorAuth/TwoFactorAuthState.swift index 1ffea3612f..8b620ce2ec 100644 --- a/BitwardenShared/UI/Auth/Login/TwoFactorAuth/TwoFactorAuthState.swift +++ b/BitwardenShared/UI/Auth/Login/TwoFactorAuth/TwoFactorAuthState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation diff --git a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift index 07ad34ecc1..863132deaa 100644 --- a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift +++ b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation diff --git a/BitwardenShared/UI/Auth/StartRegistration/StartRegistrationAction.swift b/BitwardenShared/UI/Auth/StartRegistration/StartRegistrationAction.swift index 2b9bab60c5..f58bd7f8e9 100644 --- a/BitwardenShared/UI/Auth/StartRegistration/StartRegistrationAction.swift +++ b/BitwardenShared/UI/Auth/StartRegistration/StartRegistrationAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - StartRegistrationAction /// Actions that can be processed by a `StartRegistrationProcessor`. diff --git a/BitwardenShared/UI/Auth/VaultUnlock/VaultUnlockAction.swift b/BitwardenShared/UI/Auth/VaultUnlock/VaultUnlockAction.swift index 151f7265a4..7c96e07409 100644 --- a/BitwardenShared/UI/Auth/VaultUnlock/VaultUnlockAction.swift +++ b/BitwardenShared/UI/Auth/VaultUnlock/VaultUnlockAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + /// Actions that can be processed by a `VaultUnlockProcessor`. /// enum VaultUnlockAction: Equatable { diff --git a/BitwardenShared/UI/Platform/Application/Utilities/Coordinator.swift b/BitwardenShared/UI/Platform/Application/Utilities/Coordinator.swift index 0134cf72de..eedd683e5f 100644 --- a/BitwardenShared/UI/Platform/Application/Utilities/Coordinator.swift +++ b/BitwardenShared/UI/Platform/Application/Utilities/Coordinator.swift @@ -1,3 +1,4 @@ +import BitwardenKit import Foundation import UIKit diff --git a/BitwardenShared/UI/Platform/Settings/Settings/About/AboutAction.swift b/BitwardenShared/UI/Platform/Settings/Settings/About/AboutAction.swift index 9f4a30848f..d74c459e27 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/About/AboutAction.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/About/AboutAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - AboutAction /// Actions handled by the `AboutProcessor`. diff --git a/BitwardenShared/UI/Platform/Settings/Settings/About/AboutState.swift b/BitwardenShared/UI/Platform/Settings/Settings/About/AboutState.swift index ae15cf923b..b5c702c061 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/About/AboutState.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/About/AboutState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation diff --git a/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsAction.swift b/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsAction.swift index 8197000aa9..ede6248f43 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsAction.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - FlightRecorderLogsAction /// Actions handled by the `FlightRecorderLogsProcessor`. diff --git a/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsProcessor.swift b/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsProcessor.swift index d34e528385..65d28fab0c 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsProcessor.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation diff --git a/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsState.swift b/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsState.swift index f4599ffe69..8ec841ce75 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsState.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsState.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - FlightRecorderLogsState /// An object that defines the current state of the `FlightRecorderLogsView`. diff --git a/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsAction.swift b/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsAction.swift index ae8569374f..6098b9bab1 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsAction.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - PendingRequestsAction /// Actions that can be processed by a `PendingRequestsProcessor`. diff --git a/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsProcessor.swift b/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsProcessor.swift index f423d24a78..83516708d5 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsProcessor.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation diff --git a/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsState.swift b/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsState.swift index 91b4295b33..dd8dde7af8 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsState.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsState.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - PendingRequestsState /// The state used to present the `PendingRequestsView`. diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsAction.swift b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsAction.swift index bd1e1d594d..727ba8ee02 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsAction.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - OtherSettingsAction /// Actions handled by the `OtherSettingsProcessor`. diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsProcessor.swift b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsProcessor.swift index 5251db93d6..faeade687d 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsProcessor.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation import WatchConnectivity diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsState.swift b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsState.swift index 6963083e2a..0d1ffc358a 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsState.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import Foundation // MARK: - OtherSettingsState diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultToFile/ExportVaultAction.swift b/BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultToFile/ExportVaultAction.swift index 69993013cb..952bd00aac 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultToFile/ExportVaultAction.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultToFile/ExportVaultAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - ExportVaultAction /// Actions handled by the `ExportVaultProcessor`. diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultToFile/ExportVaultState.swift b/BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultToFile/ExportVaultState.swift index 70d770ca63..28b49f4248 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultToFile/ExportVaultState.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultToFile/ExportVaultState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources // MARK: - ExportVaultState diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersAction.swift b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersAction.swift index a0b94628fa..4305ab0b8d 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersAction.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - FoldersAction /// Actions handled by the `FoldersProcessor`. diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersProcessor.swift b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersProcessor.swift index b3f41dbd7f..bd67af7d1f 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersProcessor.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersState.swift b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersState.swift index 8b49014f2b..d07258a09a 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersState.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenSdk // MARK: - FoldersState diff --git a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorAction.swift b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorAction.swift index 47fce2dd7a..2fc1f2fe8d 100644 --- a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorAction.swift +++ b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + /// Actions that can be processed by a `GeneratorProcessor`. /// enum GeneratorAction: Equatable { diff --git a/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListAction.swift b/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListAction.swift index 93dcd0fc48..8798826d83 100644 --- a/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListAction.swift +++ b/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListAction.swift @@ -1,3 +1,4 @@ +import BitwardenKit @preconcurrency import BitwardenSdk // MARK: - PasswordHistoryListAction diff --git a/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListProcessor.swift b/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListProcessor.swift index d167369a27..d6cb76bb91 100644 --- a/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListProcessor.swift +++ b/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources @preconcurrency import BitwardenSdk import OSLog diff --git a/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListState.swift b/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListState.swift index 5f062a225c..6f8252a34b 100644 --- a/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListState.swift +++ b/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListState.swift @@ -1,3 +1,4 @@ +import BitwardenKit @preconcurrency import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Tools/Send/Send/SendList/SendListAction.swift b/BitwardenShared/UI/Tools/Send/Send/SendList/SendListAction.swift index bb7eb4e2b7..5597fe0bff 100644 --- a/BitwardenShared/UI/Tools/Send/Send/SendList/SendListAction.swift +++ b/BitwardenShared/UI/Tools/Send/Send/SendList/SendListAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: SendListAction /// Actions that can be processed by a `SendListProcessor`. diff --git a/BitwardenShared/UI/Tools/Send/Send/SendList/SendListProcessor.swift b/BitwardenShared/UI/Tools/Send/Send/SendList/SendListProcessor.swift index cfade4f782..b593fc532c 100644 --- a/BitwardenShared/UI/Tools/Send/Send/SendList/SendListProcessor.swift +++ b/BitwardenShared/UI/Tools/Send/Send/SendList/SendListProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources @preconcurrency import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Tools/Send/Send/SendList/SendListState.swift b/BitwardenShared/UI/Tools/Send/Send/SendList/SendListState.swift index d864faca4e..1282f58564 100644 --- a/BitwardenShared/UI/Tools/Send/Send/SendList/SendListState.swift +++ b/BitwardenShared/UI/Tools/Send/Send/SendList/SendListState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemAction.swift b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemAction.swift index ee86be21ee..6750f95674 100644 --- a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemAction.swift +++ b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemAction.swift @@ -1,3 +1,4 @@ +import BitwardenKit import Foundation // MARK: - AddEditSendItemAction diff --git a/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemAction.swift b/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemAction.swift index 5534090388..cf09768a37 100644 --- a/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemAction.swift +++ b/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - ViewSendItemAction /// Actions that can be processed by a `ViewSendItemProcessor`. diff --git a/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemProcessor.swift b/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemProcessor.swift index 3b6c910023..67e12961c0 100644 --- a/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemProcessor.swift +++ b/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources // MARK: - ViewSendItemProcessor diff --git a/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemState.swift b/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemState.swift index fca7de2e8f..e692c4f213 100644 --- a/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemState.swift +++ b/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/Helpers/VaultItemMoreOptionsHelper.swift b/BitwardenShared/UI/Vault/Helpers/VaultItemMoreOptionsHelper.swift index 1ef21e19ae..ea4b023d53 100644 --- a/BitwardenShared/UI/Vault/Helpers/VaultItemMoreOptionsHelper.swift +++ b/BitwardenShared/UI/Vault/Helpers/VaultItemMoreOptionsHelper.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListAction.swift b/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListAction.swift index fae0591da5..b46a98cc55 100644 --- a/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListAction.swift +++ b/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListAction.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenSdk // MARK: - VaultAutofillListAction diff --git a/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListProcessor.swift b/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListProcessor.swift index bfc171e8f4..fbc73079f4 100644 --- a/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListProcessor.swift +++ b/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListProcessor.swift @@ -1,4 +1,5 @@ import AuthenticationServices +import BitwardenKit import BitwardenResources @preconcurrency import BitwardenSdk diff --git a/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListState.swift b/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListState.swift index b94f68864b..2fded9f358 100644 --- a/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListState.swift +++ b/BitwardenShared/UI/Vault/Vault/AutofillList/VaultAutofillListState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupAction.swift b/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupAction.swift index 649fb7e5b7..31ea9a0101 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupAction.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - VaultGroupAction /// Actions that can be processed by a `VaultGroupProcessor`. diff --git a/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupProcessor.swift b/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupProcessor.swift index e21cb1fc9d..78c5ce179e 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupProcessor.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupState.swift b/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupState.swift index 0e4ab6cd7e..5b272152e3 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupState.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation diff --git a/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionAction.swift b/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionAction.swift index 3f36dd883d..c5076bf90c 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionAction.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionAction.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenSdk // MARK: - VaultItemSelectionAction diff --git a/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionProcessor.swift b/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionProcessor.swift index 305b294b72..84262eaacf 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionProcessor.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources // MARK: - VaultItemSelectionProcessor diff --git a/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionState.swift b/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionState.swift index 81cfc624b0..d53ee0af11 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionState.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultItemSelection/VaultItemSelectionState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/Vault/VaultList/VaultListAction.swift b/BitwardenShared/UI/Vault/Vault/VaultList/VaultListAction.swift index 7d92962249..f7725df66e 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultList/VaultListAction.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultList/VaultListAction.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenSdk // MARK: - VaultListAction diff --git a/BitwardenShared/UI/Vault/Vault/VaultList/VaultListState.swift b/BitwardenShared/UI/Vault/Vault/VaultList/VaultListState.swift index e9b61537ca..60a2af2db4 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultList/VaultListState.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultList/VaultListState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemAction.swift b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemAction.swift index 16c5ac2f51..71db42a447 100644 --- a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemAction.swift +++ b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemAction.swift @@ -1,5 +1,6 @@ // MARK: - AddEditItemAction +import BitwardenKit import BitwardenSdk import Foundation import SwiftUI diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemProcessor.swift b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemProcessor.swift index 91c23bcc38..343654c8f1 100644 --- a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemProcessor.swift +++ b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources @preconcurrency import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemState.swift b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemState.swift index d5f0dc8cda..648be1b4f9 100644 --- a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemState.swift +++ b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsAction.swift b/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsAction.swift index 6765ab9336..f80486ba71 100644 --- a/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsAction.swift +++ b/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsAction.swift @@ -1,3 +1,4 @@ +import BitwardenKit @preconcurrency import BitwardenSdk // MARK: - AttachmentsAction diff --git a/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsState.swift b/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsState.swift index f49c88e02c..aa0c4190e4 100644 --- a/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsState.swift +++ b/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsState.swift @@ -1,3 +1,4 @@ +import BitwardenKit @preconcurrency import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/VaultItem/CipherItemState.swift b/BitwardenShared/UI/Vault/VaultItem/CipherItemState.swift index c7ce6d0cac..31431112a8 100644 --- a/BitwardenShared/UI/Vault/VaultItem/CipherItemState.swift +++ b/BitwardenShared/UI/Vault/VaultItem/CipherItemState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import BitwardenSdk import Foundation diff --git a/BitwardenShared/UI/Vault/VaultItem/VaultItemCoordinator.swift b/BitwardenShared/UI/Vault/VaultItem/VaultItemCoordinator.swift index 9da32a94c7..4c4e1f45a1 100644 --- a/BitwardenShared/UI/Vault/VaultItem/VaultItemCoordinator.swift +++ b/BitwardenShared/UI/Vault/VaultItem/VaultItemCoordinator.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenSdk import SwiftUI diff --git a/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemAction.swift b/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemAction.swift index b03e01f8fb..eb1850f7b5 100644 --- a/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemAction.swift +++ b/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemAction.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources @preconcurrency import BitwardenSdk diff --git a/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemState.swift b/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemState.swift index b40824a1bb..5337a96e00 100644 --- a/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemState.swift +++ b/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources @preconcurrency import BitwardenSdk import Foundation From b18e436823a9499b4739186858e12338438407a1 Mon Sep 17 00:00:00 2001 From: Katherine Bertelsen Date: Thu, 2 Oct 2025 13:37:14 -0500 Subject: [PATCH 3/5] More imports --- BitwardenKit/UI/Platform/Application/Views/ToastView.swift | 2 +- .../LoginDecryptionOptionsProcessorTests.swift | 1 + .../UI/Auth/ProfileSwitcher/ProfileSwitcherHandlerTests.swift | 1 + .../TestHelpers/MockProfileSwitcherHandlerProcessor.swift | 1 + .../UI/Auth/VaultUnlock/VaultUnlockProcessorTests.swift | 1 + .../UI/Platform/Application/AppCoordinatorTests.swift | 1 + .../Platform/Settings/Settings/About/AboutProcessorTests.swift | 1 + .../FlightRecorderLogs/FlightRecorderLogsProcessorTests.swift | 1 + .../PendingRequests/PendingRequestsProcessorTests.swift | 1 + .../Settings/Settings/Other/OtherSettingsProcessorTests.swift | 1 + .../Settings/Settings/Vault/Folders/FoldersProcessorTests.swift | 1 + .../UI/Tools/Generator/Generator/GeneratorProcessorTests.swift | 1 + .../PasswordHistoryList/PasswordHistoryListProcessorTests.swift | 1 + .../UI/Tools/Send/Send/SendList/SendListProcessorTests.swift | 1 + .../Send/SendItem/ViewSendItem/ViewSendItemProcessorTests.swift | 1 + .../UI/Vault/Helpers/VaultItemMoreOptionsHelperTests.swift | 1 + .../UI/Vault/Vault/VaultGroup/VaultGroupProcessorTests.swift | 1 + .../Vault/VaultItem/Attachments/AttachmentsProcessorTests.swift | 1 + .../UI/Vault/VaultItem/ViewItem/ViewItemProcessorTests.swift | 1 + GlobalTestHelpers/MockCoordinator.swift | 1 + 20 files changed, 20 insertions(+), 1 deletion(-) diff --git a/BitwardenKit/UI/Platform/Application/Views/ToastView.swift b/BitwardenKit/UI/Platform/Application/Views/ToastView.swift index 1734c57183..81633b975c 100644 --- a/BitwardenKit/UI/Platform/Application/Views/ToastView.swift +++ b/BitwardenKit/UI/Platform/Application/Views/ToastView.swift @@ -26,7 +26,7 @@ public struct Toast: Equatable, Identifiable, Sendable { let mode: ToastMode /// The title text displayed in the toast. - let title: String + public let title: String /// The subtitle text displayed in the toast. let subtitle: String? diff --git a/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsProcessorTests.swift b/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsProcessorTests.swift index 49eed5f4b1..67af394df8 100644 --- a/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsProcessorTests.swift +++ b/BitwardenShared/UI/Auth/Login/LoginDecryptionOptions/LoginDecryptionOptionsProcessorTests.swift @@ -1,4 +1,5 @@ import AuthenticationServices +import BitwardenKit import BitwardenKitMocks import BitwardenResources import TestHelpers diff --git a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandlerTests.swift b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandlerTests.swift index add675e845..6b8117c055 100644 --- a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandlerTests.swift +++ b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandlerTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Auth/ProfileSwitcher/TestHelpers/MockProfileSwitcherHandlerProcessor.swift b/BitwardenShared/UI/Auth/ProfileSwitcher/TestHelpers/MockProfileSwitcherHandlerProcessor.swift index d704e7b938..b8f81fcdb6 100644 --- a/BitwardenShared/UI/Auth/ProfileSwitcher/TestHelpers/MockProfileSwitcherHandlerProcessor.swift +++ b/BitwardenShared/UI/Auth/ProfileSwitcher/TestHelpers/MockProfileSwitcherHandlerProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit @testable import BitwardenShared class MockProfileSwitcherHandlerProcessor: diff --git a/BitwardenShared/UI/Auth/VaultUnlock/VaultUnlockProcessorTests.swift b/BitwardenShared/UI/Auth/VaultUnlock/VaultUnlockProcessorTests.swift index 0ca009f4de..b3c1f90332 100644 --- a/BitwardenShared/UI/Auth/VaultUnlock/VaultUnlockProcessorTests.swift +++ b/BitwardenShared/UI/Auth/VaultUnlock/VaultUnlockProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import SwiftUI diff --git a/BitwardenShared/UI/Platform/Application/AppCoordinatorTests.swift b/BitwardenShared/UI/Platform/Application/AppCoordinatorTests.swift index 858f185753..64e355cda3 100644 --- a/BitwardenShared/UI/Platform/Application/AppCoordinatorTests.swift +++ b/BitwardenShared/UI/Platform/Application/AppCoordinatorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import TestHelpers import XCTest diff --git a/BitwardenShared/UI/Platform/Settings/Settings/About/AboutProcessorTests.swift b/BitwardenShared/UI/Platform/Settings/Settings/About/AboutProcessorTests.swift index 9e9ce99c35..b5ee2bbfdd 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/About/AboutProcessorTests.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/About/AboutProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import InlineSnapshotTesting diff --git a/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsProcessorTests.swift b/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsProcessorTests.swift index 2cff74bb86..5009e15769 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsProcessorTests.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/About/FlightRecorderLogs/FlightRecorderLogsProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import SnapshotTesting diff --git a/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsProcessorTests.swift b/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsProcessorTests.swift index b282f6041d..2cbb83cc33 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsProcessorTests.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/AccountSecurity/PendingRequests/PendingRequestsProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import TestHelpers diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsProcessorTests.swift b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsProcessorTests.swift index 541739b382..3c295f488c 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsProcessorTests.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import TestHelpers diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersProcessorTests.swift b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersProcessorTests.swift index 7b57a3133e..bea3aef1fd 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersProcessorTests.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/FoldersProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorProcessorTests.swift b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorProcessorTests.swift index 3ac744af85..a19ffa0db2 100644 --- a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorProcessorTests.swift +++ b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListProcessorTests.swift b/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListProcessorTests.swift index a0e1ea69a4..f824ce6999 100644 --- a/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListProcessorTests.swift +++ b/BitwardenShared/UI/Tools/PasswordHistory/PasswordHistoryList/PasswordHistoryListProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Tools/Send/Send/SendList/SendListProcessorTests.swift b/BitwardenShared/UI/Tools/Send/Send/SendList/SendListProcessorTests.swift index ae68bb5712..2e8e880818 100644 --- a/BitwardenShared/UI/Tools/Send/Send/SendList/SendListProcessorTests.swift +++ b/BitwardenShared/UI/Tools/Send/Send/SendList/SendListProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemProcessorTests.swift b/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemProcessorTests.swift index 7d8390be5e..680c3554b7 100644 --- a/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemProcessorTests.swift +++ b/BitwardenShared/UI/Tools/Send/SendItem/ViewSendItem/ViewSendItemProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Vault/Helpers/VaultItemMoreOptionsHelperTests.swift b/BitwardenShared/UI/Vault/Helpers/VaultItemMoreOptionsHelperTests.swift index 30f90d9ca4..35d7eefc4a 100644 --- a/BitwardenShared/UI/Vault/Helpers/VaultItemMoreOptionsHelperTests.swift +++ b/BitwardenShared/UI/Vault/Helpers/VaultItemMoreOptionsHelperTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupProcessorTests.swift b/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupProcessorTests.swift index b155f9c40a..28484309b9 100644 --- a/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupProcessorTests.swift +++ b/BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsProcessorTests.swift b/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsProcessorTests.swift index ebf0c34d4a..14df63feb5 100644 --- a/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsProcessorTests.swift +++ b/BitwardenShared/UI/Vault/VaultItem/Attachments/AttachmentsProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import TestHelpers diff --git a/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemProcessorTests.swift b/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemProcessorTests.swift index 4e8d912133..984a4d533b 100644 --- a/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemProcessorTests.swift +++ b/BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import BitwardenSdk diff --git a/GlobalTestHelpers/MockCoordinator.swift b/GlobalTestHelpers/MockCoordinator.swift index 32e0a3b6f1..d34dfb489d 100644 --- a/GlobalTestHelpers/MockCoordinator.swift +++ b/GlobalTestHelpers/MockCoordinator.swift @@ -1,3 +1,4 @@ +import BitwardenKit import XCTest @testable import BitwardenShared From 869c0d01e3e30e267cd2a80c3d8742f8f760cb74 Mon Sep 17 00:00:00 2001 From: Katherine Bertelsen Date: Thu, 2 Oct 2025 13:48:23 -0500 Subject: [PATCH 4/5] Migrate BWA --- .../Auth/VaultUnlock/VaultUnlockAction.swift | 2 + .../Auth/VaultUnlock/VaultUnlockState.swift | 2 + .../Application/Utilities/Coordinator.swift | 4 +- .../Application/Utilities/Navigator.swift | 1 + .../Views/ToastDisplayHelper.swift | 87 ------------------ .../Application/Views/ToastView.swift | 88 ------------------- .../ImportItems/ImportItemsAction.swift | 2 + .../ImportItems/ImportItemsProcessor.swift | 5 +- .../ImportItemsProcessorTests.swift | 5 +- .../ImportItems/ImportItemsState.swift | 1 + .../Settings/Settings/SettingsAction.swift | 2 + .../Settings/Settings/SettingsProcessor.swift | 2 +- .../Settings/SettingsProcessorTests.swift | 5 +- .../EditAuthenticatorItemAction.swift | 1 + .../EditAuthenticatorItemState.swift | 1 + .../ItemList/ItemList/ItemListAction.swift | 2 + .../ItemList/ItemList/ItemListProcessor.swift | 12 +-- .../ItemList/ItemListProcessorTests.swift | 9 +- 18 files changed, 38 insertions(+), 193 deletions(-) delete mode 100644 AuthenticatorShared/UI/Platform/Application/Views/ToastDisplayHelper.swift delete mode 100644 AuthenticatorShared/UI/Platform/Application/Views/ToastView.swift diff --git a/AuthenticatorShared/UI/Auth/VaultUnlock/VaultUnlockAction.swift b/AuthenticatorShared/UI/Auth/VaultUnlock/VaultUnlockAction.swift index b429b5b31f..56c883bd39 100644 --- a/AuthenticatorShared/UI/Auth/VaultUnlock/VaultUnlockAction.swift +++ b/AuthenticatorShared/UI/Auth/VaultUnlock/VaultUnlockAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - VaultUnlockAction /// Synchronous actions that can be handled by a `VaultUnlockProcessor`. diff --git a/AuthenticatorShared/UI/Auth/VaultUnlock/VaultUnlockState.swift b/AuthenticatorShared/UI/Auth/VaultUnlock/VaultUnlockState.swift index 95e1426c49..bf2314cc65 100644 --- a/AuthenticatorShared/UI/Auth/VaultUnlock/VaultUnlockState.swift +++ b/AuthenticatorShared/UI/Auth/VaultUnlock/VaultUnlockState.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - VaultUnlockState /// An object that defines the current state of a `VaultUnlockView`. diff --git a/AuthenticatorShared/UI/Platform/Application/Utilities/Coordinator.swift b/AuthenticatorShared/UI/Platform/Application/Utilities/Coordinator.swift index b48071133f..524d9d180f 100644 --- a/AuthenticatorShared/UI/Platform/Application/Utilities/Coordinator.swift +++ b/AuthenticatorShared/UI/Platform/Application/Utilities/Coordinator.swift @@ -1,3 +1,5 @@ +import BitwardenKit + /// A protocol for an object that performs navigation via routes. @MainActor public protocol Coordinator: AnyObject { @@ -156,7 +158,7 @@ extension Coordinator where Self: HasNavigator { /// - Parameter text: The text of the toast to display. /// func showToast(_ text: String) { - navigator?.showToast(Toast(text: text)) + navigator?.showToast(Toast(title: text)) } } diff --git a/AuthenticatorShared/UI/Platform/Application/Utilities/Navigator.swift b/AuthenticatorShared/UI/Platform/Application/Utilities/Navigator.swift index 67f74b2777..4ab49ef97a 100644 --- a/AuthenticatorShared/UI/Platform/Application/Utilities/Navigator.swift +++ b/AuthenticatorShared/UI/Platform/Application/Utilities/Navigator.swift @@ -1,3 +1,4 @@ +import BitwardenKit import SwiftUI // MARK: - Navigator diff --git a/AuthenticatorShared/UI/Platform/Application/Views/ToastDisplayHelper.swift b/AuthenticatorShared/UI/Platform/Application/Views/ToastDisplayHelper.swift deleted file mode 100644 index d322fce363..0000000000 --- a/AuthenticatorShared/UI/Platform/Application/Views/ToastDisplayHelper.swift +++ /dev/null @@ -1,87 +0,0 @@ -import SwiftUI -import UIKit - -enum ToastDisplayHelper { - // MARK: Type Properties - - /// The duration in seconds of the show and hide transitions. - static let transitionDuration: TimeInterval = 0.2 - - /// A value that is used to identify the toast within the view hierarchy in - /// order to remove it. - static let toastTag = 2000 - - // MARK: Type Methods - - /// Shows the toast over the specified view controller. - /// - /// - Parameters: - /// - parentViewController: The parent view controller that the toast should be shown above. - /// - toast: The toast to display. - /// - duration: The number of seconds the toast should display for. - /// - static func show(in parentViewController: UIViewController, toast: Toast, duration: TimeInterval = 3) { - guard parentViewController.view.window?.viewWithTag(toastTag) == nil, - let window = parentViewController.view.window - else { return } - - // Create the toast view. - let viewController = UIHostingController(rootView: ToastView(toast: .constant(toast))) - viewController.view.layer.backgroundColor = nil - viewController.view.layer.opacity = 0 - viewController.view.tag = toastTag - - // Position the toast view on the window with appropriate bottom padding above the tab bar. - window.addSubview(viewController.view) - let bottomPadding = window.safeAreaInsets.bottom + getSafeArea(from: parentViewController).bottom + 14 - viewController.view.translatesAutoresizingMaskIntoConstraints = false - viewController.view.bottomAnchor.constraint(equalTo: window.bottomAnchor, constant: -bottomPadding) - .isActive = true - viewController.view.centerXAnchor.constraint(equalTo: window.centerXAnchor).isActive = true - - // Animate the toast in. - UIView.animate(withDuration: UI.duration(transitionDuration)) { - viewController.view.layer.opacity = 1 - } - - // Dismiss the toast after 3 seconds. - Timer.scheduledTimer(withTimeInterval: duration, repeats: false) { _ in - hide(from: parentViewController) - } - } - - // MARK: Private Methods - - /// Calculates the additionalSafeAreaInsets based on the presence of a TabBar. - /// - /// - Parameter parentViewController: The parent view controller that the toast is shown in. - /// - private static func getSafeArea(from parentViewController: UIViewController) -> UIEdgeInsets { - let tabBarController = parentViewController.children - .compactMap { $0 as? UITabBarController } - .first - - if let tabBar = tabBarController?.tabBar, - let selected = tabBarController?.selectedViewController, - let topViewController = (selected as? UINavigationController)?.topViewController, - !topViewController.hidesBottomBarWhenPushed { - let height = tabBar.bounds.height - tabBar.safeAreaInsets.bottom - return UIEdgeInsets(top: 0, left: 0, bottom: height, right: 0) - } - return .zero - } - - /// Hides the toast from showing over the specified view controller - /// - /// - Parameter parentViewController: The parent view controller that the toast is shown in. - /// - private static func hide(from parentViewController: UIViewController) { - guard let view = parentViewController.view.window?.viewWithTag(toastTag) else { return } - - UIView.animate(withDuration: UI.duration(transitionDuration)) { - view.layer.opacity = 0 - } completion: { _ in - view.removeFromSuperview() - } - } -} diff --git a/AuthenticatorShared/UI/Platform/Application/Views/ToastView.swift b/AuthenticatorShared/UI/Platform/Application/Views/ToastView.swift deleted file mode 100644 index 97a128301a..0000000000 --- a/AuthenticatorShared/UI/Platform/Application/Views/ToastView.swift +++ /dev/null @@ -1,88 +0,0 @@ -import SwiftUI - -// MARK: - Toast - -/// A data model for a toast. -/// -struct Toast: Equatable, Identifiable { - // MARK: Properties - - /// A unique identifier of the toast. - let id = UUID() - - /// The text displayed in the toast. - let text: String -} - -// MARK: - ToastView - -/// A view that displays a toast message which is shown when the binding has a value and is hidden -/// after a delay. -/// -struct ToastView: View { - // MARK: Properties - - /// A binding to the toast to show. - @Binding var toast: Toast? - - var body: some View { - if let toast { - Text(toast.text) - .styleGuide(.subheadline, weight: .semibold) - .multilineTextAlignment(.center) - .dynamicTypeSize(...DynamicTypeSize.accessibility2) - .id(toast.id) - .padding(14) - .foregroundColor(Asset.Colors.textPrimaryInverted.swiftUIColor) - .frame(minWidth: 300, minHeight: 46) - .background(Asset.Colors.primaryBitwarden.swiftUIColor) - .clipShape(RoundedRectangle(cornerRadius: 24)) - .accessibilityElement(children: .combine) - .padding(.horizontal, 16) - .task(id: toast.id) { - do { - try await Task.sleep(nanoseconds: 3 * NSEC_PER_SEC) - withAnimation { - self.toast = nil - } - } catch { - // No-op: Skip the animation if the task/sleep is cancelled. - } - } - } - } -} - -// MARK: - View - -extension View { - /// Adds a toast view in an overlay at the bottom of the view. - /// - /// - Parameter toast: A binding to the toast to show. - /// - Returns: A view that displays a toast. - /// - func toast(_ toast: Binding) -> some View { - overlay(alignment: .bottom) { - ToastView(toast: toast) - .padding(.bottom, 28) - .animation(.easeInOut, value: toast.wrappedValue) - } - } -} - -// MARK: - Previews - -#if DEBUG -struct ToastView_Previews: PreviewProvider { - static var previews: some View { - ToastView(toast: .constant(Toast(text: "Toast!"))) - .previewDisplayName("Toast View") - - NavigationView { - Asset.Colors.backgroundPrimary.swiftUIColor - .toast(.constant(Toast(text: "Taos, NM!"))) - } - .previewDisplayName("Overlay") - } -} -#endif diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsAction.swift b/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsAction.swift index 8f044574d4..3a23d2fabe 100644 --- a/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsAction.swift +++ b/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + // MARK: - ImportItemsAction /// Synchronous actions handled by an `ImportItemsProcessor`. diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsProcessor.swift b/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsProcessor.swift index a9da7d9b88..0d1c24957f 100644 --- a/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsProcessor.swift +++ b/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsProcessor.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenResources import Foundation @@ -90,7 +91,7 @@ extension ImportItemsProcessor: FileSelectionDelegate { .twoFasJson } try await services.importItemsService.importItems(data: data, format: importFileFormat) - state.toast = Toast(text: Localizations.itemsImported) + state.toast = Toast(title: Localizations.itemsImported) } catch TwoFasImporterError.passwordProtectedFile { coordinator.showAlert(.twoFasPasswordProtected()) } catch DecodingError.dataCorrupted { @@ -148,7 +149,7 @@ extension ImportItemsProcessor: AuthenticatorKeyCaptureDelegate { func parseAndValidateAutomaticCaptureKey(_ key: String) async { do { try await services.importItemsService.importItems(data: key.data(using: .utf8)!, format: .googleProtobuf) - state.toast = Toast(text: Localizations.itemsImported) + state.toast = Toast(title: Localizations.itemsImported) } catch { services.errorReporter.log(error: error) } diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsProcessorTests.swift b/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsProcessorTests.swift index 307e262dd2..d701c9844e 100644 --- a/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsProcessorTests.swift +++ b/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsProcessorTests.swift @@ -1,3 +1,4 @@ +import BitwardenKit import BitwardenKitMocks import BitwardenResources import Foundation @@ -125,7 +126,7 @@ class ImportItemsProcessorTests: BitwardenTestCase { subject.fileSelectionCompleted(fileName: "Filename", data: data) try await waitForAsync { self.subject.state.toast != nil } - XCTAssertEqual(subject.state.toast?.text, Toast(text: Localizations.itemsImported).text) + XCTAssertEqual(subject.state.toast?.title, Toast(title: Localizations.itemsImported).title) XCTAssertEqual(importItemsService.importItemsData, data) } @@ -223,7 +224,7 @@ class ImportItemsProcessorTests: BitwardenTestCase { /// When the Processor receives a `.toastShown(_)` action, it sets the toast in the state. @MainActor func test_receive_toastShown() { - let toast = Toast(text: "TOAST!") + let toast = Toast(title: "TOAST!") subject.receive(.toastShown(toast)) XCTAssertEqual(subject.state.toast, toast) diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsState.swift b/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsState.swift index c31d4f93b7..c4bf43ebfd 100644 --- a/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsState.swift +++ b/AuthenticatorShared/UI/Platform/Settings/Settings/ImportItems/ImportItemsState.swift @@ -1,3 +1,4 @@ +import BitwardenKit import Foundation // MARK: - ImportItemsState diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/SettingsAction.swift b/AuthenticatorShared/UI/Platform/Settings/Settings/SettingsAction.swift index 4519d4d32b..7f72b41f44 100644 --- a/AuthenticatorShared/UI/Platform/Settings/Settings/SettingsAction.swift +++ b/AuthenticatorShared/UI/Platform/Settings/Settings/SettingsAction.swift @@ -1,3 +1,5 @@ +import BitwardenKit + /// Actions that can be processed by a `SettingsProcessor`. /// enum SettingsAction: Equatable { diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/SettingsProcessor.swift b/AuthenticatorShared/UI/Platform/Settings/Settings/SettingsProcessor.swift index 8b28b7bb12..cd338993aa 100644 --- a/AuthenticatorShared/UI/Platform/Settings/Settings/SettingsProcessor.swift +++ b/AuthenticatorShared/UI/Platform/Settings/Settings/SettingsProcessor.swift @@ -118,7 +118,7 @@ final class SettingsProcessor: StateProcessor Date: Tue, 7 Oct 2025 09:16:51 -0500 Subject: [PATCH 5/5] Fix rebase issue --- .../Views/ToastDisplayHelperTests.swift | 46 ------------------- .../Application/Views/ToastViewTests.swift | 18 -------- 2 files changed, 64 deletions(-) delete mode 100644 AuthenticatorShared/UI/Platform/Application/Views/ToastDisplayHelperTests.swift delete mode 100644 AuthenticatorShared/UI/Platform/Application/Views/ToastViewTests.swift diff --git a/AuthenticatorShared/UI/Platform/Application/Views/ToastDisplayHelperTests.swift b/AuthenticatorShared/UI/Platform/Application/Views/ToastDisplayHelperTests.swift deleted file mode 100644 index 8308ebe2e6..0000000000 --- a/AuthenticatorShared/UI/Platform/Application/Views/ToastDisplayHelperTests.swift +++ /dev/null @@ -1,46 +0,0 @@ -import SwiftUI -import XCTest - -@testable import AuthenticatorShared - -class ToastDisplayHelperTests: BitwardenTestCase { - /// `show(in:state:)` shows the toast in the parent view controller. - func test_show() throws { - let parentViewController = UIViewController() - let window = UIWindow() - window.rootViewController = parentViewController - window.makeKeyAndVisible() - - ToastDisplayHelper.show( - in: parentViewController, - toast: Toast(text: "With Butter"), - ) - - let overlayView = try XCTUnwrap(window.viewWithTag(ToastDisplayHelper.toastTag)) - XCTAssertEqual(overlayView.layer.opacity, 1) - guard #unavailable(iOS 26) else { - return - } - XCTAssertNil(overlayView.layer.backgroundColor) - } - - /// `hide(from:)` hides the toast from the parent view controller. - func test_hide() throws { - let parentViewController = UIViewController() - let window = UIWindow() - window.rootViewController = parentViewController - window.makeKeyAndVisible() - - ToastDisplayHelper.show( - in: parentViewController, - toast: Toast(text: "With Butter"), - duration: 0.1, - ) - let overlayView = try XCTUnwrap(window.viewWithTag(ToastDisplayHelper.toastTag)) - - waitFor { overlayView.superview == nil } - - XCTAssertNil(overlayView.superview) - XCTAssertEqual(overlayView.layer.opacity, 0) - } -} diff --git a/AuthenticatorShared/UI/Platform/Application/Views/ToastViewTests.swift b/AuthenticatorShared/UI/Platform/Application/Views/ToastViewTests.swift deleted file mode 100644 index 343025d7ea..0000000000 --- a/AuthenticatorShared/UI/Platform/Application/Views/ToastViewTests.swift +++ /dev/null @@ -1,18 +0,0 @@ -import SnapshotTesting -import XCTest - -@testable import AuthenticatorShared - -final class ToastViewTests: BitwardenTestCase { - // MARK: Snapshots - - /// Tests all previews for the toast view. - func disabletest_snapshot_toastView_previews() { - for preview in ToastView_Previews._allPreviews { - assertSnapshots( - of: preview.content, - as: [.defaultPortrait, .defaultPortraitDark, .defaultPortraitAX5], - ) - } - } -}