From c4826198dcbb251050e07901381f758dfa6d9c8e Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Wed, 2 Feb 2022 12:45:05 -0800 Subject: [PATCH] Update accessible names for 'add profile' page buttons (#12324) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary of the Pull Request When using a screen reader, the buttons on the "add a new profile" page were being read weirdly: - "New empty profile" button read as "create new button button" - "duplicate" button read as "duplicate button button" It's generally standard to read out the text inside the button, so I did just that by reusing the existing localized resources. This also removes the redundant "button" that is said by the screen reader. I also removed the unused `AutomationId` and unnecessary `Button.Content` tags. #11156 can be closed upon validation by the accessibility team. ## Validation Steps Performed ✅ navigate to both buttons using Narrator; make sure it sounds right (cherry picked from commit 24c5f7bba484697772ac568b0816b1999ee8e44e) --- src/cascadia/TerminalSettingsEditor/AddProfile.cpp | 6 ++++++ src/cascadia/TerminalSettingsEditor/AddProfile.xaml | 8 ++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cascadia/TerminalSettingsEditor/AddProfile.cpp b/src/cascadia/TerminalSettingsEditor/AddProfile.cpp index 15fd71138ae..cf9d6d623ed 100644 --- a/src/cascadia/TerminalSettingsEditor/AddProfile.cpp +++ b/src/cascadia/TerminalSettingsEditor/AddProfile.cpp @@ -7,9 +7,12 @@ #include "AddProfilePageNavigationState.g.cpp" #include "EnumEntry.h" +#include + using namespace winrt::Windows::Foundation; using namespace winrt::Windows::System; using namespace winrt::Windows::UI::Core; +using namespace winrt::Windows::UI::Xaml; using namespace winrt::Windows::UI::Xaml::Navigation; using namespace winrt::Microsoft::Terminal::Settings::Model; @@ -18,6 +21,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation AddProfile::AddProfile() { InitializeComponent(); + + Automation::AutomationProperties::SetName(AddNewButton(), RS_(L"AddProfile_AddNewTextBlock/Text")); + Automation::AutomationProperties::SetName(DuplicateButton(), RS_(L"AddProfile_DuplicateTextBlock/Text")); } void AddProfile::OnNavigatedTo(const NavigationEventArgs& e) diff --git a/src/cascadia/TerminalSettingsEditor/AddProfile.xaml b/src/cascadia/TerminalSettingsEditor/AddProfile.xaml index ead73a4eebb..dd8defdfe5c 100644 --- a/src/cascadia/TerminalSettingsEditor/AddProfile.xaml +++ b/src/cascadia/TerminalSettingsEditor/AddProfile.xaml @@ -23,9 +23,7 @@ -