Skip to content

Add a Converted amount column to expense Search - #106848

Open
c3024 wants to merge 41 commits into
Expensify:mainfrom
c3024:chaitanya/106537-converted-amount-column
Open

c3024 wants to merge 41 commits into
Expensify:mainfrom
c3024:chaitanya/106537-converted-amount-column

Conversation

@c3024

@c3024 c3024 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds an optional Converted amount column to expense searches (Spend > Expenses), with sorting and a filter. The column shows each expense in its workspace's output currency, using the policyConvertedAmount and policyCurrency fields from Search. Expenses without a workspace, such as unreported expenses, show their own amount and currency. An expense created offline, or one whose amount, currency or report is edited, shows its own amount until the next search returns the converted value. The table header reads Converted, while the column picker and the filter say Converted amount. The column is off by default and is not offered in the single-report view.

Clicking the column header sorts by the converted amount (sortBy:convertedAmount). The Converted amount filter sits above Purchase amount and works the same way. A bare value compares each expense in its own workspace currency, and a value with a currency, such as convertedAmount>"50.00 USD", converts the amount to that currency first. columns:converted-amount typed in the search bar now maps back to the column.

Fixed Issues

$ #106537
PROPOSAL: #106537 (comment)

Tests

  1. Use a workspace whose currency is USD, and add a EUR expense to a report on that workspace.
  2. Add a USD expense to the same workspace, and track an unreported EUR expense.
  3. Go to Spend > Expenses and open the column picker.
  4. Enable Converted amount and save.
  5. Verify the EUR workspace expense shows its USD equivalent under Converted, while Amount still shows the EUR amount.
  6. Verify the USD expense shows the same value under Amount and Converted.
  7. Verify the unreported EUR expense shows its EUR amount under Converted.
  8. Verify the column header reads Converted, then click it and verify the list is sorted by its values, largest first.
  9. Click it again and verify the order reverses.
  10. Open Filters, search for "amount", and verify Converted amount is listed above Purchase amount.
  11. Open Converted amount, choose Greater than, pick USD, enter an amount between the two workspace expenses' converted values, and confirm.
  12. Verify only the expense whose converted value is above that amount remains, and the chip reads "Converted amount: Greater than USD".
  13. Remove the filter, then add Converted amount Greater than with the workspace currency and verify the same result.
  14. Open a report on the workspace and open its column picker.
  15. Verify Converted amount is not offered there.
  16. Back in Spend > Expenses, export the current view and verify the CSV has a Converted amount column with the same values.
  • Verify that no errors appear in the JS console

Offline tests

  1. Enable Converted amount in Spend > Expenses as in the tests above.
  2. Go offline.
  3. Create a EUR expense on the USD workspace.
  4. Verify its Converted amount shows its own EUR amount.
  5. Go back online and refresh the search.
  6. Verify its Converted amount now shows the USD equivalent.
  7. Go offline again and change that expense's amount.
  8. Verify its Converted amount shows the new EUR amount, not the old USD value.
  9. Go back online and refresh the search.
  10. Verify its Converted amount shows the USD equivalent of the new amount.

QA Steps

Same as tests.

  • 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 106537-filter-bare-result 106537-filter-usd-result 106537-filter-editor 106537-filter-list 106537-sort-desc 106537-sort-asc 106537-web-05-back-online 106537-web-04-offline 106537-web-03-report-picker 106537-web-02-expenses 106537-web-01-column-picker

@melvin-bot

