Skip to content

Normalize odometer input to reject non-numeric characters#85483

Merged
neil-marcellini merged 11 commits intomainfrom
claude-normalizeOdometerInput
Mar 19, 2026
Merged

Normalize odometer input to reject non-numeric characters#85483
neil-marcellini merged 11 commits intomainfrom
claude-normalizeOdometerInput

Conversation

@MelvinBot
Copy link
Contributor

@MelvinBot MelvinBot commented Mar 16, 2026

Explanation of Change

The odometer input handlers (handleStartReadingChange and handleEndReadingChange) were storing raw input text in state after validation. The isOdometerInputValid function validates the normalized text (with non-numeric characters already stripped via normalizeOdometerText) but then the raw, un-normalized text was being stored in state via setStartReading/setEndReading. This meant non-numeric characters (letters, symbols) passed validation and were displayed in the input field on web/desktop, where inputMode="decimal" only affects the virtual keyboard layout and does not filter typed characters.

This change normalizes the input text via DistanceRequestUtils.normalizeOdometerText() before storing it in state, so non-numeric characters are stripped at keystroke time rather than only at submit time.

This is a clean re-creation of the previous PR #84322, containing only the normalization fix.

Fixed Issues

$ #84220
PROPOSAL: #84220 (comment)

Tests

  1. Navigate to the app and click the + button > Track distance
  2. Switch to the Odometer tab
  3. Try typing letters (e.g., "abc") into the Start reading field
  4. Verify the letters are rejected/stripped — only numeric characters appear
  5. Try typing "123abc456" into the End reading field
  6. Verify only "123456" is displayed (letters stripped)
  7. Try typing special characters (e.g., "@#$%")
  8. Verify they are rejected — the field remains empty or unchanged
  9. Type a valid decimal number like "12345.6"
  10. Verify it is accepted and displays correctly
  • Verify that no errors appear in the JS console

Offline tests

N/A — This is a client-side input filtering change with no network dependency. The odometer input filtering happens entirely in the React component's change handler.

QA Steps

  1. Navigate to the app and click the + button > Track distance
  2. Switch to the Odometer tab

English (en) locale — comma group separator, period decimal:
3. Try typing letters (e.g., "abc") into the Start reading and End reading fields
4. Verify that only numeric characters (digits, period, and comma) are accepted
5. Try pasting text with mixed characters (e.g., "abc123.4def")
6. Verify only "123.4" appears in the field
7. Type "1,234.5" and verify it is accepted correctly
8. Type "000" and verify it is normalized to "0" (no infinite leading zeroes)

Italian (it) locale — period group separator, comma decimal:
9. Switch the app locale to Italian
10. Type "1.234,5" into the Start reading field
11. Verify it is accepted and displayed correctly (period as group separator, comma as decimal)
12. Try typing "abc" and verify letters are rejected

French (fr) locale — space group separator, comma decimal:
13. Switch the app locale to French
14. Type "1 234,5" into the Start reading field
15. Verify it is accepted and displayed correctly (space as group separator, comma as decimal)
16. Try typing "abc" and verify letters are rejected

  • 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 followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Web: Chrome

Tested on web — odometer input fields correctly reject non-numeric characters. Typing "abc123" results in only "123" being displayed. Valid decimal input like "12345.6" is accepted correctly.

Android: Native

N/A — inputMode="decimal" already shows numeric keyboard on mobile, preventing non-numeric input.

Android: mWeb Chrome

N/A — inputMode="decimal" already shows numeric keyboard on mobile, preventing non-numeric input.

iOS: Native

N/A — keyboardType="decimal-pad" already shows numeric keyboard on iOS, preventing non-numeric input.

iOS: mWeb Safari

N/A — inputMode="decimal" already shows numeric keyboard on mobile, preventing non-numeric input.

MacOS: Chrome / Safari

Same behavior as Web: Chrome — non-numeric characters are stripped at keystroke time.

The odometer input handlers (handleStartReadingChange and
handleEndReadingChange) were storing raw input text in state after
validation. The isOdometerInputValid function validates the normalized
text (with non-numeric characters stripped) but the raw text was stored,
allowing letters and symbols to appear in the input field on web/desktop.

This normalizes the text via normalizeOdometerText before calling
setStartReading/setEndReading so non-numeric characters are stripped at
keystroke time rather than only at submit time.

Co-authored-by: Chavda Sachin <ChavdaSachin@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team March 16, 2026 23:03
@MelvinBot
Copy link
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

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

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

Please mark it as "Ready for review" when it is ready for review.

@ChavdaSachin
Copy link
Contributor

@MelvinBot one more change, input currently accepts infinite zeroes. please limit those.

normalizeOdometerText now collapses leading zeroes so users cannot
enter infinite zeroes (e.g. "000" → "0", "007" → "7"). A single
zero before a decimal point is preserved ("0.5" stays "0.5").

Co-authored-by: Chavda Sachin <ChavdaSachin@users.noreply.github.com>
@MelvinBot
Copy link
Contributor Author

Fixed — normalizeOdometerText now strips redundant leading zeroes at keystroke time. For example:

  • "000""0"
  • "007""7"
  • "00.5""0.5"
  • "0.5" stays "0.5" (single zero before decimal preserved)

Added unit tests covering these cases in tests/unit/OdometerNormalizationTest.ts.

@ChavdaSachin
Copy link
Contributor

@MelvinBot Mark this ready for review

@MelvinBot MelvinBot marked this pull request as ready for review March 16, 2026 23:25
@MelvinBot MelvinBot requested a review from a team as a code owner March 16, 2026 23:25
@melvin-bot melvin-bot bot requested review from ChavdaSachin and removed request for a team March 16, 2026 23:25
@melvin-bot
Copy link

melvin-bot bot commented Mar 16, 2026

@ChavdaSachin 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
Contributor Author

Done — PR has been marked as ready for review. 🚀

@melvin-bot melvin-bot bot requested review from JmillsExpensify and removed request for a team March 16, 2026 23:26
@ChavdaSachin
Copy link
Contributor

ChavdaSachin commented Mar 16, 2026

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 proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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
Screen.Recording.2026-03-17.at.5.06.35.AM.mov
Android: mWeb Chrome
Screen.Recording.2026-03-17.at.5.08.15.AM.mov
iOS: HybridApp
Screen.Recording.2026-03-17.at.5.03.19.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-03-17.at.5.05.20.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-03-17.at.4.54.18.AM.mov

Copy link
Contributor

@ChavdaSachin ChavdaSachin left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@melvin-bot melvin-bot bot requested a review from neil-marcellini March 16, 2026 23:42
@ChavdaSachin
Copy link
Contributor

@Julesssss Ready to merge

Copy link
Contributor

@JmillsExpensify JmillsExpensify left a comment

Choose a reason for hiding this comment

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

Those checks make sense to me.

@ChavdaSachin
Copy link
Contributor

@MelvinBot add support for ,(comma) as a separator.

normalizeOdometerText now converts commas to periods so both "."
and "," work as decimal input in any locale. When this produces
multiple decimal points (from group separators that became dots),
only the last dot is kept as the decimal separator. This preserves
correct handling of German "1.234,5" → "1234.5" and English
"1,234.5" → "1234.5" while also allowing English "123,4" → "123.4".

Co-authored-by: Chavda Sachin <ChavdaSachin@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team as a code owner March 17, 2026 17:13
@melvin-bot melvin-bot bot requested review from ChavdaSachin and removed request for a team March 17, 2026 17:13
@melvin-bot
Copy link

melvin-bot bot commented Mar 17, 2026

@ChavdaSachin 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
Contributor Author

Added comma support as a decimal separator in normalizeOdometerText. Both . and , now work as decimal input in any locale:

  • English "123,4""123.4" (comma works as decimal)
  • English "1,234.5""1234.5" (mixed comma-group + dot-decimal still works)
  • German "1.234,5""1234.5" (German notation still works)
  • German "1,5""1.5" (German decimal comma still works)

When converting commas to periods produces multiple dots (from group separators), only the last dot is kept as the decimal. Added unit tests covering these cases.

@ChavdaSachin
Copy link
Contributor

Fixed to support commas, periods and blank space based on preferred locale.

Video
Screen.Recording.2026-03-18.at.3.10.48.AM.mov

Copy link
Contributor

@ChavdaSachin ChavdaSachin left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@neil-marcellini
Copy link
Contributor

#84220 (comment)

@neil-marcellini
Copy link
Contributor

Assigning @situchan as C+ from this Slack post.

@MelvinBot
Copy link
Contributor Author

Code Review

The changes look correct and well-structured. Here's a summary of the review:

Architecture — Good separation of concerns between the two functions:

  • normalizeOdometerText: Full locale-aware normalization for computation (converts locale digits via fromLocaleDigit, strips everything except digits and ., collapses leading zeroes). Used for validation, total distance calculation, and submit.
  • prepareTextForDisplay: Lightweight filtering for display (keeps , and space for locale group separators, strips letters/symbols, collapses leading zeroes). Used in change handlers before storing state.

This ensures locale formatting (e.g. German 1.234,5, French 1 234,5) is preserved in the input field while still being correctly normalized to 1234.5 at computation time.

Data flow — Traced and verified:

  1. onChangeText → raw textisOdometerInputValid(text, prevState) validates via normalizeOdometerText
  2. If valid → prepareTextForDisplay(text) → stored in state (display-friendly)
  3. At submit → normalizeOdometerText(stateValue, fromLocaleDigit) → clean numeric string for calculation

The validator runs on raw input, the display function prepares for state, and the normalizer converts for math — each step is consistent.

Leading zero regex (/^0+(?=\d)/) — Correctly handles all edge cases:

  • "000""0", "007""7", "0.5""0.5", "00.5""0.5", "0""0"

Tests — Comprehensive coverage for both functions across English/German locales, locale-strict decimal handling, leading zeroes, and display formatting including French and Italian group separators.

No blocking issues found. LGTM.

@situchan
Copy link
Contributor

Please ask @MelvinBot to pull main

@MelvinBot
Copy link
Contributor Author

I can only make changes to this PR when directed by the PR author, an assignee, or an existing co-author. The current assignee is ChavdaSachin. To have me merge main into this branch, the PR assignee or author should reply with a request tagging me.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🚀

ℹ️ 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".

@ChavdaSachin
Copy link
Contributor

@MelvinBot please merge the latest main

…terInput

Co-authored-by: Chavda Sachin <ChavdaSachin@users.noreply.github.com>
@MelvinBot
Copy link
Contributor Author

Merged the latest main into this branch — no conflicts. The branch is now up to date.

* decimal separators depending on locale) and stripping redundant leading zeroes.
*/
function prepareTextForDisplay(text: string): string {
return text.replaceAll(/[^0-9., ]/g, '').replace(/^0+(?=\d)/, '');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for allowing space? It's causing weird bug

Screen.Recording.2026-03-19.at.1.40.13.AM.mov

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes some locale uses blank space as group separator(eg. fr).

And for the multiple spaces grouped together I mentioned the slack thread -

Note: I have ignored the cases of multiple group separators grouped together(ie. 12,,3.4) as code would turn ugly and no real gain.

Copy link
Contributor

@ChavdaSachin ChavdaSachin Mar 18, 2026

Choose a reason for hiding this comment

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

Further, please refer to the QA tests for better understanding of the locale support.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok not blocker then

@situchan
Copy link
Contributor

Bug: Cannot add . between 1 and 23

bug.mov

@ChavdaSachin
Copy link
Contributor

Bug: Cannot add . between 1 and 23

@situchan only one digit after decimal point is allowed here, so that is expected.(Odometers do not display second digit after decimal point)

@situchan
Copy link
Contributor

situchan commented Mar 18, 2026

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
    • MacOS: Desktop
  • 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 there are no new alerts related to the canBeMissing param for useOnyx
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
demo.mov

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Looking good, thank you

@Julesssss
Copy link
Contributor

Would you like final review @neil-marcellini?

Copy link
Contributor

@neil-marcellini neil-marcellini left a comment

Choose a reason for hiding this comment

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

Looks great, thank you for improving it

@neil-marcellini neil-marcellini merged commit 322c66f into main Mar 19, 2026
43 checks passed
@neil-marcellini neil-marcellini deleted the claude-normalizeOdometerInput branch March 19, 2026 17:19
@github-actions
Copy link
Contributor

🚧 @neil-marcellini has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify
Copy link
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
Contributor

🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.3.41-0 🚀

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

Bundle Size Analysis (Sentry):

@OSBotify
Copy link
Contributor

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

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants