Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a323340
Add descriptive accessibility labels to non-descriptive buttons
MelvinBot Feb 24, 2026
e2a4b70
Fix: Add missing sentryLabel props to Pressable components
MelvinBot Feb 24, 2026
3a1fad4
Fix: Add missing accessible prop to outer PressableView
MelvinBot Feb 24, 2026
46196ff
Merge remote-tracking branch 'origin/main' into claude-fixNonDescript…
MelvinBot Feb 26, 2026
dd444ce
Fix: Remove duplicate sentryLabel declaration and prop
MelvinBot Feb 26, 2026
2de67e8
Remove hardcoded accessible={false} from PressableWithDelayToggle
MelvinBot Feb 26, 2026
390899e
Fix: Ensure accessibilityLabel is always a string in PressableWithDel…
MelvinBot Feb 26, 2026
b24bcb3
Fix: Use nullish coalescing operator instead of logical OR for access…
MelvinBot Feb 26, 2026
3154609
Fix: Use || instead of ?? for accessibilityLabel fallback
MelvinBot Feb 26, 2026
78c4079
Fix: Use || instead of ?? for accessibilityLabel fallback
MelvinBot Feb 26, 2026
cdf51b5
Merge remote branch and resolve comment conflict
MelvinBot Feb 26, 2026
481d1e5
Fix: Use combined descriptive accessibility labels per review feedback
MelvinBot Feb 26, 2026
8f9b45b
Address review feedback: combine visible text with descriptive contex…
MelvinBot Feb 26, 2026
93380b9
Merge remote branch, resolve conflicts keeping separate accessibility…
MelvinBot Feb 26, 2026
b2b7e0a
Fix: Apply Prettier formatting to PressableWithDelayToggle
MelvinBot Feb 26, 2026
5e0577f
Fix: Revert tooltipText to empty strings to preserve production behavior
MelvinBot Feb 26, 2026
9ebb75f
Merge remote-tracking branch 'origin/main' into claude-fixNonDescript…
MelvinBot Mar 1, 2026
db5cc36
Remove accessibilityLabelChecked prop, use accessibilityLabel for bot…
MelvinBot Mar 1, 2026
c3fbdd5
Rename resolvedAccessibilityLabel to accessibilityLabel and remove es…
MelvinBot Mar 1, 2026
c314421
Fix: Restore eslint-disable for intentional || usage in accessibility…
MelvinBot Mar 1, 2026
68f9125
Merge remote-tracking branch 'origin/main' into claude-fixNonDescript…
MelvinBot Mar 2, 2026
a51b5ce
Merge remote-tracking branch 'origin/main' into claude-fixNonDescript…
MelvinBot Mar 5, 2026
23a9dd3
Merge remote-tracking branch 'origin/main' into claude-fixNonDescript…
MelvinBot Mar 9, 2026
6b0e7a1
Fix: remove duplicate accessibilityLabel prop in VerifyPage
MelvinBot Mar 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/components/Pressable/PressableWithDelayToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ type PressableWithDelayToggleProps = PressableProps & {

/** Icon height */
iconHeight?: number;

/** Custom accessibility label that overrides the tooltipText-based label for both states */
accessibilityLabel?: string;
};

