Skip to content

Keep same-named export templates distinct in Search - #107374

Merged
Beamanator merged 23 commits into
Expensify:mainfrom
ishpaul777:ishpaul/107372-distinguish-export-templates
Dec 3, 2026
Merged

Beamanator merged 23 commits into
Expensify:mainfrom
ishpaul777:ishpaul/107372-distinguish-export-templates

Conversation

@ishpaul777

@ishpaul777 ishpaul777 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

An accounting integration and an export template can share a name, which previously made it impossible to filter them separately in Search. This change keeps both choices separate with their existing names and icons.

For example, if both are named NetSuite, choose the integration logo to find reports exported or marked as entered in NetSuite. Choose the template icon to find reports exported using that template. Selecting both shows reports matching either choice.

Fixed Issues

$ #107372
PROPOSAL: N/A

Tests

Automated: SearchAutocompleteUtilsTest, ExportedToSelectorTest, MultiSelectTest, MultiSelectListItemTest, and Search regression suites: 1,282 tests passed across 18 suites.
TypeScript, lint, formatting, spelling, React Compiler, and parser consistency checks passed.

Use a test workspace connected to NetSuite with an export template also named NetSuite.

  1. Use two approved reports. Export one using the NetSuite template. On the other report, open the export dropdown and choose Mark as manually entered.
  2. Go to Spend > Reports > Filters > Exported to. Confirm there are two NetSuite choices, one with the integration logo and one with the template icon. With a screen reader on, focus each choice. Confirm it announces “NetSuite, integration” and “NetSuite, export template.”
  3. Select the integration choice. Confirm the manually marked report appears and the template-exported report does not.
  4. Select the template choice instead. Confirm the template-exported report appears and the manually marked report does not.
  5. Select both choices: both reports should appear. Change the filter to is not: neither report should appear.
  6. Open global Search using the magnifying glass and type exported-to != Net. Choose the NetSuite template suggestion. Confirm it becomes exported-to-template!=NetSuite and excludes the template-exported report. Save and reopen the search; the exclusion should remain.
  • Verify that no errors appear in the JS console

Offline tests

  1. After loading the filter online, go offline and reopen Exported to. Confirm both NetSuite choices remain separate.
  2. Reconnect and reopen the saved search. Confirm its template exclusion is unchanged.

QA Steps

Same as Tests and Offline tests above.

  • 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

Screen.Recording.2026-11-30.at.3.02.26.PM.mov

@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/index.ts 96.37% <ø> (ø)
...nts/Search/FilterComponents/ExportedToSelector.tsx 96.82% <100.00%> (+96.82%) ⬆️
...components/Search/FilterComponents/MultiSelect.tsx 95.89% <ø> (ø)
src/components/Search/SearchAutocompleteList.tsx 93.28% <100.00%> (+2.12%) ⬆️
...rc/components/Search/SearchRouter/SearchRouter.tsx 90.39% <100.00%> (+2.27%) ⬆️
src/hooks/useAutocompleteSuggestions.ts 73.38% <100.00%> (+0.94%) ⬆️
src/hooks/useExportedToFilterOptions.ts 100.00% <100.00%> (ø)
src/hooks/useFilterFormValues.tsx 97.29% <100.00%> (-0.08%) ⬇️
src/libs/AccountingUtils.ts 95.00% <100.00%> (+1.38%) ⬆️
src/libs/SearchQueryUtils.ts 92.98% <96.29%> (+0.08%) ⬆️
... and 4 more
... and 7415 files with indirect coverage changes

@ishpaul777

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T10:44:05.529834Z 7258b88 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.

@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: e3c9b0164f

ℹ️ 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 tests/unit/ExportedToSelectorTest.tsx Resolved
Comment thread src/libs/AccountingUtils.ts Resolved
@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.

@ishpaul777

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 5665faa770

ℹ️ 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/SearchAutocompleteUtils.ts Resolved
Comment thread src/libs/SearchAutocompleteUtils.ts Resolved
Comment thread src/libs/SearchAutocompleteUtils.ts Resolved
…inguish-export-templates

# Conflicts:
#	src/libs/SearchParser/autocompleteParser.js
#	src/libs/SearchParser/searchParser.js
…inguish-export-templates

# Conflicts:
#	src/libs/SearchParser/autocompleteParser.js
#	src/libs/SearchParser/baseRules.peggy
#	src/libs/SearchParser/searchParser.js
@ishpaul777
ishpaul777 marked this pull request as ready for review November 30, 2026 09:16
@ishpaul777
ishpaul777 requested review from a team as code owners November 30, 2026 09:16
@expensify-chore-bot
expensify-chore-bot Bot requested review from ikevin127 and twisterdotcom and removed request for a team November 30, 2026 09:16
@expensify-chore-bot

Copy link
Copy Markdown

@ikevin127 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 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: ba601231f7

ℹ️ 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/SearchAutocompleteUtils.ts Resolved

@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: 4e4e0b6d85

ℹ️ 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/AccountingUtils.ts Resolved

@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: de23ba3de3

ℹ️ 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/SearchParser/baseRules.peggy Resolved
@ikevin127

ikevin127 commented Dec 1, 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 proper code patterns were followed (see Reviewing the code)
    • 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 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)
  • 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)
  • 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 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 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

MacOS: Chrome / Safari
pr107374-ctest.mp4

@ikevin127 ikevin127 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes, non-blocker that should still be addressed: untranslated screen reader labels. The other comments are NABs.

@ishpaul777 Is the backend exportedToTemplate change live already ? I'm assuming yes since this FE PR was opend for review.

Comment thread src/libs/AccountingUtils.ts Resolved
Comment thread src/libs/AccountingUtils.ts Resolved
Comment thread src/libs/SearchAutocompleteUtils.ts Resolved
Comment thread src/libs/SearchUIUtils.ts Resolved
@expensify-chore-bot

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

@ishpaul777

ishpaul777 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

@ishpaul777 Is the backend exportedToTemplate change live already ?

The backend PR was merged when I opened this, but only went live in ~12 hours ago.

@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: 34e7b726ca

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

…inguish-export-templates

# Conflicts:
#	tests/unit/Search/ExpenseGroupedSearchViewSplitTest.tsx

@ikevin127 ikevin127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes, one blocker: Tests step 2 still says the screen reader distinguishes exported-to:NetSuite from exported-to-template:NetSuite, but the picker now announces "NetSuite, integration" and "NetSuite, export template". QA runs these steps as written, so please update it (Tests and QA Steps both point to it).

The inline comment is a NAB 🟢

…inguish-export-templates

# Conflicts:
#	src/libs/SearchParser/autocompleteParser.js
#	src/libs/SearchParser/searchParser.js

@ikevin127 ikevin127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved, no comments. @ishpaul777 thanks, the label lookup move and the Tests step 2 update cover what I had left open 🙌

@melvin-bot
melvin-bot Bot requested a review from Beamanator December 3, 2026 01:06

@Beamanator Beamanator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great!

@Beamanator
Beamanator merged commit 7ab7348 into Expensify:main Dec 3, 2026
50 of 52 checks passed
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

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.

3 participants