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

Adds custom middleware for rendering attachment in live region for screen reader #3548

Merged

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Oct 20, 2020

Fixes #3547.

Changelog Entry

Fixed

Description

Added new middleware for rendering attachment in screen reader.

Added default renderer for built-in attachment types, including Adaptive Cards, rich cards, and other media.

Design

Today, the screen reader narrate "Bot said: Hi I am Clara. 1 attachment."

Tomorrow, the screen reader will narrate "Bot said: Hi I am Clara. Card: I agree button. I don't agree button."

The DOM tree rendered in live region need to be simplified. Thus, we provide a new middleware for rendering attachments specific for live region.

Specific Changes

  • Added new useCreateAttachmentForScreenReaderRenderer hook
  • Updated ScreenReaderActivity to render using the new middleware
  • Added middleware for built-in attachment types
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

CHANGELOG.md Outdated Show resolved Hide resolved
docs/HOOKS.md Outdated Show resolved Hide resolved
@@ -40,6 +40,15 @@
"ACTIVITY_STATUS_TIMESTAMP_YESTERDAY": "Yesterday",
"ADAPTIVE_CARD_ERROR_BOX_TITLE_PARSE": "Adaptive Card parse error",
"ADAPTIVE_CARD_ERROR_BOX_TITLE_RENDER": "Adaptive Card render error",
"ATTACHMENT_AUDIO": "An audio clip.",
"ATTACHMENT_CARD": "A card: $1 $2 $3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to specify attachment here? "A card attachment: $1 $2 $3"

Copy link
Contributor

@corinagum corinagum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, pending comments

@compulim compulim merged commit df4c2ff into microsoft:master Oct 26, 2020
@compulim compulim deleted the feat-accessibility-narrate-attachments branch October 26, 2020 18:05
@compulim compulim mentioned this pull request Oct 29, 2020
48 tasks
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.

[Accessibility] Custom render attachment for screen reader
2 participants