Add typing indicator to live region #4210
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog Entry
Added
Description
When receiving a typing activity, screen reader should narrate "Bot is typing."
Design
Who is typing
Depends on which participant send the typing activity, it could be "Bot is typing" or "John is typing".
Direct Line activity do have a field
from.name
to indicate the name of the sender. However, Direct Line does not return a friendly bot name and we need to patch it.If all of the condition is true, we will change the
activity.from.name
to"Bot"
:activity.channelData
is"directline"
or"webchat"
, and;activity.from.role
is"bot"
, and;activity.from.id
is the same asactivity.from.name
.When more than one participant is typing, the typing indicator will be read as "John and others are typing."
Incorrect
at
field returned byuseActiveTyping()
Previously, in our
HOOKS.md
, we stated:However, when we revisit the code, the
at
field actually indicate the timestamp of most recent typing activity, instead of the starting time.We fixed this by correcting the
at
field.Specific Changes
core/src/reducers/typing.js
for correcting theat
field, it should be based onHOOKS.md
to indicate the issue<= 4.15.1
<LiveRegionTwin>
to narrate static text properly (aria-labelledby
is required by some browsers)"directline"
and"webchat"
channelen-US.json
CHANGELOG.md
Review Checklist
z-index
)package.json
andpackage-lock.json
reviewedSecurity reviewed (no data URIs, check for nonce leak)