Skip to content

Fix incorrect heading levels for Home page section headings#1973

Merged
marcelwgn merged 2 commits intomainfrom
copilot/fix-1955
Jul 30, 2025
Merged

Fix incorrect heading levels for Home page section headings#1973
marcelwgn merged 2 commits intomainfrom
copilot/fix-1955

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jul 30, 2025

This PR fixes an accessibility issue where section headings on the Home page were being announced by screen readers as "heading level 1" instead of the appropriate "heading level 2".

Problem

Screen reader users navigating the WinUI 3 Gallery Home page in headings mode experienced incorrect heading level announcements for:

  • "Recently visited" section heading
  • "Recently added or updated" section heading

These headings were missing proper AutomationProperties.HeadingLevel attributes, causing them to default to level 1, which breaks the document's heading hierarchy.

Solution

Added AutomationProperties.HeadingLevel="Level2" to both TextBlock elements serving as section headings in HomePage.xaml:

<TextBlock
    x:Name="RecentlyVisitedTitle"
    FontSize="16"
    Style="{StaticResource BodyStrongTextBlockStyle}"
    Text="Recently visited"
    AutomationProperties.HeadingLevel="Level2" />

<TextBlock
    Margin="0,12,0,0"
    FontSize="16"
    Style="{StaticResource BodyStrongTextBlockStyle}"
    Text="Recently added or updated"
    AutomationProperties.HeadingLevel="Level2" />

Impact

  • Screen readers now correctly announce these headings as "heading level 2"
  • Improved accessibility compliance and document structure hierarchy
  • Better navigation experience for users with visual impairments
  • Follows existing accessibility patterns used throughout the codebase

The changes are minimal and surgical, affecting only the specific elements mentioned in the accessibility issue while maintaining consistency with established patterns in the accessibility sample pages.

Fixes #1955.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • e7bvsblobprodcus348.vsblob.vsassets.io
    • Triggering command: dotnet build WinUIGallery.sln --configuration Debug (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Copilot AI changed the title [WIP] [WinUI 3 Gallery: Home]: Incorrect heading level is defined for 'Recently added samples' heading. Fix incorrect heading levels for Home page section headings Jul 30, 2025
Copilot AI requested a review from niels9001 July 30, 2025 09:43
@niels9001
Copy link
Copy Markdown
Collaborator

/azp run

@niels9001 niels9001 marked this pull request as ready for review July 30, 2025 09:49
@marcelwgn marcelwgn merged commit bd2d3b7 into main Jul 30, 2025
2 checks passed
@marcelwgn marcelwgn deleted the copilot/fix-1955 branch July 30, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WinUI 3 Gallery: Home]: Incorrect heading level is defined for 'Recently added samples' heading.

3 participants