From 56dc42ff590737010e85e0a28acdbd52e325f4b1 Mon Sep 17 00:00:00 2001 From: Maruf Sharifi Date: Tue, 10 Feb 2026 09:24:17 +0430 Subject: [PATCH 1/3] Fix screen reader announcement for informative icon in error messages --- src/CONST/index.ts | 1 + src/components/DotIndicatorMessage.tsx | 24 +++++++++++++++++++++++- src/components/FormHelpMessage.tsx | 17 +++++++++++++---- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index ed32f1906578..bc3e10f06dec 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -5498,6 +5498,7 @@ const CONST = { ACCESSIBILITY_LABELS: { COLLAPSE: 'Collapse', EXPAND: 'Expand', + ERROR: 'Error', }, /** diff --git a/src/components/DotIndicatorMessage.tsx b/src/components/DotIndicatorMessage.tsx index 233048215395..55676ce2780b 100644 --- a/src/components/DotIndicatorMessage.tsx +++ b/src/components/DotIndicatorMessage.tsx @@ -12,6 +12,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import {isReceiptError, isTranslationKeyError} from '@libs/ErrorUtils'; import fileDownload from '@libs/fileDownload'; import handleRetryPress from '@libs/ReceiptUploadRetryHandler'; +import CONST from '@src/CONST'; import type {TranslationKeyError} from '@src/types/onyx/OnyxCommon'; import type {ReceiptError} from '@src/types/onyx/Transaction'; import ConfirmModal from './ConfirmModal'; @@ -65,6 +66,22 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr const isErrorMessage = type === 'error'; const receiptError = uniqueMessages.find(isReceiptError); + const errorIconLabel = isErrorMessage + ? [ + CONST.ACCESSIBILITY_LABELS.ERROR, + ...uniqueMessages + .map((message) => { + if (isReceiptError(message)) { + return translate('iou.error.receiptFailureMessageShort'); + } + if (isTranslationKeyError(message)) { + return translate(message.translationKey); + } + return message; + }) + .filter(Boolean), + ].join(' ') + : undefined; const handleLinkPress = (href: string) => { if (!receiptError) { @@ -118,7 +135,12 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr return ( - + ${replacedText}`; }, [isError, message, shouldRenderMessageAsHTML]); + const errorIconLabel = isError && shouldShowRedDotIndicator ? [CONST.ACCESSIBILITY_LABELS.ERROR, typeof message === 'string' ? message : ''].filter(Boolean).join(' ') : undefined; + if (isEmpty(message) && isEmpty(children)) { return null; } @@ -59,10 +62,16 @@ function FormHelpMessage({message = '', children, isError = true, style, shouldS return ( {isError && shouldShowRedDotIndicator && ( - + + + )} {isInfo && ( Date: Fri, 13 Feb 2026 13:34:09 +0430 Subject: [PATCH 2/3] applied ai feedback --- src/components/DotIndicatorMessage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/DotIndicatorMessage.tsx b/src/components/DotIndicatorMessage.tsx index 55676ce2780b..99c8a82b4c18 100644 --- a/src/components/DotIndicatorMessage.tsx +++ b/src/components/DotIndicatorMessage.tsx @@ -66,13 +66,14 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr const isErrorMessage = type === 'error'; const receiptError = uniqueMessages.find(isReceiptError); + const receiptFailureMessageShort = translate('iou.error.receiptFailureMessageShort'); const errorIconLabel = isErrorMessage ? [ CONST.ACCESSIBILITY_LABELS.ERROR, ...uniqueMessages .map((message) => { if (isReceiptError(message)) { - return translate('iou.error.receiptFailureMessageShort'); + return receiptFailureMessageShort; } if (isTranslationKeyError(message)) { return translate(message.translationKey); From d89f6f4663f8275a878f667b314093a0c8ac2d7a Mon Sep 17 00:00:00 2001 From: Maruf Sharifi Date: Wed, 18 Feb 2026 19:37:38 +0430 Subject: [PATCH 3/3] Simplify error icon accessibility labels --- src/components/DotIndicatorMessage.tsx | 20 +------------------- src/components/FormHelpMessage.tsx | 2 +- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/components/DotIndicatorMessage.tsx b/src/components/DotIndicatorMessage.tsx index 99c8a82b4c18..dc517535b58d 100644 --- a/src/components/DotIndicatorMessage.tsx +++ b/src/components/DotIndicatorMessage.tsx @@ -66,24 +66,6 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr const isErrorMessage = type === 'error'; const receiptError = uniqueMessages.find(isReceiptError); - const receiptFailureMessageShort = translate('iou.error.receiptFailureMessageShort'); - const errorIconLabel = isErrorMessage - ? [ - CONST.ACCESSIBILITY_LABELS.ERROR, - ...uniqueMessages - .map((message) => { - if (isReceiptError(message)) { - return receiptFailureMessageShort; - } - if (isTranslationKeyError(message)) { - return translate(message.translationKey); - } - return message; - }) - .filter(Boolean), - ].join(' ') - : undefined; - const handleLinkPress = (href: string) => { if (!receiptError) { return; @@ -140,7 +122,7 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr style={styles.offlineFeedbackErrorDot} accessible={isErrorMessage} role={isErrorMessage ? CONST.ROLE.IMG : undefined} - accessibilityLabel={errorIconLabel} + accessibilityLabel={isErrorMessage ? (CONST.ACCESSIBILITY_LABELS.ERROR as string) : undefined} > ${replacedText}`; }, [isError, message, shouldRenderMessageAsHTML]); - const errorIconLabel = isError && shouldShowRedDotIndicator ? [CONST.ACCESSIBILITY_LABELS.ERROR, typeof message === 'string' ? message : ''].filter(Boolean).join(' ') : undefined; + const errorIconLabel = isError && shouldShowRedDotIndicator ? CONST.ACCESSIBILITY_LABELS.ERROR : undefined; if (isEmpty(message) && isEmpty(children)) { return null;