From bc55fea52e46f950cdd9f1b48482675f5e4fdcf0 Mon Sep 17 00:00:00 2001 From: Razvan Litianu Date: Fri, 26 Sep 2025 13:16:40 +0300 Subject: [PATCH 1/7] Add glass --- .../ComponentLibrary/SwiftUI/Backport.swift | 35 +++++++++++++++++++ .../SwiftUI/ViewExtensions.swift | 14 ++++++-- .../OnboardingBasicCardViewCompact.swift | 6 +--- ...oardingMultipleChoiceCardViewCompact.swift | 6 +--- .../Views/Compact/OnboardingViewCompact.swift | 2 +- .../TermsOfServiceCompactView.swift | 6 +--- .../Frontend/Autofill/LoginAutofillView.swift | 8 ----- 7 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift diff --git a/BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift b/BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift new file mode 100644 index 0000000000000..b55fa835b787f --- /dev/null +++ b/BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift @@ -0,0 +1,35 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/ + +import SwiftUI + +public struct Backport { + let content: Content +} + +public extension Backport where Content: View { + @MainActor + @ViewBuilder + func glassButtonStyle() -> some View { + if #available(iOS 26, *) { + content.buttonStyle(.glass) + } else { + content.buttonStyle(.plain) + } + } + + @MainActor + @ViewBuilder + func cardBackground(_ color: Color, cornerRadius: CGFloat) -> some View { + if #available(iOS 26, *) { + content.glassEffect(.regular.tint(color), in: .rect(cornerRadius: cornerRadius)) + } else { + content.background( + RoundedRectangle(cornerRadius: cornerRadius) + .fill(color) + .accessibilityHidden(true) + ) + } + } +} diff --git a/BrowserKit/Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift b/BrowserKit/Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift index 0e771c79d35e3..71c1450b0a647 100644 --- a/BrowserKit/Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift +++ b/BrowserKit/Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift @@ -5,7 +5,7 @@ import SwiftUI /// Extensions to SwiftUI's View protocol providing conditional view modifiers. -public extension View { +extension View { /// Conditionally applies a transformation when the condition is true. /// /// - Parameters: @@ -18,11 +18,21 @@ public extension View { /// .if(isHighlighted) { $0.foregroundColor(.red) } /// ``` @ViewBuilder - func `if`(_ condition: Bool, transform: (Self) -> Content) -> some View { + public func `if`(_ condition: Bool, transform: (Self) -> Content) -> some View { if condition { transform(self) } else { self } } + + public var isIOS26OrLater: Bool { + if #available(iOS 26.0, *) { + return true + } else { + return false + } + } + + public var backport: Backport { Backport(content: self) } } diff --git a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift index 8152a3e1d6126..f8d12edbe0301 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift @@ -68,11 +68,7 @@ struct OnboardingBasicCardViewCompact: View { .bold() .foregroundColor(skipTextColor) } - .buttonStyle(.plain) .padding(.trailing, UX.Onboarding.Spacing.standard) + .backport.glassButtonStyle() } .onAppear { applyTheme() diff --git a/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift b/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift index f8cac9d990ec6..3da1cac6585db 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift @@ -80,11 +80,7 @@ public struct TermsOfServiceCompactView Date: Fri, 26 Sep 2025 14:01:30 +0300 Subject: [PATCH 2/7] iOS 26 glass --- .../ThemedBorderedProminentButton.swift | 45 +++++++++++++++++++ .../OnboardingBasicCardViewCompact.swift | 29 +++++++----- ...oardingMultipleChoiceCardViewCompact.swift | 19 +++++--- .../OnboardingBasicCardViewRegular.swift | 18 +++++--- ...oardingMultipleChoiceCardViewRegular.swift | 18 +++++--- .../Views/Regular/OnboardingViewRegular.swift | 6 +-- .../TermsOfServiceCompactView.swift | 16 ++++--- .../TermsOfServiceRegularView.swift | 17 ++++--- 8 files changed, 119 insertions(+), 49 deletions(-) create mode 100644 BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift diff --git a/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift b/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift new file mode 100644 index 0000000000000..c1ca278539564 --- /dev/null +++ b/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift @@ -0,0 +1,45 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/ + +import SwiftUI +import Common + +// MARK: - ThemedBorderedProminentButton +struct ThemedBorderedProminentButton: View { + let title: String + let action: () -> Void + let accessibilityIdentifier: String + let backgroundColor: Color + let foregroundColor: Color + let width: CGFloat? + + init( + title: String, + action: @escaping () -> Void, + accessibilityIdentifier: String, + backgroundColor: Color, + foregroundColor: Color, + width: CGFloat? = nil + ) { + self.title = title + self.action = action + self.accessibilityIdentifier = accessibilityIdentifier + self.backgroundColor = backgroundColor + self.foregroundColor = foregroundColor + self.width = width + } + + var body: some View { + Button(action: action) { + Text(title) + .font(.headline) + .frame(maxWidth: width ?? .infinity) + .foregroundColor(foregroundColor) + } + .accessibility(identifier: accessibilityIdentifier) + .buttonStyle(.borderedProminent) + .controlSize(.large) + .tint(backgroundColor) + } +} diff --git a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift index f8d12edbe0301..761ed9468733e 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift @@ -12,6 +12,8 @@ struct OnboardingBasicCardViewCompact: View { @State private var textColor: Color = .clear @State private var cardBackgroundColor: Color = .clear + @State private var primaryBackgroundColor: Color = .clear + @State private var primaryForegroundColor: Color = .clear @State private var selectedAction: ViewModel.OnboardingMultipleChoiceActionType @Environment(\.sizeCategory) var sizeCategory @@ -74,7 +76,8 @@ struct OnboardingMultipleChoiceCardViewCompact: View { @State private var textColor: Color = .clear @State private var cardBackgroundColor: Color = .clear + @State private var primaryBackgroundColor: Color = .clear + @State private var primaryForegroundColor: Color = .clear @State private var selectedAction: ViewModel.OnboardingMultipleChoiceActionType let windowUUID: WindowUUID @@ -78,24 +80,26 @@ struct OnboardingMultipleChoiceCardViewRegular: View { tabView pageControl } - .background( - RoundedRectangle(cornerRadius: UX.CardView.cornerRadius) - .fill(cardBackgroundColor) - ) + .backport + .cardBackground(cardBackgroundColor, cornerRadius: UX.CardView.cornerRadius) } } .onAppear { diff --git a/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift b/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift index 3da1cac6585db..aeab14aa8a970 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift @@ -10,6 +10,8 @@ public struct TermsOfServiceCompactView let windowUUID: WindowUUID @@ -136,17 +138,17 @@ public struct TermsOfServiceCompactView let windowUUID: WindowUUID @@ -133,17 +135,18 @@ public struct TermsOfServiceRegularView Date: Fri, 26 Sep 2025 15:27:07 +0300 Subject: [PATCH 3/7] Swiftlint --- .../Views/Common/ThemedBorderedProminentButton.swift | 5 ++--- .../TermsOfServiceView/TermsOfServiceRegularView.swift | 9 ++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift b/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift index c1ca278539564..178a06b56e95b 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift @@ -5,7 +5,6 @@ import SwiftUI import Common -// MARK: - ThemedBorderedProminentButton struct ThemedBorderedProminentButton: View { let title: String let action: () -> Void @@ -13,7 +12,7 @@ struct ThemedBorderedProminentButton: View { let backgroundColor: Color let foregroundColor: Color let width: CGFloat? - + init( title: String, action: @escaping () -> Void, @@ -29,7 +28,7 @@ struct ThemedBorderedProminentButton: View { self.foregroundColor = foregroundColor self.width = width } - + var body: some View { Button(action: action) { Text(title) diff --git a/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceRegularView.swift b/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceRegularView.swift index 1a87156ed53d1..3e6324c8bcc05 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceRegularView.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceRegularView.swift @@ -75,13 +75,8 @@ public struct TermsOfServiceRegularView Date: Fri, 26 Sep 2025 15:44:03 +0300 Subject: [PATCH 4/7] Refactor buttons --- .../SwiftUI/OnboardingButton.swift | 112 ++++++++++++++++++ .../ThemedBorderedProminentButton.swift | 44 ------- .../OnboardingBasicCardViewCompact.swift | 24 ++-- ...oardingMultipleChoiceCardViewCompact.swift | 12 +- .../OnboardingBasicCardViewRegular.swift | 25 ++-- ...oardingMultipleChoiceCardViewRegular.swift | 14 +-- .../TermsOfServiceCompactView.swift | 12 +- .../TermsOfServiceRegularView.swift | 14 +-- 8 files changed, 149 insertions(+), 108 deletions(-) create mode 100644 BrowserKit/Sources/ComponentLibrary/SwiftUI/OnboardingButton.swift delete mode 100644 BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift diff --git a/BrowserKit/Sources/ComponentLibrary/SwiftUI/OnboardingButton.swift b/BrowserKit/Sources/ComponentLibrary/SwiftUI/OnboardingButton.swift new file mode 100644 index 0000000000000..95d47a95beea1 --- /dev/null +++ b/BrowserKit/Sources/ComponentLibrary/SwiftUI/OnboardingButton.swift @@ -0,0 +1,112 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/ + +import SwiftUI +import Common + +public struct OnboardingButton: View { + @State private var backgroundColor: Color = .clear + @State private var foregroundColor: Color = .clear + let title: String + let action: () -> Void + let accessibilityIdentifier: String + let buttonType: ButtonType + let width: CGFloat? + let windowUUID: WindowUUID + let themeManager: ThemeManager + + public enum ButtonType { + case primary + case secondary + } + + init( + title: String, + action: @escaping () -> Void, + accessibilityIdentifier: String, + buttonType: ButtonType, + width: CGFloat? = nil, + windowUUID: WindowUUID, + themeManager: ThemeManager + ) { + self.title = title + self.action = action + self.accessibilityIdentifier = accessibilityIdentifier + self.buttonType = buttonType + self.width = width + self.windowUUID = windowUUID + self.themeManager = themeManager + } + + public var body: some View { + Button(action: action) { + Text(title) + .font(.headline) + .frame(maxWidth: width ?? .infinity) + .foregroundColor(foregroundColor) + } + .accessibility(identifier: accessibilityIdentifier) + .buttonStyle(.borderedProminent) + .controlSize(.large) + .tint(backgroundColor) + .onAppear { + applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID)) + } + .onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in + guard let uuid = notification.windowUUID, uuid == windowUUID else { return } + applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID)) + } + } + + private func applyTheme(theme: Theme) { + let colors = theme.colors + + switch buttonType { + case .primary: + backgroundColor = Color(colors.actionPrimary) + foregroundColor = Color(colors.textInverted) + case .secondary: + backgroundColor = Color(colors.actionSecondary) + foregroundColor = Color(colors.textSecondary) + } + } + + static func primary( + _ title: String, + action: @escaping () -> Void, + accessibilityIdentifier: String, + width: CGFloat? = nil, + windowUUID: WindowUUID, + themeManager: ThemeManager + ) -> OnboardingButton { + OnboardingButton( + title: title, + action: action, + accessibilityIdentifier: accessibilityIdentifier, + buttonType: .primary, + width: width, + windowUUID: windowUUID, + themeManager: themeManager + ) + } + + static func secondary( + _ title: String, + action: @escaping () -> Void, + accessibilityIdentifier: String, + width: CGFloat? = nil, + windowUUID: WindowUUID, + themeManager: ThemeManager + ) -> OnboardingButton { + OnboardingButton( + title: title, + action: action, + accessibilityIdentifier: accessibilityIdentifier, + buttonType: .secondary, + width: width, + windowUUID: windowUUID, + themeManager: themeManager + ) + } +} diff --git a/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift b/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift deleted file mode 100644 index 178a06b56e95b..0000000000000 --- a/BrowserKit/Sources/OnboardingKit/Views/Common/ThemedBorderedProminentButton.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/ - -import SwiftUI -import Common - -struct ThemedBorderedProminentButton: View { - let title: String - let action: () -> Void - let accessibilityIdentifier: String - let backgroundColor: Color - let foregroundColor: Color - let width: CGFloat? - - init( - title: String, - action: @escaping () -> Void, - accessibilityIdentifier: String, - backgroundColor: Color, - foregroundColor: Color, - width: CGFloat? = nil - ) { - self.title = title - self.action = action - self.accessibilityIdentifier = accessibilityIdentifier - self.backgroundColor = backgroundColor - self.foregroundColor = foregroundColor - self.width = width - } - - var body: some View { - Button(action: action) { - Text(title) - .font(.headline) - .frame(maxWidth: width ?? .infinity) - .foregroundColor(foregroundColor) - } - .accessibility(identifier: accessibilityIdentifier) - .buttonStyle(.borderedProminent) - .controlSize(.large) - .tint(backgroundColor) - } -} diff --git a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift index 761ed9468733e..835a6437bf1cc 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift @@ -10,10 +10,6 @@ import ComponentLibrary struct OnboardingBasicCardViewCompact: View { @State private var textColor: Color = .clear @State private var secondaryTextColor: Color = .clear - @State private var primaryBackgroundColor: Color = .clear - @State private var primaryForegroundColor: Color = .clear - @State private var secondaryBackgroundColor: Color = .clear - @State private var secondaryForegroundColor: Color = .clear @State private var cardBackgroundColor: Color = .clear @Environment(\.sizeCategory) private var sizeCategory @@ -108,8 +104,8 @@ struct OnboardingBasicCardViewCompact: View { @State private var textColor: Color = .clear @State private var cardBackgroundColor: Color = .clear - @State private var primaryBackgroundColor: Color = .clear - @State private var primaryForegroundColor: Color = .clear @State private var selectedAction: ViewModel.OnboardingMultipleChoiceActionType @Environment(\.sizeCategory) var sizeCategory @@ -102,8 +100,8 @@ struct OnboardingMultipleChoiceCardViewCompact: View { @State private var textColor: Color = .clear @State private var cardBackgroundColor: Color = .clear - @State private var primaryBackgroundColor: Color = .clear - @State private var primaryForegroundColor: Color = .clear @State private var selectedAction: ViewModel.OnboardingMultipleChoiceActionType let windowUUID: WindowUUID @@ -80,8 +78,8 @@ struct OnboardingMultipleChoiceCardViewRegular let windowUUID: WindowUUID @@ -138,16 +136,16 @@ public struct TermsOfServiceCompactView let windowUUID: WindowUUID @@ -130,17 +128,17 @@ public struct TermsOfServiceRegularView Date: Fri, 26 Sep 2025 16:03:09 +0300 Subject: [PATCH 5/7] Cleanup --- .../SwiftUI/OnboardingButton.swift | 4 ++-- ...oardingMultipleChoiceCardViewCompact.swift | 4 +--- .../Helper/OnboardingSegmentedControl.swift | 20 +------------------ .../OnboardingBasicCardViewRegular.swift | 2 -- ...oardingMultipleChoiceCardViewRegular.swift | 4 +--- 5 files changed, 5 insertions(+), 29 deletions(-) diff --git a/BrowserKit/Sources/ComponentLibrary/SwiftUI/OnboardingButton.swift b/BrowserKit/Sources/ComponentLibrary/SwiftUI/OnboardingButton.swift index 95d47a95beea1..9cafb2ce99bac 100644 --- a/BrowserKit/Sources/ComponentLibrary/SwiftUI/OnboardingButton.swift +++ b/BrowserKit/Sources/ComponentLibrary/SwiftUI/OnboardingButton.swift @@ -72,7 +72,7 @@ public struct OnboardingButton: View { } } - static func primary( + public static func primary( _ title: String, action: @escaping () -> Void, accessibilityIdentifier: String, @@ -91,7 +91,7 @@ public struct OnboardingButton: View { ) } - static func secondary( + public static func secondary( _ title: String, action: @escaping () -> Void, accessibilityIdentifier: String, diff --git a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingMultipleChoiceCardViewCompact.swift b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingMultipleChoiceCardViewCompact.swift index 254a3f33f4dfa..0cf4ba1671a85 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingMultipleChoiceCardViewCompact.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingMultipleChoiceCardViewCompact.swift @@ -59,9 +59,7 @@ struct OnboardingMultipleChoiceCardViewCompact( selection: $selectedAction, - items: viewModel.multipleChoiceButtons, - windowUUID: windowUUID, - themeManager: themeManager + items: viewModel.multipleChoiceButtons ) .onChange(of: selectedAction) { newAction in onMultipleChoiceAction(newAction, viewModel.name) diff --git a/BrowserKit/Sources/OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift b/BrowserKit/Sources/OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift index 9081639b4b06d..486e7227e9977 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift @@ -6,22 +6,15 @@ import SwiftUI import Common struct OnboardingSegmentedControl: View { - @State private var actionPrimary: Color = .clear @Binding var selection: Action let items: [OnboardingMultipleChoiceButtonModel] - let windowUUID: WindowUUID - var themeManager: ThemeManager init( selection: Binding, - items: [OnboardingMultipleChoiceButtonModel], - windowUUID: WindowUUID, - themeManager: ThemeManager + items: [OnboardingMultipleChoiceButtonModel] ) { self._selection = selection self.items = items - self.windowUUID = windowUUID - self.themeManager = themeManager } var body: some View { @@ -33,13 +26,6 @@ struct OnboardingSegmentedControl: View } } .accessibilityElement(children: .contain) - .onAppear { - applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID)) - } - .onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { - guard let uuid = $0.windowUUID, uuid == windowUUID else { return } - applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID)) - } } @ViewBuilder @@ -137,8 +123,4 @@ struct OnboardingSegmentedControl: View } } - private func applyTheme(theme: Theme) { - actionPrimary = Color(theme.colors.actionPrimary) - .opacity(UX.SegmentedControl.selectedColorOpacity) - } } diff --git a/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingBasicCardViewRegular.swift b/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingBasicCardViewRegular.swift index 0aef4225f8246..88fc966deb6a1 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingBasicCardViewRegular.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingBasicCardViewRegular.swift @@ -10,7 +10,6 @@ struct OnboardingBasicCardViewRegular( selection: $selectedAction, - items: viewModel.multipleChoiceButtons, - windowUUID: windowUUID, - themeManager: themeManager + items: viewModel.multipleChoiceButtons ) .onChange(of: selectedAction) { newAction in onMultipleChoiceAction(newAction, viewModel.name) From 5b527b04cde1bc977a9f4c35ec477fd38f96a91b Mon Sep 17 00:00:00 2001 From: Razvan Litianu Date: Fri, 26 Sep 2025 16:25:47 +0300 Subject: [PATCH 6/7] swiftlint --- .../OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/BrowserKit/Sources/OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift b/BrowserKit/Sources/OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift index 486e7227e9977..0fdfa7b4d0fce 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Helper/OnboardingSegmentedControl.swift @@ -122,5 +122,4 @@ struct OnboardingSegmentedControl: View .accessibilityHidden(true) } } - } From cb2438efdc5afe3582f251ea78c8d1c4cf31cd3d Mon Sep 17 00:00:00 2001 From: Razvan Litianu Date: Thu, 2 Oct 2025 15:18:32 +0300 Subject: [PATCH 7/7] Rename to CompatibilityBridge --- BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift | 4 ++-- .../Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift | 2 +- .../Views/Compact/OnboardingBasicCardViewCompact.swift | 2 +- .../Compact/OnboardingMultipleChoiceCardViewCompact.swift | 2 +- .../OnboardingKit/Views/Compact/OnboardingViewCompact.swift | 2 +- .../OnboardingKit/Views/Regular/OnboardingViewRegular.swift | 2 +- .../Views/TermsOfServiceView/TermsOfServiceCompactView.swift | 2 +- .../Views/TermsOfServiceView/TermsOfServiceRegularView.swift | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift b/BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift index b55fa835b787f..bd6de826f3ab7 100644 --- a/BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift +++ b/BrowserKit/Sources/ComponentLibrary/SwiftUI/Backport.swift @@ -4,11 +4,11 @@ import SwiftUI -public struct Backport { +public struct CompatibilityBridge { let content: Content } -public extension Backport where Content: View { +public extension CompatibilityBridge where Content: View { @MainActor @ViewBuilder func glassButtonStyle() -> some View { diff --git a/BrowserKit/Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift b/BrowserKit/Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift index 71c1450b0a647..74ea342a7949e 100644 --- a/BrowserKit/Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift +++ b/BrowserKit/Sources/ComponentLibrary/SwiftUI/ViewExtensions.swift @@ -34,5 +34,5 @@ extension View { } } - public var backport: Backport { Backport(content: self) } + public var bridge: CompatibilityBridge { CompatibilityBridge(content: self) } } diff --git a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift index 835a6437bf1cc..22c22447bb027 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Compact/OnboardingBasicCardViewCompact.swift @@ -66,7 +66,7 @@ struct OnboardingBasicCardViewCompact: View { .foregroundColor(skipTextColor) } .padding(.trailing, UX.Onboarding.Spacing.standard) - .backport.glassButtonStyle() + .bridge.glassButtonStyle() } .onAppear { applyTheme() diff --git a/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingViewRegular.swift b/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingViewRegular.swift index cd804fecbf8d4..f77acd8ff0560 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingViewRegular.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/Regular/OnboardingViewRegular.swift @@ -34,7 +34,7 @@ struct OnboardingViewRegular: View { tabView pageControl } - .backport + .bridge .cardBackground(cardBackgroundColor, cornerRadius: UX.CardView.cornerRadius) } } diff --git a/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift b/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift index 7b7fb32aaf9e2..424771e88f976 100644 --- a/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift +++ b/BrowserKit/Sources/OnboardingKit/Views/TermsOfServiceView/TermsOfServiceCompactView.swift @@ -80,7 +80,7 @@ public struct TermsOfServiceCompactView