Repository navigation
Accessibility: Fix - contrast, screen reader labels and tap areas - #2530
pixeltweaker wants to merge 6 commits into
Conversation
JohnathanWhite
left a comment
There was a problem hiding this comment.
Nice pass. No regressions found reading through it; comments are mostly spots where the fix doesn't reach every case. The first four (danger pill, keypad letters, Blockie on iOS, tab role) are the ones I'd like addressed here; the rest are fine as follow-ups.
| : Caution60 | ||
| : theme.dark | ||
| ? Caution60 | ||
| ? Caution70 |
There was a problem hiding this comment.
The same change is needed in getPillTextColor (line 464), which is a copy of this function and still returns Caution60 for a non-outline danger pill in dark mode. <Button buttonType="pill" danger> in dark theme still renders Caution60 text on the Caution50 fill.
| return ( | ||
| <BaseText | ||
| maxFontSizeMultiplier={1.3} | ||
| style={[styles.cellLetter, {color: theme.colors.description}, style]} |
There was a problem hiding this comment.
Two things here:
- Nothing passes
showLettersoutside this file, so this change has no visible effect today. CellLetterdoesn't getdarkModeOnly, unlikeCellValue. On the PIN modal (dark-only, BitPay-blue background) in light theme,descriptionresolves toSlateDark, which is the low-contrast case this is meant to fix. It should takedarkModeOnlyand use the light colour there.
| return ( | ||
| <View | ||
| accessible={false} | ||
| importantForAccessibility="no-hide-descendants" |
There was a problem hiding this comment.
importantForAccessibility is Android-only. Add accessibilityElementsHidden so VoiceOver skips it too. Low impact today since the subtree has no text, but it makes the "hidden from screen readers" claim true on both platforms.
| testID="account-details-wallets-tab" | ||
| accessibilityRole="button" | ||
| accessibilityLabel={t('Wallets')} | ||
| accessibilityState={{selected: isWalletsTab}} |
There was a problem hiding this comment.
With accessibilityRole="button" this reads as "Wallets, selected, button". Switching these to accessibilityRole="tab" inside a container with accessibilityRole="tablist" gives proper tab semantics and position ("tab 1 of 3").
| <Input | ||
| keyboardType={_keyboardType} | ||
| placeholderTextColor={Slate} | ||
| placeholderTextColor={theme.dark ? Slate : Placeholder} |
There was a problem hiding this comment.
The placeholder colour is now a per-call-site ternary in 9 places, with two different dark values: Slate here and in ChainSearch/ChainSelector, NeutralSlate in the six screens that pass their own (SendTo, SendToAddress, SendToContact, CurrencySelectionSearchInput, both WalletConnect screens). Could this be a placeholder colour on BitPayTheme, the way description is, so the per-screen constants can go? Fine as a follow-up.
| : theme?.dark | ||
| ? SlateDark | ||
| : '#E5E5F2'; | ||
| ? Slate |
There was a problem hiding this comment.
Only the border changed; the uncheckedColor fill passed to RoundedCheckbox (line 91) keeps the old SlateDark / #E5E5F2 values. So dark theme is now a Slate border around a SlateDark fill. If that's intended, all good, but worth a visual check in both themes.
| @@ -39,7 +40,7 @@ const statusFields = { | |||
| }, | |||
| dueSoon: { | |||
| backgroundColor: '#FEECD4', | |||
There was a problem hiding this comment.
'#FEECD4' is exactly Warning25, the fill WarningDark is documented against. Using the constant here keeps the pair together if either changes.
|
|
||
| return ( | ||
| <BadgeContainerTouchable | ||
| hitSlop={{top: 19, bottom: 0}} |
There was a problem hiding this comment.
The tap area depends on three numbers in separate places: this top: 19, accountMetadataRow paddingTop: 19, and contentTopMargin={3} (19 + 3 = the default 22). Changing any one shifts the layout or pushes the hit area outside the row with no error. Could they derive from one constant, or the badge get its own 44pt minHeight/padding so the parent doesn't need to compensate?
| success: { | ||
| background: Success25, | ||
| text: Success, | ||
| text: SuccessDark, |
There was a problem hiding this comment.
The PR description notes no screen uses AlertBox, and SuccessDark is added to colors.ts only for it. I'd delete the component (and the new constant) rather than keep it in sync.
| onChangeText={onChangeText} | ||
| placeholder={placeholder} | ||
| placeholderTextColor={'#6F7782'} | ||
| placeholderTextColor={Placeholder} |
There was a problem hiding this comment.
Placeholder is the light-background value, and this is the one site that uses it in both themes; on the dark pill it falls under 4.5:1. The component is currently unused, so either theme it like the others or remove it.
Summary
An accessibility pass on contrast, screen-reader names and tap targets, in four commits you can review one at a time:
Placeholder#6F7782 (4.53:1, the grey 7 screens already hardcoded; now one name). Dark mode unchanged.LuckySevens(4.48:1) in both themes. Covers BoxInput, search, copy-to-clipboard, import text, rounded search.SlateDark, darkSlateDark→Slate.NeutralSlate→LuckySevens(visible on Android; iOS draws its own).Slate→SlateDarkSuccess→ newSuccessDark#0B754A (4.79:1 on Success25)Warning→ newWarningDark#A05708 (4.70:1 on Warning25; the same brown Bill status already used, now named and shared)Caution60→ newCaution70#9E1111 (4.73:1 on Caution50).Cautionin light (6.7:1) and newCautionBright#FF647C in dark (5.4:1 on the dark sheet;Cautionalone would be 2.3:1). MoonPay sell badge: #FF647C →Caution.Slate30. Dark is unchanged, except the MoonPay divider: #282f37 →SlateDark. This light border is still under 3:1; accepted because the cards are identified by icon and text.SlateDark(light) /Slate(dark) at full strength.descriptionin dark:Air→Slate30, so every SubText follows the secondary-text standard.SlateDark(2.45:1 on black).paddingTop: 19and the gap above shrinks from 22 to 3, so the layout doesn't move and the extra area never reaches the chart.New colours in
colors.ts:Placeholder,SuccessDark,WarningDark,Caution70,CautionBright.Note:
AlertBox(src/components/alert-box/AlertBox.tsx) isn't used by any screen; the last usage was removed in 2022. Its colour changes here have no user-visible effect. They're kept so it's consistent if it's reused; feel free to delete the component instead.AssetsSearchPillis also unused (only its colour name changed).Not in this PR:
Screenshots
Before/after images for light and dark, iPhone and Android, added in a comment below. They use preview-gallery sample data and the simulator test wallet.
How to test
Checklist
bitpay checkpasses (format, types, 259 test suites); lint passes in the commit hook.Design system: version 3.8.14 · 2026-11-16 · app base
db3ac44e2