From e0c6a10fa8abd0a8149adb09cb89e4612a77fb68 Mon Sep 17 00:00:00 2001 From: amddg44 Date: Wed, 2 Oct 2024 18:18:25 +0200 Subject: [PATCH 1/2] Dismiss sync promo --- .maestro/release_tests/password-management.yaml | 8 ++++++++ DuckDuckGo/SyncPromoView.swift | 2 ++ 2 files changed, 10 insertions(+) diff --git a/.maestro/release_tests/password-management.yaml b/.maestro/release_tests/password-management.yaml index 79edf8a313..65db12ffea 100644 --- a/.maestro/release_tests/password-management.yaml +++ b/.maestro/release_tests/password-management.yaml @@ -49,6 +49,14 @@ tags: - tapOn: "Save" - tapOn: "Passwords" + +# Dismiss Sync Promo if visible +- runFlow: + when: + visible: "No Thanks" + commands: + - tapOn: "No Thanks" + - tapOn: "Settings" - tapOn: "Done" diff --git a/DuckDuckGo/SyncPromoView.swift b/DuckDuckGo/SyncPromoView.swift index a77a410ad2..550b418237 100644 --- a/DuckDuckGo/SyncPromoView.swift +++ b/DuckDuckGo/SyncPromoView.swift @@ -48,6 +48,7 @@ struct SyncPromoView: View { Text(viewModel.secondaryButtonTitle) } .buttonStyle(SecondaryFillButtonStyle(compact: true, fullWidth: false)) + .accessibilityLabel(viewModel.secondaryButtonTitle) Button { viewModel.primaryButtonAction?() @@ -55,6 +56,7 @@ struct SyncPromoView: View { Text(viewModel.primaryButtonTitle) } .buttonStyle(PrimaryButtonStyle(compact: true, fullWidth: false)) + .accessibilityLabel(viewModel.primaryButtonTitle) } .padding(.top, 12) From 1f3da19595aba444516c22fc42b9fdb35c751d48 Mon Sep 17 00:00:00 2001 From: amddg44 Date: Thu, 3 Oct 2024 11:35:24 +0200 Subject: [PATCH 2/2] Improved approach to handle maestro crash --- .maestro/release_tests/password-management.yaml | 8 -------- DuckDuckGo/SyncPromoView.swift | 11 +++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.maestro/release_tests/password-management.yaml b/.maestro/release_tests/password-management.yaml index 65db12ffea..79edf8a313 100644 --- a/.maestro/release_tests/password-management.yaml +++ b/.maestro/release_tests/password-management.yaml @@ -49,14 +49,6 @@ tags: - tapOn: "Save" - tapOn: "Passwords" - -# Dismiss Sync Promo if visible -- runFlow: - when: - visible: "No Thanks" - commands: - - tapOn: "No Thanks" - - tapOn: "Settings" - tapOn: "Done" diff --git a/DuckDuckGo/SyncPromoView.swift b/DuckDuckGo/SyncPromoView.swift index 550b418237..b9539aa78f 100644 --- a/DuckDuckGo/SyncPromoView.swift +++ b/DuckDuckGo/SyncPromoView.swift @@ -24,6 +24,7 @@ import DuckUI struct SyncPromoView: View { let viewModel: SyncPromoViewModel + @State private var isAccessibilityHidden = true var body: some View { ZStack(alignment: .topTrailing) { @@ -31,6 +32,8 @@ struct SyncPromoView: View { Group { Image(viewModel.image) .scaledToFit() + .accessibilityHidden(true) + Text(viewModel.title) .padding(.top, 4) .frame(maxWidth: .infinity) @@ -83,6 +86,7 @@ struct SyncPromoView: View { .alignmentGuide(.top) { dimension in dimension[.top] } + .accessibilityHidden(true) } .background( RoundedRectangle(cornerRadius: 8) @@ -90,6 +94,13 @@ struct SyncPromoView: View { ) .padding(.horizontal, 20) .padding(.bottom, 12) + .accessibilityHidden(isAccessibilityHidden) + .onAppear { + // Delay accessibility activation for maestro + DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { + isAccessibilityHidden = false + } + } } }