Repository: microsoft/terminal (language: cpp)

Issue:
[Color Schemes]: Screen reader does not announce the 'default' visible text defined with the 'Campbell' color scheme on the page.
### Windows Terminal version

1.17.3052.0

### Windows build number

Windows 11 Version 22H2 (OS Build 25206.1000)

### Other Software

_No response_

### Steps to reproduce

1. Open Windows Terminal.
2. Open 'Settings > Startup' window with 'Ctrl+,' keys.
3. Turn on Narrator by 'Ctrl+Win+Enter' keys.
4. Navigate to 'Color schemes' list item by down arrow key and select it.
5. Navigate to 'Campbel' by the tab key.
6. Observe the Narrator's announcement here.

**User Experience: -**
Screen reader users will have to navigate in scan mode to get this value information defined with the color control.

**Guideline Reference:**
(https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)

**Attachments:**
[Screen reader does not announce the 'default' visible text defined with the 'Campbell' color scheme on the page..zip](https://github.com/microsoft/terminal/files/10028996/Screen.reader.does.not.announce.the.default.visible.text.defined.with.the.Campbell.color.scheme.on.the.page.zip)


### Expected Behavior

Screen reader should announce the 'default' visible text defined with the 'Campbell' color scheme on the page. It should announce as '_Campbell, default, 1 of 11 selected_'.

### Actual Behavior

Screen reader does not announce the 'default' visible text defined with the 'Campbell' color scheme on the page. It announces as '_Campbell, 1 of 11 selected_'.

**Observation:**

Issue also reproes with the NVDA screen reader.



Discussion / hints:
FWIW, this still repros on the current Color Schemes page, circa 1.17.3481.0

Fix patch:
diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp b/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp
index 86bc0f20ef1..80a83607cef 100644
--- a/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp
+++ b/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp
@@ -37,6 +37,21 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
     {
         _ViewModel = e.Parameter().as<Editor::ColorSchemesPageViewModel>();
         _ViewModel.CurrentPage(ColorSchemesSubPage::Base);
+
+        _layoutUpdatedRevoker = LayoutUpdated(winrt::auto_revoke, [this](auto /*s*/, auto /*e*/) {
+            // Only let this succeed once.
+            _layoutUpdatedRevoker.revoke();
+
+            for (const auto scheme : _ViewModel.AllColorSchemes())
+            {
+                if (scheme.IsDefaultScheme())
+                {
+                    winrt::hstring newName{ fmt::format(L"{} ({})", scheme.Name(), RS_(L"ColorScheme_DefaultTag/Text")) };
+                    Automation::AutomationProperties::SetName(ColorSchemeListView().ContainerFromItem(scheme), newName);
+                    break;
+                }
+            }
+        });
     }
 
     void ColorSchemes::AddNew_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/)
diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemes.h b/src/cascadia/TerminalSettingsEditor/ColorSchemes.h
index e46bf19dfb8..63f755a6b26 100644
--- a/src/cascadia/TerminalSettingsEditor/ColorSchemes.h
+++ b/src/cascadia/TerminalSettingsEditor/ColorSchemes.h
@@ -13,6 +13,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
 {
     struct ColorSchemes : public HasScrollViewer<ColorSchemes>, ColorSchemesT<ColorSchemes>
     {
+    public:
         ColorSchemes();
 
         void OnNavigatedTo(const winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs& e);
@@ -25,6 +26,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
         WINRT_OBSERVABLE_PROPERTY(Editor::ColorSchemesPageViewModel, ViewModel, _PropertyChangedHandlers, nullptr);
 
         WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
+
+    private:
+        winrt::Windows::UI::Xaml::FrameworkElement::LayoutUpdated_revoker _layoutUpdatedRevoker;
     };
 }
 


Test patch: