Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 9, 2025

This PR cherry-picks commit 8826a55 from main to the 0.80-stable branch.

Summary

This change adds UI Automation (UIA) HeadingLevel support for the Fabric architecture in React Native Windows. This enables proper accessibility behavior for heading elements, allowing screen readers and other assistive technologies to correctly identify and navigate heading levels (H1-H9) in Fabric-based applications.

Changes

Core Implementation

  • Added GetHeadingLevel() function in UiaHelpers.cpp that maps accessibility levels (1-9) to UIA HeadingLevel constants when the element has a heading role
  • Added GetControlTypeFromRole() and GetControlTypeFromString() helper functions to properly map React Native roles to UIA control types
  • Updated CompositionDynamicAutomationProvider.cpp to query and expose the HeadingLevel property via IUIAutomationElement8

Test Updates

  • Updated accessibility example to use role="heading" and accessibilityRole="header" to demonstrate the feature
  • Updated test snapshots to reflect:
    • HeadingLevel property values (80051 for level 1, 80052 for level 2, etc.)
    • ControlType change from 50026 (group) to 50020 (text) for heading elements
    • LocalizedControlType change from "group" to "text" for heading elements

Conflict Resolution

One merge conflict was resolved in AccessibilityTest.test.ts.snap where the 0.80-stable branch includes "Name" fields in test snapshots that aren't present in main. The resolution preserved the "Name" fields while accepting the LocalizedControlType changes from the cherry-picked commit.

Testing

The changes include updated test snapshots that validate:

  • HeadingLevel property is correctly exposed for elements with heading roles
  • Accessibility levels 1-2 map to HeadingLevel1 and HeadingLevel2 respectively
  • Control types are correctly mapped for heading elements

Fixes accessibility navigation and screen reader support for heading elements in Fabric architecture.

Original prompt

cherry pick this commit to 0.80-stable and raise PR

8826a55


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Microsoft Reviewers: Open in CodeFlow

* Add HeadingLevel Behaviour for Fabric Arch

* format fix

* function definition fix

* Update Snapshot
@Copilot Copilot AI changed the title [WIP] Cherry pick commit 8826a55 to 0.80-stable [0.80-stable] Cherry-pick: Add UIA HeadingLevel behaviour for Fabric architecture Oct 9, 2025
@Copilot Copilot AI requested a review from vineethkuttan October 9, 2025 10:33
Copilot finished work on behalf of vineethkuttan October 9, 2025 10:33
@vineethkuttan
Copy link
Contributor

/azp run PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vineethkuttan vineethkuttan marked this pull request as ready for review October 9, 2025 14:06
@vineethkuttan vineethkuttan requested a review from a team as a code owner October 9, 2025 14:06
@vineethkuttan vineethkuttan merged commit 8420be7 into 0.80-stable Oct 10, 2025
91 checks passed
@vineethkuttan vineethkuttan deleted the copilot/cherry-pick-commit-8826a55 branch October 10, 2025 04:50
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.

3 participants