From 4efaf0a5803d5b81b6305cbdc97c5a5ae0753da2 Mon Sep 17 00:00:00 2001 From: Eugene Olonov Date: Mon, 19 Oct 2026 16:29:48 -0700 Subject: [PATCH 1/3] Say "Click to interact." for messages with links InteractiveType.LINK is 0, so the truthiness check treated messages with links as not interactive. --- CHANGELOG.md | 1 + .../accessibility/accessibleName.link.html | 68 +++++++++++++++++++ .../Transcript/useActivityAccessibleName.ts | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 __tests__/html2/accessibility/accessibleName.link.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ea94b2678..ebaa1976f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ Legends: - Fixed screen readers announcing a single audio, video, or animation in a card as a list item, such as "1 of 1", fixes [#5722](https://github.com/microsoft/BotFramework-WebChat/issues/5722), in PR [#5903](https://github.com/microsoft/BotFramework-WebChat/pull/5903), by [@OEvgeny](https://github.com/OEvgeny) - Fixed video and animation cards disappearing in production builds when the video URL is relative or invalid, in PR [#5889](https://github.com/microsoft/BotFramework-WebChat/pull/5889), by [@OEvgeny](https://github.com/OEvgeny) - Fixed timestamps always using the 12-hour clock, such as "4:41 PM" instead of "16:41" in German, in PR [#5920](https://github.com/microsoft/BotFramework-WebChat/pull/5920), by [@OEvgeny](https://github.com/OEvgeny) +- Fixed screen readers not saying "Click to interact." for messages with links, in PR [#XXXX](https://github.com/microsoft/BotFramework-WebChat/pull/XXXX), by [@OEvgeny](https://github.com/OEvgeny) ## [4.19.2] - 2026-10-08 diff --git a/__tests__/html2/accessibility/accessibleName.link.html b/__tests__/html2/accessibility/accessibleName.link.html new file mode 100644 index 0000000000..b2ad5111ea --- /dev/null +++ b/__tests__/html2/accessibility/accessibleName.link.html @@ -0,0 +1,68 @@ + + + + + + + + + +
+ + + + diff --git a/packages/component/src/Transcript/useActivityAccessibleName.ts b/packages/component/src/Transcript/useActivityAccessibleName.ts index 9e3d9d3473..40eb03ef77 100644 --- a/packages/component/src/Transcript/useActivityAccessibleName.ts +++ b/packages/component/src/Transcript/useActivityAccessibleName.ts @@ -89,7 +89,7 @@ export default function useActivityAccessibleName(activity: WebChatActivity, bod : interactiveType === InteractiveType.WIDGET ? activityInteractiveReasonInteractiveContentAlt : '', - interactiveType || isSendFailed ? activityInteractiveFootNoteAlt : '' + interactiveType !== false || isSendFailed ? activityInteractiveFootNoteAlt : '' ] .filter(Boolean) .join(' '), From a596794edbe0b79c58810a87330c9b8f1d68a363 Mon Sep 17 00:00:00 2001 From: Eugene Olonov Date: Mon, 19 Oct 2026 16:33:15 -0700 Subject: [PATCH 2/3] Add PR number to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebaa1976f1..327c689707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,7 +63,7 @@ Legends: - Fixed screen readers announcing a single audio, video, or animation in a card as a list item, such as "1 of 1", fixes [#5722](https://github.com/microsoft/BotFramework-WebChat/issues/5722), in PR [#5903](https://github.com/microsoft/BotFramework-WebChat/pull/5903), by [@OEvgeny](https://github.com/OEvgeny) - Fixed video and animation cards disappearing in production builds when the video URL is relative or invalid, in PR [#5889](https://github.com/microsoft/BotFramework-WebChat/pull/5889), by [@OEvgeny](https://github.com/OEvgeny) - Fixed timestamps always using the 12-hour clock, such as "4:41 PM" instead of "16:41" in German, in PR [#5920](https://github.com/microsoft/BotFramework-WebChat/pull/5920), by [@OEvgeny](https://github.com/OEvgeny) -- Fixed screen readers not saying "Click to interact." for messages with links, in PR [#XXXX](https://github.com/microsoft/BotFramework-WebChat/pull/XXXX), by [@OEvgeny](https://github.com/OEvgeny) +- Fixed screen readers not saying "Click to interact." for messages with links, in PR [#5927](https://github.com/microsoft/BotFramework-WebChat/pull/5927), by [@OEvgeny](https://github.com/OEvgeny) ## [4.19.2] - 2026-10-08 From 78f1ac7487ff2d1ca0a93c9e6851570e71eb72cd Mon Sep 17 00:00:00 2001 From: Eugene Olonov Date: Mon, 19 Oct 2026 19:24:09 -0700 Subject: [PATCH 3/3] Use a string union for the interactive type of an activity --- .../src/Transcript/useActivityAccessibleName.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/component/src/Transcript/useActivityAccessibleName.ts b/packages/component/src/Transcript/useActivityAccessibleName.ts index 40eb03ef77..017531d176 100644 --- a/packages/component/src/Transcript/useActivityAccessibleName.ts +++ b/packages/component/src/Transcript/useActivityAccessibleName.ts @@ -9,10 +9,7 @@ import tabbableElements from '../Utils/tabbableElements'; import useRenderMarkdownAsHTML from '../hooks/useRenderMarkdownAsHTML'; import useValueRef from '../hooks/internal/useValueRef'; -enum InteractiveType { - LINK, - WIDGET -} +type InteractiveType = 'link' | 'widget'; const { useAvatarForBot, useGetKeyByActivity, useLocalizer, useSendStatusByActivityKey } = hooks; @@ -84,12 +81,12 @@ export default function useActivityAccessibleName(activity: WebChatActivity, bod messageTextAlt, numAttachmentsAlt, isSendFailed ? activityInteractiveReasonSendFailedAlt : '', - interactiveType === InteractiveType.LINK + interactiveType === 'link' ? activityInteractiveReasonLinkAlt - : interactiveType === InteractiveType.WIDGET + : interactiveType === 'widget' ? activityInteractiveReasonInteractiveContentAlt : '', - interactiveType !== false || isSendFailed ? activityInteractiveFootNoteAlt : '' + interactiveType || isSendFailed ? activityInteractiveFootNoteAlt : '' ] .filter(Boolean) .join(' '), @@ -110,8 +107,7 @@ export default function useActivityAccessibleName(activity: WebChatActivity, bod const hasLinks = !!bodyRef.current?.querySelector('a'); const hasWidgets = !!tabbableElements(bodyRef.current).length; - interactiveTypeRef.current !== hasWidgets && - setInteractiveType(hasLinks ? InteractiveType.LINK : hasWidgets ? InteractiveType.WIDGET : false); + interactiveTypeRef.current !== hasWidgets && setInteractiveType(hasLinks ? 'link' : hasWidgets ? 'widget' : false); }, [bodyRef, interactiveTypeRef, setInteractiveType]); return [accessibleName];