Added correct announcements for Language picker on native platforms#81013
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@dominictb Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| touchableWrapperProps={{ | ||
| accessible: true, | ||
| accessibilityRole: CONST.ROLE.COMBOBOX, | ||
| accessibilityLabel: translate('languagePage.language'), |
There was a problem hiding this comment.
❌ CONSISTENCY-2 (docs)
The accessibility label translate('languagePage.language') is hardcoded specifically for the language picker, but BasePicker is a generic component used throughout the app for many different purposes (taxes, reports, distance rates, custom fields, etc.).
Suggested fix:
Add an optional accessibilityLabel prop to BasePickerProps and pass it from the parent component:
// In BasePicker.tsx
type BasePickerProps<TPickerValue> = {
// ... existing props
accessibilityLabel?: string;
};
// Use it in touchableWrapperProps
touchableWrapperProps={{
accessible: true,
accessibilityRole: CONST.ROLE.COMBOBOX,
accessibilityLabel: accessibilityLabel ?? label, // Use prop or fall back to label
accessibilityState: {disabled: isDisabled, expanded: isHighlighted},
}}Then in LocalePicker.tsx, pass the specific label:
<Picker
accessibilityLabel={translate('languagePage.language')}
// ... other props
/>This keeps BasePicker generic and reusable while allowing each usage to specify its own appropriate accessibility label.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
| importantForAccessibility: 'no-hide-descendants', | ||
| }} | ||
| touchableDoneProps={{ | ||
| accessibilityRole: CONST.ROLE.BUTTON, |
There was a problem hiding this comment.
❌ CONSISTENCY-2 (docs)
The accessibility label for the Done button uses translate('common.dismiss'), but this might not be appropriate for all contexts where BasePicker is used. For example, when selecting a tax rate or currency, "Dismiss" might not accurately describe the action (which is more like "Done" or "Confirm Selection").
Suggested fix:
Add an optional doneButtonAccessibilityLabel prop to allow customization:
type BasePickerProps<TPickerValue> = {
// ... existing props
doneButtonAccessibilityLabel?: string;
};
// In touchableDoneProps
touchableDoneProps={{
accessibilityRole: CONST.ROLE.BUTTON,
accessibilityLabel: doneButtonAccessibilityLabel ?? translate('common.dismiss'),
}}This allows parent components to provide context-specific labels when needed while maintaining a sensible default.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
@Uzaifm127 Can you take a look at this comment?
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8157ce068d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| touchableWrapperProps={{ | ||
| accessible: true, | ||
| accessibilityRole: CONST.ROLE.COMBOBOX, | ||
| accessibilityLabel: translate('languagePage.language'), | ||
| accessibilityState: {disabled: isDisabled, expanded: isHighlighted}, |
There was a problem hiding this comment.
Avoid hardcoding language label for all pickers
BasePicker is the shared implementation for all pickers (via src/components/Picker/index*.tsx), so hardcoding touchableWrapperProps.accessibilityLabel to translate('languagePage.language') will make every native picker announce itself as “Language” (e.g., currency, time zone, category). This is an accessibility regression outside the language screen and will mislead screen readers. Consider passing a label prop down from the caller or conditionally setting the label only for the language picker.
Useful? React with 👍 / 👎.
trjExpensify
left a comment
There was a problem hiding this comment.
Part of the accessibility project.
|
I will take over here |
This comment was marked as resolved.
This comment was marked as resolved.
|
I'll pick this one as discussed here. |
…6-language-picker-announcements-on-native-platforms
|
@mananjadhav Added the codex suggestions. I'll go deeper into third subissue tomorrow. You can review the first two sub issues now. |
|
@cristipaval Please re run the adhoc build, I merged the latest main into this branch after a minute you ran the build, there is a script on the latest main which wasn't there in this branch. @mananjadhav The failing checks seems unrelated to this PR, can you confirm? |
|
🚧 @cristipaval has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@Uzaifm127 Can you sync latest main to see if it fixes it? |
…6-language-picker-announcements-on-native-platforms
|
@mananjadhav If you meant the adhoc build failure then it is resolved. Merged the latest main. |
|
@mananjadhav Bump for updates on this |
|
@mananjadhav can you please prioritize this? this PR is quite old 😅 |
|
I was out yesterday but I'll finish it today. |
|
@mananjadhav Bump for updates on this. |
|
I just downloaded the adhoc build and testing it on my physical device. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-languag-picker.mp4Android: mWeb ChromeiOS: HybridAppios-language-picker-announcement.mp4iOS: mWeb Safarimweb-safari-languag-picker-announcement.mp4MacOS: Chrome / Safariweb-languag-picker-voice-over.mov |
…6-language-picker-announcements-on-native-platforms
|
I should have access to the Android tablet in an hour. Will finish the checklist then. |
|
I am trying to test this on Android tablet. With the talkback enabled, I am unable to click on the language picket at all. I’ll try to test it once more. Screenrecorder-2026-02-24-16-33-36-2.mp4 |
|
The adhoc build on android is working fine from my side, I've tested the adhoc build on Android and language picker is selecting. Screenrecording_20260224_171222.1.mp4 |
|
Please ignore it was an issue with my tablet. It didn't select even when the TalkBack was off and prod version. |
mananjadhav
left a comment
There was a problem hiding this comment.
I have issues with my Android chrome.
|
🚧 @cristipaval has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 9.3.26-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.26-8 🚀
|
Explanation of Change
Fixed Issues
$ #77534
$ #77541
$ #77546
$ #79866
PROPOSAL: #79866 (comment)
Tests
Precondition for Test 1 and Test 2: You must be logged out.
Test 1: Incorrect announcement for language picker - #77541
Collapsed, Language, comboboxcorrectly when focused on Language picker.Test 2: Done button in iOS - #77534 and #77546
Offline tests
Same as Tests
QA Steps
Same as Tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
language-picker-android-native.mp4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari