Repository: microsoft/terminal (language: cpp)

Issue:
[Windows Terminal - Command Palette]: 'Shortcut keys' in 'Command Palette' are not visible in high contrast themes for focused or hovered rows.
### Windows Terminal version

1.22.2362.0

### Windows build number

27695.1000

### Other Software

**Test Environment:**
OS: Windows 11 Version Dev (OS Build 27695.1000)
App: Windows Terminal Preview

### Steps to reproduce

**Pre-requisite:**
Settings>Accessibility>Contrast themes>Aquatic/Desert theme>Reopen the application.

**Repro steps:**
1. Open the 'windows terminal' application.
2. Follow the above-mentioned pre-requisite step.
3. Now open any application like 'Windows Terminal'.
4. Open command Palette by pressing 'Ctrl + Shift + P' keys.
5. 'Command Palette' will open.
6.  Now navigate to any row by up/down arrow keys or hover with mouse.
7. Observe the issue.

**User experience:**
Users relying on high contrast themes, especially those with visual impairments, may find it challenging to see the shortcut keys in the Command Palette. This issue impacts navigation efficiency, as users cannot easily identify or use the shortcuts for commands.

**MAS Reference Link:**
[MAS 4.3.1 – No Disruption of Accessibility Features.docx (sharepoint.com)](https://microsoft.sharepoint.com/:w:/s/accessibility/EegntkLK4KBBvzE1qsKpIoABG2UIxUY2y3uo1LomKoz_bg?e=wLbDEr)

**Attachment:**
[Shortcut keys is not visible in high contrast themes.zip](https://github.com/user-attachments/files/16973765/Shortcut.keys.is.not.visible.in.high.contrast.themes.zip)

### Expected Behavior

The shortcut keys for commands in the Command Palette should be clearly visible in high contrast themes when rows are focused or hovered. Proper contrast between the text and background should ensure that users can easily see the shortcut keys.

### Actual Behavior

The shortcut keys associated with the commands in the Command Palette are not visible or are poorly visible when focused or hovered in high contrast themes. The lack of proper contrast makes it difficult to see the shortcut keys, impairing navigation.


Discussion / hints:

Fix patch:
diff --git a/src/cascadia/TerminalApp/CommandPalette.xaml b/src/cascadia/TerminalApp/CommandPalette.xaml
index eb47534f9c5..2ed0c136e5f 100644
--- a/src/cascadia/TerminalApp/CommandPalette.xaml
+++ b/src/cascadia/TerminalApp/CommandPalette.xaml
@@ -23,6 +23,27 @@
 
     <UserControl.Resources>
         <ResourceDictionary>
+            <!--  KeyChordText styles  -->
+            <Style x:Key="KeyChordBorderStyle"
+                   TargetType="Border">
+                <Setter Property="BorderThickness" Value="1" />
+                <Setter Property="CornerRadius" Value="2" />
+                <Setter Property="Background" Value="Transparent" />
+                <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
+            </Style>
+            <Style x:Key="KeyChordTextBlockStyle"
+                   TargetType="TextBlock">
+                <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
+            </Style>
+            <!--  ParsedCommandLineText styles  -->
+            <Style x:Key="ParsedCommandLineBorderStyle"
+                   TargetType="Border">
+                <Setter Property="BorderThickness" Value="1" />
+                <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
+                <Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
+                <Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
+            </Style>
+
             <DataTemplate x:Key="ListItemTemplate"
                           x:DataType="local:FilteredCommand">
                 <ListViewItem HorizontalContentAlignment="Stretch"
@@ -69,12 +90,12 @@
                             VerticalAlignment="Center"
                             AutomationProperties.AccessibilityView="Raw"
                             Background="{ThemeResource FlyoutPresenterBackground}"
-                            Style="{ThemeResource KeyChordBorderStyle}"
+                            Style="{StaticResource KeyChordBorderStyle}"
                             Visibility="{x:Bind mtu:Converters.StringNotEmptyToVisibility(Item.KeyChordText), Mode=OneWay}">
 
                         <TextBlock AutomationProperties.AccessibilityView="Raw"
                                    FontSize="12"
-                                   Style="{ThemeResource KeyChordTextBlockStyle}"
+                                   Style="{StaticResource KeyChordTextBlockStyle}"
                                    Text="{x:Bind Item.KeyChordText, Mode=OneWay}" />
                     </Border>
                 </Grid>
@@ -118,12 +139,12 @@
                             HorizontalAlignment="Right"
                             VerticalAlignment="Center"
                             AutomationProperties.AccessibilityView="Raw"
-                            Style="{ThemeResource KeyChordBorderStyle}"
+                            Style="{StaticResource KeyChordBorderStyle}"
                             Visibility="{x:Bind mtu:Converters.StringNotEmptyToVisibility(Item.KeyChordText), Mode=OneWay}">
 
                         <TextBlock AutomationProperties.AccessibilityView="Raw"
                                    FontSize="12"
-                                   Style="{ThemeResource KeyChordTextBlockStyle}"
+                                   Style="{StaticResource KeyChordTextBlockStyle}"
                                    Text="{x:Bind Item.KeyChordText, Mode=OneWay}" />
                     </Border>
 
@@ -219,79 +240,6 @@
                                                GeneralItemTemplate="{StaticResource GeneralItemTemplate}"
                                                NestedItemTemplate="{StaticResource NestedItemTemplate}"
                                                TabItemTemplate="{StaticResource TabItemTemplate}" />
-
-            <ResourceDictionary.ThemeDictionaries>
-                <ResourceDictionary x:Key="Dark">
-
-                    <!--  KeyChordText styles  -->
-                    <Style x:Key="KeyChordBorderStyle"
-                           TargetType="Border">
-                        <Setter Property="BorderThickness" Value="1" />
-                        <Setter Property="CornerRadius" Value="2" />
-                        <Setter Property="Background" Value="Transparent" />
-                        <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
-                    </Style>
-                    <Style x:Key="KeyChordTextBlockStyle"
-                           TargetType="TextBlock">
-                        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
-                    </Style>
-
-                    <!--  ParsedCommandLineText styles  -->
-                    <Style x:Key="ParsedCommandLineBorderStyle"
-                           TargetType="Border">
-                        <Setter Property="BorderThickness" Value="1" />
-                        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
-                        <Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
-                        <Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
-                    </Style>
-                    <Style x:Key="ParsedCommandLineTextBlockStyle"
-                           TargetType="TextBlock">
-                        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
-                    </Style>
-                </ResourceDictionary>
-                <ResourceDictionary x:Key="Light">
-
-                    <!--  KeyChordText styles  -->
-                    <Style x:Key="KeyChordBorderStyle"
-                           TargetType="Border">
-                        <Setter Property="BorderThickness" Value="1" />
-                        <Setter Property="CornerRadius" Value="2" />
-                        <Setter Property="Background" Value="Transparent" />
-                        <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
-                    </Style>
-                    <Style x:Key="KeyChordTextBlockStyle"
-                           TargetType="TextBlock">
-                        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
-                    </Style>
-
-                    <!--  ParsedCommandLineText styles  -->
-                    <Style x:Key="ParsedCommandLineBorderStyle"
-                           TargetType="Border">
-                        <Setter Property="BorderThickness" Value="1" />
-                        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
-                        <Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
-                        <Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
-                    </Style>
-                    <Style x:Key="ParsedCommandLineTextBlockStyle"
-                           TargetType="TextBlock">
-                        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
-                    </Style>
-                </ResourceDictionary>
-                <ResourceDictionary x:Key="HighContrast">
-
-                    <!--  KeyChordText styles (use XAML defaults for High Contrast theme)  -->
-                    <Style x:Key="KeyChordBorderStyle"
-                           TargetType="Border" />
-                    <Style x:Key="KeyChordTextBlockStyle"
-                           TargetType="TextBlock" />
-
-                    <!--  ParsedCommandLineText styles (use XAML defaults for High Contrast theme)  -->
-                    <Style x:Key="ParsedCommandLineBorderStyle"
-                           TargetType="Border" />
-                    <Style x:Key="ParsedCommandLineTextBlockStyle"
-                           TargetType="TextBlock" />
-                </ResourceDictionary>
-            </ResourceDictionary.ThemeDictionaries>
         </ResourceDictionary>
     </UserControl.Resources>
 
@@ -375,7 +323,7 @@
                     Padding="16,12"
                     HorizontalAlignment="Stretch"
                     VerticalAlignment="Center"
-                    Style="{ThemeResource ParsedCommandLineBorderStyle}"
+                    Style="{StaticResource ParsedCommandLineBorderStyle}"
                     Visibility="{x:Bind mtu:Converters.StringNotEmptyToVisibility(ParsedCommandLineText), Mode=OneWay}">
 
                 <ScrollViewer MaxHeight="200"


Test patch: