Skip to content

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

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

Eugene (OEvgeny) wants to merge 3 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:". The four places that build this text (scan mode, carousel, arrow-key navigation, live region) now share one hook, which prefers the initials in the per-activity style options. In a separate commit, the name of a message when navigating with arrow keys now ends with the "Sent at …" text that scan mode already reads from its timestamp.

Related, not in this PR: since 4.19.0, production builds expose the default avatar's initials to screen readers (the aria-hidden default of DefaultAvatar is not applied); it will be fixed in a separate PR.

Design

  • Per-activity initials come from the existing per-activity style options (channelData.webChat.styleOptions, 4.18.0) via the Fluent theme's useActivityStyleOptions, now moved to the component; the visible default avatar still shows the global initials.
  • Open question: is the time worth the extra words on every arrow press, also for hosts that hide the timestamp with their own activity status middleware? It is the second commit and can be dropped.
  • Open question: D365's widget overrides ACTIVITY_BOT_SAID_ALT with the latest agent's name (no $1) and sees no change until it drops the override and sets per-activity initials; should the greeting use the sender name instead (e.g. "John said:" from from.name)?

Specific Changes

  • hooks/internal/useActivityStyleOptions.ts: moved from the Fluent theme and exported from the internal entry, used by CopilotMessageHeader.tsx.
  • hooks/internal/useActivityGreetingAlt.ts: new hook that builds "You said:" or "Bot $1 said:" from the activity's style options.
  • StackedLayout.tsx, CarouselFilmStrip.js, LiveRegionActivity.tsx, useActivityAccessibleName.ts: use the hook instead of their own copies.
  • useActivityAccessibleName.ts: appends ACTIVITY_STATUS_SEND_STATUS_ALT_SENT_AT once the message is sent.
  • StyleOptions.ts: the botAvatarInitials JSDoc mentions the narration and the per-activity override.
  • accessibility/botAvatarInitials.perActivity.html: new test for scan mode, carousel, arrow keys, and live region.
  • accessibility/accessibleName.simple.html, accessibleName.activityStatus.sendFailed.html: expect the time only after the message is sent, not while its echo back is pending or after it failed.
  • 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)

Eugene Olonov added 3 commits October 18, 2026 01:41
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.
@OEvgeny

Copy link
Copy Markdown
Collaborator Author

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

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

1 participant