fix: announce sending status to screen readers via live region by isherstneva · Pull Request #5781 · microsoft/BotFramework-WebChat

@isherstneva

When a user submits a message, the activity enters the "sending" state
while awaiting server acknowledgement. The visual "Sending" indicator
was rendered next to the activity but not inside an ARIA live region,
so screen readers never announced it.

Adds LiveRegionSendSending component (mirroring LiveRegionSendFailed)
that watches for activities newly entering the "sending" state and
queues the localized "Sending message." string into the polite live
region. Also adds TRANSCRIPT_LIVE_REGION_SEND_SENDING_ALT localization
key and a corresponding integration test.

Copilot AI review requested due to automatic review settings

March 25, 2026 18:35

@isherstneva

@isherstneva

@isherstneva

@isherstneva

@isherstneva

Updated tests to include "Sending message." in expected live region output:
- activityStatus.sendFailed.html: prepend Sending message. to expected array
- activityStatus.sendSending.html: use toContain with proper accumulation
- suggestedActions.accessKey.html: add Sending message. to expected array
- suggestedActions.noAccessKey.html: add Sending message. to expected array
The onTelemetry exception event fires asynchronously after activities are
rendered. Add a pageConditions.became() wait before asserting on it to
avoid a race condition where the assertion runs before the event fires.
- fluentTheme/suggestedActions.html: add allImagesLoaded() before snapshot
  to ensure external CDN images are fully rendered before comparison
- updateActivity/sameActivityId.html: add scrollToBottomCompleted() before
  snap-1 to ensure scroll animation finishes before comparison

These waits were already used in similar tests but missing here, causing
flaky pixel differences in CI where the machine is slower.
…ends

Only narrate "Sending message." if the outgoing activity remains in the
sending state for at least 3 seconds. Fast sends that are acknowledged
quickly stay silent; only stalled or slow sends get announced.

Update tests accordingly:
- sendSending: increase became() timeout to 4000ms to accommodate the delay
- sendFailed: remove Sending message. (rejection happens in < 3s)
- suggestedActions: remove Sending message. (real DirectLine acks in < 3s)
Sending message. no longer appears in the live region for fast emulated
sends, so all liveRegion attachment and alertEmptyMessage snapshots that
previously captured it need to be updated.

@isherstneva

- Rename LiveRegion/SendSending.tsx -> LiveRegion/LongSend.tsx
- Rename component LiveRegionSendSending -> LiveRegionLongSend
- Revert unknownActivity.html, fluentTheme/suggestedActions.html,
  updateActivity/sameActivityId.html to base (unrelated test fixes)
- Revert videoCard.html.snap-1.png to base (spurious 1-byte PNG artifact)

@isherstneva

@isherstneva

compulim

@isherstneva

…cation

Both SendFailed and LongSend shared the same useMemo pattern for
filtering activities by send status and isPresentational. Extracted
into a shared hook useActivityKeysOfSendStatus(status).

compulim

@isherstneva