Skip to content
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

🎙️ a11y: Screen Reader Support for Dynamic Content Updates #3625

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Aug 13, 2024

Summary

I implemented initial screen reader support for dynamic content updates.

  • Added a LiveAnnouncer component to manage and broadcast live announcements for screen readers.
  • Implemented AnnouncerContext to provide announcement functionality throughout the application.
  • Created utility components such as Announcer, MessageBlock, LiveMessage, and LiveMessenger to support screen reader announcements.
  • Integrated the announcer functionality into the SSE event handlers for real-time updates.
  • Uses semantically split chunks for processing of streamed content to provide more natural and coherent announcements (same strategy as text-to-speech audio stream).

Largely addresses:

Todo to close issue:

  • Content updates for beginning/end of tool calls, image generation
  • Content updates for Assistants API messages, i.e. content blocks with type "text".

Change Type

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

I tested the changes by generating AI responses and verifying that the screen reader announcements were triggered correctly. I also tested the streaming functionality to ensure that the announcements were coherent and timely.

Test Configuration:

  • Screen reader: NVDA (latest version)
  • Browser: Chrome (latest version)
  • Operating System: Windows 11

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

@danny-avila danny-avila added the a11y Accessibility label Aug 13, 2024
@danny-avila danny-avila changed the title 🎙️ feat: Screen Reader Support for Dynamic Content Updates 🎙️ a11y: Screen Reader Support for Dynamic Content Updates Aug 13, 2024
@danny-avila danny-avila merged commit 6655304 into main Aug 13, 2024
5 checks passed
@danny-avila danny-avila deleted the a11y/dynamic-content-updates branch August 13, 2024 07:04
danny-avila added a commit that referenced this pull request Aug 17, 2024
* WIP: first pass, hooks

* wip: isStream arg

* feat: first pass, dynamic content updates, screen reader announcements

* chore: unrelated, styling redundancy
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
…la#3625)

* WIP: first pass, hooks

* wip: isStream arg

* feat: first pass, dynamic content updates, screen reader announcements

* chore: unrelated, styling redundancy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant