Skip to content

Announce each message with its own bot initials and, on arrow keys, its time - #5898

Open
Eugene (OEvgeny) wants to merge 8 commits into
mainfrom
OEvgeny/fix-5803-sender-initials
Open

Eugene (OEvgeny) wants to merge 8 commits into
mainfrom
OEvgeny/fix-5803-sender-initials

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Addresses #5803, #5715 and #5735

Changelog Entry

Fixed

  • Fixed screen readers announcing all bot messages with the same initials, such as "Bot JO said:" for both a bot and a live agent: the text before each message, the name of the message when navigating with arrow keys, and the live region now prefer the per-activity channelData.webChat.styleOptions.botAvatarInitials over styleOptions.botAvatarInitials, fixes #5803, in PR #5898, by @OEvgeny
  • Fixed screen readers not announcing the time of a message when navigating the transcript with arrow keys: the name of each sent message now ends with the same "Sent at" text as its timestamp, fixes #5715 and #5735, in PR #5898, by @OEvgeny

Description

Screen readers announced every bot message with the global styleOptions.botAvatarInitials, so a bot and a live agent both read "Bot JO said:", and arrow-key navigation did not read the time of a message. The greeting is now built by one localizer hook that prefers the per-activity channelData.webChat.styleOptions.botAvatarInitials, and the name of a sent message ends with the "Sent at" text of its timestamp (second commit).

Design

  • useLocalizeActivityGreetingAlt() returns a function of the activity and derives "from user" from it, including user transcripts in voice conversations (as the visible layout does); the visible avatar is unchanged.

Specific Changes

  • useActivityStyleOptions: moved from the Fluent theme, exported from the internal entry, merged options frozen

  • useLocalizeActivityGreetingAlt: new hook, "You said:" or "Bot $1 said:" with the activity's initials over styleOptions

  • StackedLayout, CarouselFilmStrip, LiveRegionActivity, useActivityAccessibleName: use the hook

  • useActivityAccessibleName: appends ACTIVITY_STATUS_SEND_STATUS_ALT_SENT_AT once the message is sent

  • StyleOptions: botAvatarInitials JSDoc mentions the narration

  • botAvatarInitials.perActivity.html: per-activity initials in scan mode, carousel, arrow keys, and live region

  • accessibleName.simple.html, accessibleName.activityStatus.sendFailed.html: the time is narrated only after the message is sent

  • 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)

@OEvgeny

Copy link
Copy Markdown
Collaborator Author

I'll check back tomorrow on this with real SR running

@OEvgeny
Eugene (OEvgeny) force-pushed the OEvgeny/fix-5803-sender-initials branch 3 times, most recently from f254634 to fdfb304 Compare October 19, 2026 05:51
Eugene Olonov added 4 commits October 19, 2026 02:19
Screen readers announced every bot message with the global botAvatarInitials,
e.g. "Bot JO said:" for both a bot and a live agent. The four places which
build "Bot $1 said:" (scan mode, arrow-key summary, live region, carousel)
now share useActivityGreetingAlt(), which prefers the per-activity
channelData.webChat.styleOptions.botAvatarInitials.

useActivityStyleOptions() moves from the Fluent theme to the component (and
its internal entry), so the greeting and the Fluent theme read per-activity
style options the same way.
The accessible name of each message in the transcript (aria-activedescendant)
now ends with the same "Sent at ..." text as the screen reader text of its
timestamp (ACTIVITY_STATUS_SEND_STATUS_ALT_SENT_AT), once the message is sent.
useActivityAccessibleName() and useActivityGreetingAlt() return a frozen readonly [string]; comment the live region fade delay in botAvatarInitials.perActivity.html.
@OEvgeny
Eugene (OEvgeny) force-pushed the OEvgeny/fix-5803-sender-initials branch from 4146000 to 625fbe5 Compare October 19, 2026 09:19
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review October 19, 2026 19:29
Copilot AI balanced review requested due to automatic review settings October 19, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@OEvgeny

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-10-19 104819

* Bot initials set in the per-activity `channelData.webChat.styleOptions.botAvatarInitials` take precedence over
* `styleOptions.botAvatarInitials`, so each sender is narrated with their own initials, e.g. a bot and a live agent.
*/
export default function useActivityGreetingAlt(activity: WebChatActivity, fromUser: boolean): readonly [string] {

@compulim William Wong (compulim) Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Consider this signature instead.

useLocalizeActivityGreetingAlt(): (activity: WebChatActivity) => readonly [string];

I think we can derive fromUser from the activity.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 5617ee0: useLocalizeActivityGreetingAlt(): (activity) => readonly [string] derives the sender from the activity (also user transcripts in voice conversations, as StackedLayout does).

Comment on lines +18 to +21
{
...styleOptions,
...activity?.channelData?.webChat?.styleOptions
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{
...styleOptions,
...activity?.channelData?.webChat?.styleOptions
}
Object.freeze({
...styleOptions,
...activity?.channelData?.webChat?.styleOptions
})

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Applied in d6671e3.

@OEvgeny
Eugene (OEvgeny) force-pushed the OEvgeny/fix-5803-sender-initials branch from 6c2851c to fcc6a15 Compare October 19, 2026 23:19
@OEvgeny
Eugene (OEvgeny) force-pushed the OEvgeny/fix-5803-sender-initials branch from fcc6a15 to f2b0b95 Compare October 19, 2026 23:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants