Skip to content

Announce "Your review is required" on expense form rows in an error state - #103573

Merged
jasperhuangg merged 2 commits into
mainfrom
claude-announceExpenseFieldRowReviewRequired
Oct 14, 2026
Merged

jasperhuangg merged 2 commits into
mainfrom
claude-announceExpenseFieldRowReviewRequired

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

On the expense form, every field row (Attendees, Category, Tag, Merchant, and so on) is drawn with ExpenseFieldRow. When a row has an error, it turns its border red and shows the message below the row. That message sits outside the focusable row, and the row draws no red dot. So nothing told screen readers the row needed attention. The Attendees row read only "Attendees, ".

Push rows announce "Your review is required" through MenuItem.BrickRoadIndicator, which registers the REVIEW_REQUIRED announcement with MenuItem.Root. This PR adds a small leaf to ExpenseFieldRow that registers the same announcement whenever errorText is set, without drawing a dot. MenuItem.Root appends registered announcements even to a custom accessibilityLabel, so the Attendees row now reads "Attendees, . Your review is required". The same fix applies to every other expense form row in an error state.

I added unit tests in tests/unit/components/ExpenseFieldRow.test.tsx covering the label with and without an error.

AI Tests (run by MelvinBot):

  • Passed: Jest for ExpenseFieldRow.test.tsx, tests/ui/components/MenuItem/*, MenuItemTest.tsx and MoneyRequestReportFooter.tsx (61 tests), npm run lint-changed, npm run spell-changed, and react-compiler-compliance-check check on ExpenseFieldRow.tsx.
  • npm run typecheck fails in tests/unit/OptionsListUtilsTest.tsx(5750). This PR doesn't touch that file, and the error also shows on main.
  • Not run: oxfmt, the full Jest suite, and Storybook. The sandbox blocked them. MelvinBot did not check this with a real screen reader or in the browser.

Fixed Issues

$ #103560
PROPOSAL: #103560 (comment)

Tests

Preconditions:

  • Prepare a screen reader app: Narrator, VoiceOver, or TalkBack
  • In a workspace, enable Rules, enable Attendee tracking, and create a field requirement that requires attendees for one specific category
  1. Create an expense in that workspace
  2. Select the category from the preconditions
  3. Do not select a second attendee in the Attendees row
  4. Fill in the rest of the fields
  5. Click the Create expense button
  6. Enable the screen reader app
  7. Focus on the Attendees row
  8. Verify that the Attendees row is announced with its attendee names followed by "Your review is required"
  9. Focus on a row without an error (for example Merchant) and verify it is announced without "Your review is required"
  • Verify that no errors appear in the JS console

Offline tests

Same as tests. The change only updates the row's accessibility label and makes no network requests.

QA Steps

Same as tests, on staging.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

…tate

Co-authored-by: Marcin Warchoł <war-in@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team October 9, 2026 10:16
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Oct 9, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I opened this PR from an upstream branch because I couldn't find a fork of App under your account that I can push to.

To take ownership of this branch and push updates from your own fork, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-announceExpenseFieldRowReviewRequired
git checkout -b claude-announceExpenseFieldRowReviewRequired upstream/claude-announceExpenseFieldRowReviewRequired
git push -u origin claude-announceExpenseFieldRowReviewRequired

Then you can close this PR and open a new one from your fork.

@war-in

war-in commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot the change is straightforward, so copy tests from the issue and open the PR for review
Fix failing checks if they're related to the PR

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing typecheck and test (job 5) checks are unrelated to this PR. main is broken, and a fix is already open: [No QA][Failing Tests on Main] Fix the main typecheck and test failure in the self DM search test. I didn't push anything. Merge main into this branch after that PR lands, and the checks should pass.

Details

view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Nothing has changed since my last check, so I still have nothing to push. The typecheck and test (job 5) failures come from a broken test on main, not from this PR. The fix is still open: [No QA][Failing Tests on Main] Fix the main typecheck and test failure in the self DM search test.

After that PR merges, ask me to merge main into this branch, or merge it yourself. The checks should then pass.

Details

view run

@war-in

war-in commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@linhvovan29546 PR is ready, but I cant open it or update the description
Could you do this?

@MelvinBot

MelvinBot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ✅ pass

On dev NewDot web, the Attendees row in an error state (a workspace rule requires multiple attendees for the expense's category) adds "Your review is required" to its accessible name. Rows without an error (Category, Merchant) do not. The PR has no test steps yet, so I used the steps from the linked issue. A real screen reader wasn't available, so I checked each row's accessible label instead.
Attendees row in red error state with error message

Step Status
Workspace preconditions: Rules on, Attendee tracking on, field requirement requiring attendees for one category (Travel)Workspace Rules > Field requirements shows a saved rule: Require. Category is "Travel" / Require attendees.
Field requirement rule requiring attendees for category Travel
✅
Start creating a manual expense with an amountCreate expense > Manual form opened; Amount set to 25 USD.
✅
Select the category from the preconditions (Travel)Category row accessible name read "Category, Travel" after selection.
✅
Do not add a second attendeeAttendees row left at its default single attendee (the submitter).
✅
Fill in the remaining required fieldsMerchant set to "Test Travel Co"; Date defaulted to 2026-10-09.
Expense form filled with Amount, Merchant, Category=Travel, single attendee
✅
Click Create expense: Attendees row shows an error instead of creating the expenseThe form stayed open, the Attendees row got a red border, and "Multiple attendees required for this category" appeared at the top of the form and under the Attendees row.
Attendees row in red error state with error message
✅
Attendees row accessible name is the attendee name followed by "Your review is required"Row label: "Attendees, melvinbottestuser+37916633242_1_web_0@gmail.com. Your review is required"
✅
Regression: rows without an error don't include "Your review is required"Category row label was exactly "Category, Travel"; Merchant row label was exactly "Merchant".
✅

view run · view recording

@MelvinBot
MelvinBot marked this pull request as ready for review October 9, 2026 10:38
@MelvinBot
MelvinBot requested a review from a team as a code owner October 9, 2026 10:38
@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and linhvovan29546 and removed request for a team and joekaufmanexpensify October 9, 2026 10:38
@melvin-bot

melvin-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

@linhvovan29546 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]

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T10:41:07.452386Z 4950890 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I copied the test steps from the issue into Tests, Offline tests, and QA Steps, and marked the PR ready for review. I added one regression step: a row without an error must not say "Your review is required".

The failing checks are unrelated to this PR, so I didn't change any code:

  • typecheck: fails at tests/unit/OptionsListUtilsTest.tsx(5750) because filterAndOrderOptions gets the wrong number of arguments.
  • test (job 5): one test in the same file fails: filterAndOrderOptions() › should return the self DM when searching "me".
  • Check independent approval: this check is expected to fail until a reviewer approves.
Why the failures are unrelated

This PR changes only ExpenseFieldRow.tsx and ExpenseFieldRow.test.tsx. It is one commit on top of the current main tip. Neither file is involved in OptionsListUtilsTest.tsx. The typecheck error also shows on main without this PR.

The PR Author Checklist still needs a person to complete it, including the screen reader and all-platforms items. That check will fail until you do.


view run

@linhvovan29546

Copy link
Copy Markdown
Contributor

@linhvovan29546 PR is ready, but I cant open it or update the description Could you do this?

I can ask Melvin to update it. You can also ask Melvin to make the update.

@linhvovan29546

Copy link
Copy Markdown
Contributor

@MelvinBot Please merge main and resolve the unit test and TypeScript workflow failures.

@MelvinBot

MelvinBot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Merging main should fix both failures. The PR's code doesn't cause them. I didn't push anything because of the permission note below.

  • typecheck: tests/unit/OptionsListUtilsTest.tsx(5750,17): error TS2554: Expected 1 arguments, but got 10.
  • test (job 5): the same file fails in should return the self DM when searching "me".

This PR doesn't touch that test file. The break came from Match the self DM by the localized You/Me in report search, which merged on main. A later commit on main, "Fix self DM search test arguments" (dd03317459, 2026-10-09 11:45 UTC), fixed it. The PR's last checks ran at 10:18 UTC, before that fix landed.

I can only make code changes when directed by the PR author, an assignee, or an existing co-author. To have me implement this, the PR assignee or author should reply with a request tagging me.

@linhvovan29546

Copy link
Copy Markdown
Contributor

@war-in Could you please ask Melvin to merge the main branch? Thanks

@war-in

war-in commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Please merge main and resolve the unit test and TypeScript workflow failures.

…eFieldRowReviewRequired

Co-authored-by: Marcin Warchoł <war-in@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner October 13, 2026 11:10
@melvin-bot
melvin-bot Bot requested a review from jasperhuangg October 13, 2026 11:10
@melvin-bot
melvin-bot Bot removed the request for review from a team October 13, 2026 11:10
@melvin-bot

melvin-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

@jasperhuangg 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]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I merged main into this branch and pushed. CI now passes typecheck and all 8 test jobs.

The merge had no conflicts and changed no code in this PR. It only brought in the fix for the self DM search test, which main merged after this PR's last run. The PR diff is still just ExpenseFieldRow.tsx and its test.

Two checks aren't green yet:

  • validate-perf-tests was still running when I finished.
  • Check independent approval fails until a reviewer approves the PR.

view run

@linhvovan29546

linhvovan29546 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp Screenshot 2026-10-13 at 20 05 48
Android: mWeb Chrome
iOS: HybridApp Screenshot 2026-10-13 at 19 54 00
iOS: mWeb Safari
MacOS: Chrome / Safari Screenshot 2026-10-13 at 18 29 12

@jasperhuangg
jasperhuangg merged commit 932ba52 into main Oct 14, 2026
43 of 45 checks passed
@jasperhuangg
jasperhuangg deleted the claude-announceExpenseFieldRowReviewRequired branch October 14, 2026 05:41
@github-actions

Copy link
Copy Markdown
Contributor

🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.5.9-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update needed. This PR only adds a screen reader announcement ("Your review is required") to expense form rows that already show an error, so no article sentence becomes incorrect.


view run

@kavimuru

Copy link
Copy Markdown

@war-in This is a accessibility testing and A11Y testing is OOS. Could this be verified internally?

@mkhutornyi mkhutornyi left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming from https://expensify.slack.com/archives/C02NK2DQWUX/p1792051830926699?thread_ts=1792047353.827059&cid=C02NK2DQWUX

Verified working as expected on all platforms.

web staging:

web.mov

android staging:

android.mov

iphone (real device):

ios.mp4

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.9-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants