From 8befefd19225a80101794faa0e7f9016a29d08f0 Mon Sep 17 00:00:00 2001 From: Patrick Honkonen Date: Fri, 24 Apr 2026 17:05:23 -0400 Subject: [PATCH 1/2] [PM-35398] refactor: Promote ExpandableHeaderView from AuthenticatorShared to BitwardenKit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moves the existing `ExpandableHeaderView` component from `AuthenticatorShared` to `BitwardenKit/UI/Platform/Application/Views/` so both BWPM and Authenticator can consume it. Makes the struct, its initializer, and its `body` public. Swaps the BitwardenKit-idiomatic `SharedAsset.Colors.*` for the AuthenticatorShared-scoped `Asset.Colors.*` references and switches `.accessoryIcon(scaleWithFont:)` (AuthenticatorShared-only) for the behaviorally-identical `.accessoryIcon16(scaleWithFont:)` already exposed by BitwardenKit's `ImageStyle`. Drops the self-import of `BitwardenKit`. No API change, no behavior change — pure relocation to enable cross-app reuse in PR 6b (Binding initializer) and PR 6c (BWPM vault-list adoption). Authenticator's existing call site in `ItemListView.swift` already imports `BitwardenKit` and resolves the promoted public type without further changes. --- .../UI/Platform/Application/Views/ExpandableHeaderView.swift | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {AuthenticatorShared => BitwardenKit}/UI/Platform/Application/Views/ExpandableHeaderView.swift (100%) diff --git a/AuthenticatorShared/UI/Platform/Application/Views/ExpandableHeaderView.swift b/BitwardenKit/UI/Platform/Application/Views/ExpandableHeaderView.swift similarity index 100% rename from AuthenticatorShared/UI/Platform/Application/Views/ExpandableHeaderView.swift rename to BitwardenKit/UI/Platform/Application/Views/ExpandableHeaderView.swift From f9e4cd5854d08f483f26d823e3f9871139cb58ce Mon Sep 17 00:00:00 2001 From: Patrick Honkonen Date: Fri, 24 Apr 2026 17:05:48 -0400 Subject: [PATCH 2/2] [PM-35398] refactor: Publicize ExpandableHeaderView and adopt BitwardenKit idioms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Folds in edits that should have been part of the prior relocation commit: - Make the struct, its initializer, and `body` public so BWPM can consume it. - Drop the self-import of `BitwardenKit` (the file now lives inside that module). - Swap `Asset.Colors.*` (AuthenticatorShared-scoped) for the BitwardenKit- idiomatic `SharedAsset.Colors.*` used by every other view in this directory. - Swap `.accessoryIcon(scaleWithFont:)` (AuthenticatorShared-only style) for the behaviorally-identical `.accessoryIcon16(scaleWithFont:)` already exposed by BitwardenKit's `ImageStyle`. No API change, no behavior change — still pure relocation prep for PR 6b/6c. --- .../Application/Views/ExpandableHeaderView.swift | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/BitwardenKit/UI/Platform/Application/Views/ExpandableHeaderView.swift b/BitwardenKit/UI/Platform/Application/Views/ExpandableHeaderView.swift index 76a4dc5bb5..e9f8d5955f 100644 --- a/BitwardenKit/UI/Platform/Application/Views/ExpandableHeaderView.swift +++ b/BitwardenKit/UI/Platform/Application/Views/ExpandableHeaderView.swift @@ -1,4 +1,3 @@ -import BitwardenKit import BitwardenResources import SwiftUI @@ -6,7 +5,7 @@ import SwiftUI /// A wrapper around some content which can be expanded to show the content or collapsed to hide it. /// -struct ExpandableHeaderView: View { +public struct ExpandableHeaderView: View { // MARK: Properties /// The accessibility identifier for the button to expand or collapse the content. @@ -29,7 +28,7 @@ struct ExpandableHeaderView: View { // MARK: View - var body: some View { + public var body: some View { VStack(spacing: 8) { expandButton @@ -52,11 +51,11 @@ struct ExpandableHeaderView: View { SectionHeaderView("\(title) (\(count))") SharedAsset.Icons.chevronDown16.swiftUIImage - .imageStyle(.accessoryIcon(scaleWithFont: true)) + .imageStyle(.accessoryIcon16(scaleWithFont: true)) .rotationEffect(isExpanded ? Angle(degrees: 180) : .zero) } .multilineTextAlignment(.leading) - .foregroundStyle(Asset.Colors.textSecondary.swiftUIColor) + .foregroundStyle(SharedAsset.Colors.textSecondary.swiftUIColor) } .accessibilityAddTraits(.isHeader) .accessibilityIdentifier(buttonAccessibilityIdentifier) @@ -74,7 +73,7 @@ struct ExpandableHeaderView: View { /// - buttonAccessibilityIdentifier: The accessibility identifier for the button to expand or /// collapse the content. /// - content: The content that is shown when the section is expanded or hidden otherwise. - init( + public init( title: String, count: Int, buttonAccessibilityIdentifier: String = "ExpandSectionButton", @@ -103,6 +102,6 @@ struct ExpandableHeaderView: View { } .padding() .frame(maxHeight: .infinity, alignment: .top) - .background(Asset.Colors.backgroundPrimary.swiftUIColor) + .background(SharedAsset.Colors.backgroundPrimary.swiftUIColor) } #endif