From 00d0299a1745a22fbd136807b3f7f0364d4450c7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:29:27 +0200 Subject: [PATCH] =?UTF-8?q?Bugfix=20FXIOS-10512=20=E2=81=83=20[Menu]=20[Ac?= =?UTF-8?q?cessibility]=20-=20"Tools"=20and=20"Save"=20headers=20are=20not?= =?UTF-8?q?=20announced=20(backport=20#23078)=20(#23088)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugfix FXIOS-10512 ⁃ [Menu] [Accessibility] - "Tools" and "Save" headers are not announced (#23078) FXIOS-10512 #23050 ⁃ [Menu redesign] [Accessibility] - "Tools" and "Save" headers are not announced (cherry picked from commit 52f77c931f48ffaebda711efafe9a4739ae7fbcc) Co-authored-by: dicarobinho <61138287+dicarobinho@users.noreply.github.com> --- .../ComponentLibrary/Headers/NavigationHeaderView.swift | 5 +++++ BrowserKit/Sources/MenuKit/MenuDetailView.swift | 2 ++ .../Client/Application/AccessibilityIdentifiers.swift | 1 + .../MainMenu/Views/MainMenuDetailsViewController.swift | 1 + 4 files changed, 9 insertions(+) diff --git a/BrowserKit/Sources/ComponentLibrary/Headers/NavigationHeaderView.swift b/BrowserKit/Sources/ComponentLibrary/Headers/NavigationHeaderView.swift index ba774fefdc7a..b1421e31bb34 100644 --- a/BrowserKit/Sources/ComponentLibrary/Headers/NavigationHeaderView.swift +++ b/BrowserKit/Sources/ComponentLibrary/Headers/NavigationHeaderView.swift @@ -98,11 +98,16 @@ public final class NavigationHeaderView: UIView { public func setupAccessibility(closeButtonA11yLabel: String, closeButtonA11yId: String, + titleA11yId: String? = nil, backButtonA11yLabel: String, backButtonA11yId: String) { let closeButtonViewModel = CloseButtonViewModel(a11yLabel: closeButtonA11yLabel, a11yIdentifier: closeButtonA11yId) closeButton.configure(viewModel: closeButtonViewModel) + if let titleA11yId { + titleLabel.isAccessibilityElement = true + titleLabel.accessibilityIdentifier = titleA11yId + } backButton.accessibilityIdentifier = backButtonA11yId backButton.accessibilityLabel = backButtonA11yLabel } diff --git a/BrowserKit/Sources/MenuKit/MenuDetailView.swift b/BrowserKit/Sources/MenuKit/MenuDetailView.swift index f578f7f10198..dec2fb30374a 100644 --- a/BrowserKit/Sources/MenuKit/MenuDetailView.swift +++ b/BrowserKit/Sources/MenuKit/MenuDetailView.swift @@ -49,10 +49,12 @@ public final class MenuDetailView: UIView, public func setupAccessibilityIdentifiers(closeButtonA11yLabel: String, closeButtonA11yId: String, + titleA11yId: String? = nil, backButtonA11yLabel: String, backButtonA11yId: String) { detailHeaderView.setupAccessibility(closeButtonA11yLabel: closeButtonA11yLabel, closeButtonA11yId: closeButtonA11yId, + titleA11yId: titleA11yId, backButtonA11yLabel: backButtonA11yLabel, backButtonA11yId: backButtonA11yId) } diff --git a/firefox-ios/Client/Application/AccessibilityIdentifiers.swift b/firefox-ios/Client/Application/AccessibilityIdentifiers.swift index e2ccfd7a4b2b..fb1f6f228933 100644 --- a/firefox-ios/Client/Application/AccessibilityIdentifiers.swift +++ b/firefox-ios/Client/Application/AccessibilityIdentifiers.swift @@ -80,6 +80,7 @@ public struct AccessibilityIdentifiers { struct NavigationHeaderView { static let backButton = "MainMenu.BackButton" + static let title = "MainMenu.Title" static let closeButton = "MainMenu.CloseMenuButton" } diff --git a/firefox-ios/Client/Frontend/Browser/MainMenu/Views/MainMenuDetailsViewController.swift b/firefox-ios/Client/Frontend/Browser/MainMenu/Views/MainMenuDetailsViewController.swift index 0e216d41842e..9d7a8f73ad82 100644 --- a/firefox-ios/Client/Frontend/Browser/MainMenu/Views/MainMenuDetailsViewController.swift +++ b/firefox-ios/Client/Frontend/Browser/MainMenu/Views/MainMenuDetailsViewController.swift @@ -102,6 +102,7 @@ class MainMenuDetailsViewController: UIViewController, submenuContent.setupAccessibilityIdentifiers( closeButtonA11yLabel: .MainMenu.Account.AccessibilityLabels.CloseButton, closeButtonA11yId: AccessibilityIdentifiers.MainMenu.NavigationHeaderView.closeButton, + titleA11yId: AccessibilityIdentifiers.MainMenu.NavigationHeaderView.title, backButtonA11yLabel: .MainMenu.Account.AccessibilityLabels.BackButton, backButtonA11yId: AccessibilityIdentifiers.MainMenu.NavigationHeaderView.backButton) }