function PressableWithDelayToggle({
Expand All @@ -83,11 +86,12 @@ function PressableWithDelayToggle({
icon,
ref,
accessibilityRole = CONST.ROLE.BUTTON,
sentryLabel,
shouldHaveActiveBackground,
iconWidth = variables.iconSizeSmall,
iconHeight = variables.iconSizeSmall,
shouldUseButtonBackground = false,
sentryLabel,
accessibilityLabel: accessibilityLabelProp,
}: PressableWithDelayToggleProps) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
Expand All @@ -108,8 +112,8 @@ function PressableWithDelayToggle({
// of a Pressable
const PressableView = inline ? Text : PressableWithoutFeedback;
const tooltipTexts = !isActive ? tooltipTextChecked : tooltipText;
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Fallback to visible text when tooltip is empty for screen readers
const processedAccessibilityLabel = tooltipTexts || (!isActive && textChecked ? textChecked : text) || '';
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Using || intentionally so empty string tooltip/text values fall through to the next fallback
const accessibilityLabel = accessibilityLabelProp || (!isActive ? tooltipTextChecked || textChecked : tooltipText || text) || text || '';
const shouldShowIcon = !!icon || (!isActive && !!resolvedIconChecked);
const labelText =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Disabling this line for safeness as nullish coalescing works only if the value is undefined or null
Expand All @@ -133,7 +137,7 @@ function PressableWithDelayToggle({
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
ref={ref as any}
onPress={updatePressState}
accessibilityLabel={processedAccessibilityLabel}
accessibilityLabel={accessibilityLabel}
suppressHighlighting={inline ? true : undefined}
accessibilityRole={accessibilityRole}
>
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,7 @@ const translations: TranslationDeepObject<typeof en> = {
scanCode: 'Scanne den QR-Code mit deinem',
authenticatorApp: 'Authentifizierungs-App',
addKey: 'Oder füge diesen geheimen Schlüssel zu deiner Authentifizierungs-App hinzu:',
secretKey: 'geheimer Schlüssel',
enterCode: 'Gib dann den sechsstelligen Code ein, der von deiner Authentifizierungs-App generiert wurde.',
stepSuccess: 'Fertig',
enabled: 'Zwei-Faktor-Authentifizierung aktiviert',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2123,6 +2123,7 @@ const translations = {
scanCode: 'Scan the QR code using your',
authenticatorApp: 'authenticator app',
addKey: 'Or add this secret key to your authenticator app:',
secretKey: 'secret key',
enterCode: 'Then enter the six-digit code generated from your authenticator app.',
stepSuccess: 'Finished',
enabled: 'Two-factor authentication enabled',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1947,6 +1947,7 @@ const translations: TranslationDeepObject<typeof en> = {
scanCode: 'Escanea el código QR usando tu',
authenticatorApp: 'aplicación de autenticación',
addKey: 'O añade esta clave secreta a tu aplicación de autenticación:',
secretKey: 'clave secreta',
enterCode: 'Luego introduce el código de seis dígitos generado por tu aplicación de autenticación.',
stepSuccess: 'Finalizado',
enabled: 'La autenticación de dos factores habilitada',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2087,6 +2087,7 @@ const translations: TranslationDeepObject<typeof en> = {
authenticatorApp: 'application d’authentification',
addKey: 'Ou ajoutez cette clé secrète à votre application d’authentification :',
enterCode: 'Saisissez ensuite le code à six chiffres généré par votre application d’authentification.',
secretKey: 'clé secrète',
stepSuccess: 'Terminé',
enabled: 'Authentification à deux facteurs activée',
congrats: 'Félicitations ! Vous bénéficiez désormais de cette sécurité supplémentaire.',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,7 @@ const translations: TranslationDeepObject<typeof en> = {
scanCode: 'Scansiona il codice QR usando il tuo',
authenticatorApp: 'app di autenticazione',
addKey: 'Oppure aggiungi questa chiave segreta alla tua app di autenticazione:',
secretKey: 'chiave segreta',
enterCode: 'Quindi inserisci il codice a sei cifre generato dalla tua app di autenticazione.',
stepSuccess: 'Completato',
enabled: 'Autenticazione a due fattori abilitata',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,7 @@ const translations: TranslationDeepObject<typeof en> = {
scanCode: '次の端末でQRコードをスキャンしてください:',
authenticatorApp: '認証アプリ',
addKey: 'または、この秘密キーを認証アプリに追加してください:',
secretKey: '秘密キー',
enterCode: '次に、認証アプリで生成された6桁のコードを入力してください。',
stepSuccess: '完了',
enabled: '2要素認証が有効になりました',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,7 @@ const translations: TranslationDeepObject<typeof en> = {
scanCode: 'Scan de QR-code met je',
authenticatorApp: 'authenticator-app',
addKey: 'Of voeg deze geheime sleutel toe aan je authenticator-app:',
secretKey: 'geheime sleutel',
enterCode: 'Voer vervolgens de zescijferige code in die is gegenereerd door je authenticator-app.',
stepSuccess: 'Voltooid',
enabled: 'Authenticatie in twee stappen ingeschakeld',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,7 @@ const translations: TranslationDeepObject<typeof en> = {
scanCode: 'Zeskanuj kod QR za pomocą swojego',
authenticatorApp: 'aplikacja uwierzytelniająca',
addKey: 'Lub dodaj ten tajny klucz do swojej aplikacji uwierzytelniającej:',
secretKey: 'tajny klucz',
enterCode: 'Następnie wprowadź sześciocyfrowy kod wygenerowany przez aplikację uwierzytelniającą.',
stepSuccess: 'Zakończono',
enabled: 'Włączono uwierzytelnianie dwuskładnikowe',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,7 @@ const translations: TranslationDeepObject<typeof en> = {
scanCode: 'Escaneie o código QR usando seu',
authenticatorApp: 'aplicativo autenticador',
addKey: 'Ou adicione esta chave secreta ao seu app autenticador:',
secretKey: 'chave secreta',
enterCode: 'Em seguida, insira o código de seis dígitos gerado pelo seu app autenticador.',
stepSuccess: 'Concluído',
enabled: 'Autenticação em duas etapas ativada',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2036,6 +2036,7 @@ const translations: TranslationDeepObject<typeof en> = {
scanCode: '使用你的 扫描二维码',
authenticatorApp: '身份验证器应用',
addKey: '或者将此密钥添加到你的验证器应用:',
secretKey: '密钥',
enterCode: '然后输入您的身份验证器应用生成的六位数字代码。',
stepSuccess: '已完成',
enabled: '已启用双重身份验证',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/Security/TwoFactorAuth/CopyCodesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function CopyCodesPage({route}: TwoFactorAuthPageProps) {
textStyles={[styles.buttonMediumText]}
tooltipText=""
tooltipTextChecked=""
accessibilityLabel={translate('twoFactorAuth.copy')}
accessibilityLabel={`${translate('twoFactorAuth.copy')}, ${translate('twoFactorAuth.stepCodes')}`}
sentryLabel={CONST.SENTRY_LABEL.TWO_FACTOR_AUTH.COPY_CODES}
/>
<PressableWithDelayToggle
Expand All @@ -141,7 +141,7 @@ function CopyCodesPage({route}: TwoFactorAuthPageProps) {
textStyles={[styles.buttonMediumText]}
tooltipText=""
tooltipTextChecked=""
accessibilityLabel={translate('common.download')}
accessibilityLabel={`${translate('common.download')}, ${translate('twoFactorAuth.stepCodes')}`}
sentryLabel={CONST.SENTRY_LABEL.TWO_FACTOR_AUTH.DOWNLOAD_CODES}
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ function VerifyPage({route}: VerifyPageProps) {
textChecked={translate('common.copied')}
tooltipText=""
tooltipTextChecked=""
accessibilityLabel={`${translate('twoFactorAuth.copy')}, ${translate('twoFactorAuth.secretKey')}`}
icon={icons.Copy}
inline={false}
onPress={() => Clipboard.setString(account?.twoFactorAuthSecretKey ?? '')}
styles={[styles.button, styles.buttonMedium, styles.twoFactorAuthCopyCodeButton]}
textStyles={[styles.buttonMediumText]}
accessibilityLabel={translate('twoFactorAuth.copy')}
sentryLabel={CONST.SENTRY_LABEL.TWO_FACTOR_AUTH.COPY}
/>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function SaveWithExpensifyButton() {
<Button
small
text={translate('subscription.yourPlan.saveWithExpensifyButton')}
accessibilityLabel={`${translate('subscription.yourPlan.saveWithExpensifyButton')}, ${translate('subscription.yourPlan.saveWithExpensifyTitle')}`}
onPress={onLinkPress}
sentryLabel={CONST.SENTRY_LABEL.SETTINGS_SUBSCRIPTION.SAVE_WITH_EXPENSIFY}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function WorkspaceCompanyCardExpensifyCardPromotionBanner({policy}: WorkspaceCom
onPress={handleLearnMore}
style={shouldUseNarrowLayout && styles.flex1}
text={translate('workspace.moreFeatures.companyCards.expensifyCardBannerLearnMoreButton')}
accessibilityLabel={`${translate('workspace.moreFeatures.companyCards.expensifyCardBannerLearnMoreButton')}, ${translate('workspace.moreFeatures.companyCards.expensifyCardBannerTitle')}`}
/>
</View>
);
Expand Down
Loading