-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Fabric] Implementation of accessibiltyAnnotation and adding support for IAnnotationProvider #14626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Fabric] Implementation of accessibiltyAnnotation and adding support for IAnnotationProvider #14626
Conversation
...Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h
Outdated
Show resolved
Hide resolved
packages/e2e-test-app-fabric/test/__snapshots__/TouchableComponentTest.test.ts.snap
Outdated
Show resolved
Hide resolved
80b98c3
to
83f0fab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for a new accessibility annotation feature on Windows by adding an accessibilityAnnotation property and a new CompositionAnnotationProvider. Key changes include:
- Adding the accessibilityAnnotation attribute in JavaScript and native view property configuration.
- Updating HostPlatformViewProps (.h/.cpp) to handle the new accessibilityAnnotation prop.
- Implementing the CompositionAnnotationProvider and updating UI Automation helper functions and test samples to support the annotation functionality.
Reviewed Changes
Copilot reviewed 14 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
vnext/src-win/Libraries/NativeComponent/BaseViewConfig.windows.js | Added the accessibilityAnnotation attribute to the valid attributes list. |
vnext/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.{h,cpp} | Introduced a new optional AccessibilityAnnotation property and updated raw property conversion. |
vnext/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.{h,cpp} | Introduced GetAnnotationTypeId and accessibilityAnnotationHasValue to support annotation logic. |
vnext/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.{h,cpp} | Added a new provider for handling accessibility annotation details in UIA. |
CompositionDynamicAutomationProvider.{cpp,h} | Updated provider to initialize and return the new annotation provider when applicable. |
packages/playground/Samples/text.tsx & tester/example files | Updated sample and test code to include annotation examples. |
Files not reviewed (5)
- change/react-native-windows-a703b417-fd1e-4499-ae0b-a4ce670db2bb.json: Language not supported
- packages/e2e-test-app-fabric/test/snapshots/AccessibilityTest.test.ts.snap: Language not supported
- packages/e2e-test-app-fabric/test/snapshots/snapshotPages.test.js.snap: Language not supported
- vnext/Shared/Shared.vcxitems: Language not supported
- vnext/Shared/Shared.vcxitems.filters: Language not supported
Comments suppressed due to low confidence (1)
packages/@react-native-windows/tester/src/js/examples-win/Accessibility/AccessibilityExampleWindows.tsx:26
- [nitpick] There appears to be a typo in the accessibilityLabel value, 'Annotation Checkc' might be intended as 'Annotation Check'.
accessibilityLabel="Annotation Checkc"
@@ -36,6 +37,12 @@ CompositionDynamicAutomationProvider::CompositionDynamicAutomationProvider( | |||
strongView.as<winrt::Microsoft::ReactNative::Composition::ComponentView>(), this) | |||
.try_as<ITextProvider2>(); | |||
} | |||
|
|||
if (strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::ViewComponentView>()) { | |||
m_annotationProvider = winrt::make<CompositionAnnotationProvider>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we file a followup issue to make m_annotationProvider and m_textProvider be delay created. If the consuming UIA agent does not request these patterns we shouldn't create these providers.
Description
Type of Change
Why
Implementing accessibilityAnnotation for windows platform and adding support for IAnnotationProvider will help in providing accessibility information to the screen reader.
Resolves [#14531 ]
What
Added new Proivder
CompositionAnnotationProvider
to the projectScreenshots
Before Implementation:

After Implementation:
Testing
Tested in Playground , added test cases for the same
Optional: Describe the tests that you ran locally to verify your changes.
Changelog
Should this change be included in the release notes: yes
Added Support for the
IAnnotationProvider
Microsoft Reviewers: Open in CodeFlow