melvin-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/SENTRY_LABEL.ts 100.00% <ø> (ø)
src/CONST/index.ts 96.24% <ø> (ø)
src/components/Search/SearchTableHeader.tsx 51.37% <ø> (ø)
...ents/TransactionItemRow/TransactionItemRowWide.tsx 96.61% <100.00%> (+0.13%) ⬆️
src/hooks/useAdvancedSearchFilters.ts 97.95% <ø> (ø)
src/libs/DebugUtils.ts 68.41% <100.00%> (+0.11%) ⬆️
src/libs/ReportUtils.ts 91.21% <100.00%> (+0.01%) ⬆️
src/libs/SearchAmountFilterUtils.ts 100.00% <100.00%> (ø)
src/libs/SearchAutocompleteUtils.ts 78.57% <100.00%> (+0.08%) ⬆️
src/libs/SearchQueryUtils.ts 92.47% <100.00%> (+<0.01%) ⬆️
... and 7 more
... and 10 files with indirect coverage changes

@c3024 c3024 changed the title [HOLD Auth 26666] Add a Converted amount column to expense Search Add a Converted amount column to expense Search Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

It looks like this PR adds a search filter or column. Please double check the following:

  • The filter is available in the Search filters dropdown and returns the expected results.
  • The filter has a matching column that can be shown through Display > Edit columns.
  • The column can be sorted by clicking its header.
  • Export > Current view includes the column in the exported CSV.

@c3024

c3024 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Filter: added under Filters as Converted amount, above Purchase amount. It works like Purchase amount, with or without a currency. Tested against staging.
  • Column: added under Display > Edit columns for expense searches.
  • Sort: clicking the Converted amount header sorts by the converted value. Tested against staging.
  • Export: Export > Current view includes Converted amount, tested against staging.

@trjExpensify

Copy link
Copy Markdown
Contributor

Filter: N/A, this PR adds a column only. The issue does not ask for a filter.

Mhm, good question. I don't see why we wouldn't add a filter for it. We have Purchase amount as a filter, so we could add it above that. (CC: @JmillsExpensify). Happy for the filter to be a follow-up PR though.

Sort: out of scope for this issue, which asks for the column only. Sorting needs a per-row currency conversion in the search SQL, so it can follow separately if wanted.

You should be able to sort on this column when displayed in the table. 👍

@c3024
c3024 marked this pull request as ready for review November 20, 2026 13:42
@c3024
c3024 requested review from a team as code owners November 20, 2026 13:42
@expensify-chore-bot
expensify-chore-bot Bot requested review from QichenZhu and removed request for a team November 20, 2026 13:42
@expensify-chore-bot

Copy link
Copy Markdown

@QichenZhu 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 Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: 🔄 Running

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-23T07:51:06.626248Z 658dc80 New commits
ℹ️ 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.

@expensify-chore-bot
expensify-chore-bot Bot removed the request for review from a team November 20, 2026 13:42

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16c5db99c2

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/libs/ReportUtils.ts Resolved
Comment thread src/libs/SearchParser/baseRules.peggy Resolved

Copy link
Copy Markdown
Contributor

Both should be a follow-up imo

@QichenZhu

QichenZhu commented Nov 21, 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
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari

@QichenZhu

Copy link
Copy Markdown
Contributor

I found an offline defect, likely a frontend bug.

  1. An expense has an amount of NZ$90 and a converted amount of $49.22.
  2. Edit it online to NZ$100, and the converted amount becomes $54.69.
  3. Then edit it offline to NZ$110, and the converted amount reverts to $49.22.

For reference, the report table view shows the last known value $54.69, which is stale but somewhat better.

bug.mov

@dubielzyk-expensify

dubielzyk-expensify commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

This looks a bit tight, not sure if that's just the default stuff though. I wonder if we could get away with saying Converted instead of Converted amount (only in the table header, not when editing columns or filters) given the amount is implied by the value of the columns. cc @Expensify/design and @trjExpensify for thoughts on that though

CleanShot 2026-11-23 at 9 49 38 AM@2x

@c3024

c3024 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author
  • Addressed all the Codex comments.
  • Implemented filter and sort in this PR itself. Nothing left for a followup.
  • Fixed this bug with showing the original currency amount till backend returns a correct amount.
  • Shortened the text to Converted only for the table header.

This branch has not been deployed

No deployments
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.

5 participants