You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] "on or off, switch" is still not announced with the screen reader on Distance rates #82498
Version Number: v9.3.19-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#80496 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: macOS Sonoma 14.5 / Chrome App Component: Workspace Settings
Action Performed:
Precondition:
Screen reader VoiceOver is enabled
Have a workspace
Distance rates are already enabled, and add other rates than the default
Test 4: Switch button in Distance rates - #76906
5. Verify that the corresponding switch is announced as Default Rate, [currency][amount] / mile, on, switch.
Actual Result:
Switch is only announced as "Default Rate, [currency][amount]", and the "on or off, switch" is still not announced with the screen reader on Distance rates
Please re-state the problem that we are trying to solve in this issue.
Switch is only announced as "Default Rate, [currency][amount]", and the "on or off, switch" is still not announced with the screen reader on Distance rates.
What is the root cause of that problem?
In PolicyDistanceRatesPage.tsx, the Switch component's accessibilityLabel only includes the rate name (value?.name), but it doesn't include the alternateText which contains the rate value (currency/amount per mile).
The accessibilityLabel should include both the rate name and the rate value to provide complete information to screen reader users, similar to how it's implemented in WorkspaceCategoriesPage.tsx.
What changes do you think we should make in order to solve the problem?
Update the accessibilityLabel prop of the Switch component in PolicyDistanceRatesPage.tsx to include both the rate name and the alternateText (rate value):
Please re-state the problem that we are trying to solve in this issue.
The Switch component in the Distance Rates page (Workspaces > Distance rates) does not announce its status ("on" or "off") or its role ("switch") when using a screen reader like VoiceOver. It only announces the rate name and amount, making it difficult for visually impaired users to know if a rate is enabled or disabled.
What is the root cause of that problem?
The root cause is two-fold:
In src/components/Switch.tsx, the PressableWithFeedback component lacks an explicit accessibilityState definition for the checked property, which is essential for screen readers to translate the isOn boolean into "on/off" or "activated/deactivated" announcements.
In src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx, the accessibilityLabel passed to the Switch component only contains the rate name, missing the currency and amount context required for a complete announcement.
What changes do you think we should make in order to solve the problem?
What changes do you think we should make in order to solve the problem?
Update src/components/Switch.tsx to include the accessibilityState property in the PressableWithFeedback component. This ensures the component correctly communicates its state to the system's accessibility API.
• Add accessibilityState={{checked: isOn, disabled: !!disabled}} to the PressableWithFeedback props.
In src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx, update the distanceRatesList logic to provide a more descriptive accessibilityLabel to the Switch.
• Construct a comprehensive label that includes both the name and the formatted rate (e.g., "Default Rate, USD 0.50 / mile").
• Pass this new label to the Switch via the accessibilityLabel prop.
By combining these changes, the screen reader will announce: "[Rate Name], [Amount] / [Unit], on/off, switch", fulfilling all the QA requirements.
What alternative solutions did you explore? (Optional)
None
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
On the Workspace Distance Rates page, VoiceOver announces each rate row as only its name and amount, but does not include the control state/role (on/off, switch) when users navigate to the toggle.
TableListItem rows are wrapped by this parent pressable, and if an item does not provide its own accessibilityLabel, the fallback label is only text + alternateText. In Distance Rates, that means screen readers announce just Default Rate, [currency][amount]; this causes the state/role announcement to be incomplete because the focused element label never includes switch semantics.
What changes do you think we should make in order to solve the problem?
This makes the focused row announcement include the full semantic string (name + amount + state + switch role) while keeping the switch control itself aligned with the same label, so VoiceOver users consistently hear ... on/off, switch.
What alternative solutions did you explore? (Optional)
⚠️@annaweber830 Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Please re-state the problem that we are trying to solve in this issue.
On Workspaces > Distance rates, screen reader output is still not aligned with the final agreed behavior.
Expected behavior after clarification:
The parent distance-rate row should announce full rate details once (name + amount/unit).
The switch should be a separate focus stop and announce only rate name + state/role (on/off, switch).
The switch label should not repeat [currency][amount].
On affected web SR flows (macOS VoiceOver / Android web), focus/announcement order was inconsistent, causing missing switch state.
Video demo of the issue in android-web:
distance-rate-switch-android-web-issue.mp4
What is the root cause of that problem?
There are 2 core root causes before the fix:
Distance rates rows rely on generic fallback labeling instead of explicit row labeling:
In BaseListItem, when item.accessibilityLabel is missing, it falls back to text + alternateText, and the row defaults to button-like role semantics, This made SR focus behavior inconsistent for reaching/announcing the nested switch on web:
Switch checked state semantics are not passed viaaccessibilityState.checked, which can make on/off announcement inconsistent in web SR combinations even when role="switch" is present:
I reviewed the proposal. I was busy that day, and they managed to get another C+ to review the PR. I don't believe any payment is necessary on my part. Thank you.
Contributor: @marufsharifi paid $250 via Upwork - cuz hired/assigned, drafted PR and did tests
Contributor+: @shubham1206agra due $125 via NewDot - not a full review on the PR nor any tests.
Activity
melvin-bot commentedon Feb 14, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (
External)melvin-bot commentedon Feb 14, 2026
Triggered auto assignment to @twisterdotcom (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.melvin-bot commentedon Feb 14, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
daledah commentedon Feb 14, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Switch is only announced as "Default Rate, [currency][amount]", and the "on or off, switch" is still not announced with the screen reader on Distance rates.
What is the root cause of that problem?
In PolicyDistanceRatesPage.tsx, the
Switchcomponent'saccessibilityLabelonly includes the rate name (value?.name), but it doesn't include the alternateText which contains the rate value (currency/amount per mile).The
accessibilityLabelshould include both the rate name and the rate value to provide complete information to screen reader users, similar to how it's implemented inWorkspaceCategoriesPage.tsx.What changes do you think we should make in order to solve the problem?
Update the
accessibilityLabelprop of theSwitchcomponent inPolicyDistanceRatesPage.tsxto include both the rate name and the alternateText (rate value):rightElement: ( <Switch isOn={!!value?.enabled} - accessibilityLabel={value?.name ?? ''} + accessibilityLabel={`${value?.name ?? ''}, ${alternateText}`} onToggle={(newValue: boolean) => updateDistanceRateEnabled(newValue, value.customUnitRateID)} showLockIcon={!canDisableOrDeleteRate(value.customUnitRateID)} disabled={value.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE} /> ),Note: We can consider adjusting the accessibilityLabel value
What alternative solutions did you explore? (Optional)
N/A
thedavos commentedon Feb 14, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Switch component in the Distance Rates page (Workspaces > Distance rates) does not announce its status ("on" or "off") or its role ("switch") when using a screen reader like VoiceOver. It only announces the rate name and amount, making it difficult for visually impaired users to know if a rate is enabled or disabled.
What is the root cause of that problem?
The root cause is two-fold:
In
src/components/Switch.tsx, thePressableWithFeedbackcomponent lacks an explicitaccessibilityStatedefinition for the checked property, which is essential for screen readers to translate the isOn boolean into "on/off" or "activated/deactivated" announcements.In
src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx, theaccessibilityLabelpassed to the Switch component only contains the rate name, missing the currency and amount context required for a complete announcement.What changes do you think we should make in order to solve the problem?
What changes do you think we should make in order to solve the problem?
src/components/Switch.tsxto include theaccessibilityStateproperty in thePressableWithFeedbackcomponent. This ensures the component correctly communicates its state to the system's accessibility API.• Add
accessibilityState={{checked: isOn, disabled: !!disabled}}to thePressableWithFeedbackprops.src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx, update thedistanceRatesListlogic to provide a more descriptiveaccessibilityLabelto the Switch.• Construct a comprehensive label that includes both the name and the formatted rate (e.g., "Default Rate, USD 0.50 / mile").
• Pass this new label to the Switch via the
accessibilityLabelprop.By combining these changes, the screen reader will announce: "[Rate Name], [Amount] / [Unit], on/off, switch", fulfilling all the QA requirements.
What alternative solutions did you explore? (Optional)
None
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
annaweber830 commentedon Feb 15, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Workspace Distance Rates page, VoiceOver announces each rate row as only its name and amount, but does not include the control state/role (
on/off, switch) when users navigate to the toggle.What is the root cause of that problem?
App/src/components/SelectionList/ListItem/BaseListItem.tsx
Lines 122 to 124 in 7b4fcd0
TableListItemrows are wrapped by this parent pressable, and if an item does not provide its ownaccessibilityLabel, the fallback label is onlytext + alternateText. In Distance Rates, that means screen readers announce justDefault Rate, [currency][amount]; this causes the state/role announcement to be incomplete because the focused element label never includes switch semantics.What changes do you think we should make in order to solve the problem?
App/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx
Lines 224 to 253 in 7b4fcd0
This makes the focused row announcement include the full semantic string (name + amount + state + switch role) while keeping the switch control itself aligned with the same label, so VoiceOver users consistently hear
... on/off, switch.What alternative solutions did you explore? (Optional)
github-actions commentedon Feb 15, 2026
marufsharifi commentedon Feb 15, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On
Workspaces > Distance rates, screen reader output is still not aligned with the final agreed behavior.Expected behavior after clarification:
[currency][amount].On affected web SR flows (macOS VoiceOver / Android web), focus/announcement order was inconsistent, causing missing switch state.
Video demo of the issue in android-web:
distance-rate-switch-android-web-issue.mp4
What is the root cause of that problem?
There are 2 core root causes before the fix:
In
BaseListItem, whenitem.accessibilityLabelis missing, it falls back totext + alternateText, and the row defaults to button-like role semantics, This made SR focus behavior inconsistent for reaching/announcing the nested switch on web:App/src/components/SelectionList/ListItem/BaseListItem.tsx
Line 52 in f5a76a3
App/src/components/SelectionList/ListItem/BaseListItem.tsx
Lines 122 to 123 in f5a76a3
accessibilityState.checked, which can makeon/offannouncement inconsistent in web SR combinations even whenrole="switch"is present:App/src/components/Switch.tsx
Lines 74 to 80 in f5a76a3
What changes do you think we should make in order to solve the problem?
Make accessibility behavior explicit in Distance Rates and keep labels aligned with the agreed expectation:
PolicyDistanceRatesPage:switchAccessibilityLabelas rate name only.rowAccessibilityLabelasname + amount/unit.accessibilityLabeland row role semantics for stable announcement.switch:accessibilityState={{checked, disabled}}so screen readers consistently announceon/offfor the switch role.ListItemtypes:accessibilityRolefield so this behavior can be configured per screen without broad global changes.TableListItem:accessibilityRoledown toBaseListItem.Expectation references:
#80496 (comment)
#82498 (comment)
#82498 (comment)
#82498 (comment)
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
N/A
65 remaining items
melvin-bot commentedon Mar 28, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Apr 2, 2026
This issue is confusing.
@shubham1206agra , why did you take over for @brunovjk ?
@shubham1206agra I'm not seeing much on the PR (and not much work on this issue either). At most I think $125 would be the amount, possibly less)
Please tag me when you reply.
@marufsharifi should you close your PR? It looks like you're due $250 cuz you were hired, raised PR and requested review.
😰
marufsharifi commentedon Apr 2, 2026
@mallenexpensify, I've closed the pr. thanks.
brunovjk commentedon Apr 2, 2026
I reviewed the proposal. I was busy that day, and they managed to get another C+ to review the PR. I don't believe any payment is necessary on my part. Thank you.
shubham1206agra commentedon Apr 6, 2026
@mallenexpensify This is because our PR discussion was happening on Slack: https://expensify.slack.com/archives/C01GTK53T8Q/p1774022109182049 (the reason was the urgency of the issue). I would ask for $250 payment please
mallenexpensify commentedon Apr 6, 2026
Payment Summary
Contributor: @marufsharifi paid $250 via Upwork - cuz hired/assigned, drafted PR and did tests
Contributor+: @shubham1206agra due $125 via NewDot - not a full review on the PR nor any tests.
@marufsharifi can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022032182464097085675
marufsharifi commentedon Apr 7, 2026
@mallenexpensify, I've accepted the offer. thanks.
mallenexpensify commentedon Apr 7, 2026
@marufsharifi paid, summary updated above. Thx.
JmillsExpensify commentedon May 1, 2026
$125 approved for @shubham1206agra