Skip to content

Accessibility#42

Open
michalpobuta wants to merge 2 commits intoRedth:mainfrom
michalpobuta:feature/accessibility
Open

Accessibility#42
michalpobuta wants to merge 2 commits intoRedth:mainfrom
michalpobuta:feature/accessibility

Conversation

@michalpobuta
Copy link
Copy Markdown
Contributor

This pull request introduces significant new accessibility and UI inspection features to the DevFlow agent, including new API endpoints for accessibility tree inspection and element highlighting, as well as enhancements to the element information model. The changes enable clients to retrieve both a semantic accessibility tree and the native screen reader traversal order, and to visually highlight elements (with auto-clear and scroll-into-view support). The codebase is also extended to collect and expose detailed accessibility and color information for UI elements.

Accessibility inspection and API enhancements:

  • Added new API endpoints /api/accessibility and /api/a11y/native-tree to expose the accessibility tree and the native screen reader order, respectively. The /api/accessibility endpoint returns a flattened list of elements with accessibility information, while /api/a11y/native-tree returns the exact order in which a platform screen reader would visit elements. [1] [2]
  • Extended the ElementInfo model to include AccessibilityInfo, EffectiveTextColor, and EffectiveBackgroundColor properties, enabling richer inspection of UI and accessibility attributes. [1] [2]
  • Implemented AccessibilityInfo and NativeScreenReaderEntry classes to represent native accessibility properties and screen reader traversal entries.
  • Added logic in VisualTreeWalker to populate accessibility info using both MAUI semantic properties and platform-specific details, and to provide the native accessibility tree and mapping between native views and MAUI element IDs. [1] [2] [3]

Element highlight and UI interaction:

  • Introduced a /api/action/highlight endpoint and supporting logic for visually highlighting elements, with support for custom color, auto-clear duration, scroll-into-view, and fallback bounds for native-only elements. The highlight overlay is managed with cancellation and cleanup logic. [1] [2] [3]

These changes provide a foundation for advanced accessibility testing and visual debugging workflows in the DevFlow agent.

Most important changes:

Accessibility APIs and models

  • Added /api/accessibility and /api/a11y/native-tree endpoints for retrieving accessibility information and native screen reader traversal order, including logic for flattening and counting accessibility elements. [1] [2]
  • Introduced AccessibilityInfo and NativeScreenReaderEntry classes, and extended ElementInfo with accessibility and effective color properties. [1] [2]
  • Enhanced VisualTreeWalker to populate accessibility info from MAUI and native APIs, and to provide the native accessibility tree and view-to-ID mapping. [1] [2] [3]

Highlighting and UI feedback

  • Added /api/action/highlight endpoint and HighlightRequest class, supporting visual highlighting of elements with configurable color, duration, scroll-into-view, and fallback to raw bounds. Includes logic for auto-clear and cancellation of highlights. [1] [2] [3]

General improvements

  • Updated the route registration in RegisterRoutes() to include new endpoints for accessibility and highlighting actions.

michalpobuta and others added 2 commits March 14, 2026 13:34
- Add /api/a11y/native-tree endpoint returning elements in screen reader traversal order
- Add NativeScreenReaderEntry model with label, hint, value, role, traits, isHeading, bounds
- Implement WalkIosA11yTree using UIAccessibilityElement/UIAccessibilityContainer (VoiceOver ground truth)
- Implement WalkAndroidA11yTree using AccessibilityNodeInfo per-view (TalkBack ground truth):
  - Use Clickable/LongClickable/Checkable/hasLabel as focusability predicate instead of heuristics
  - Remove VisibleToUser filter — TalkBack navigates to off-screen elements in scrollable containers
  - Use NoHideDescendants check to correctly prune entire subtrees
  - Use object identity for cycle detection instead of view.Id (multiple views can share same ID)
- Implement WalkWindowsA11yTree using AutomationPeer (Narrator ground truth)
- Implement WalkMacA11yTree using NSAccessibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- FrameworkElement does not have Background in WinUI; cast to Control
  or Panel before accessing the property (CS1061)
- AutomationPeer.IsContentElementCore() is protected; use the public
  IsContentElement() wrapper instead (CS0122)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant