Skip to content

feat: Add exported-to filter in search filters#81077

Merged
JS00001 merged 53 commits into
Expensify:mainfrom
samranahm:80005/Add-exported-to-filter
Feb 26, 2026
Merged

feat: Add exported-to filter in search filters#81077
JS00001 merged 53 commits into
Expensify:mainfrom
samranahm:80005/Add-exported-to-filter

Conversation

@samranahm

@samranahm samranahm commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #80005
PROPOSAL: #80005 (comment)

Tests

Precondition:

  • Workspace is connected to an accounting integration

Test 01

  1. Create expense in workspace chat and export it one accounting integration
  2. Open Reports page > filters
  3. Verify "Exported to" option available below the "Exported" option
  4. Open "Exported to" and verify connected integration is available along with standard items "All Data - report level", "All Data - expense level" and any other custom template
  5. Select the integration that was used to export expose on > Save > View Results
  6. Verify the expense appear in search result
  7. Verify the exported-to:integration is not added to search query input since query input was empty initially
  8. Crate second expense > More > Export > "All Data - report level" and repeat the steps to verify this expense appear in search result

Test 02

  1. Submit an expense in workspace chat and export to QuickBooks Online (or any integration)
  2. Open Reports page and type in search query input type:expense exported-to:"QuickBooks Online"
  3. Verify as a valid query complete QuickBooks Online background color change of filter value > press enter
  4. Verify on search page filters button show filters (1) to indicate filter has been applied
  5. Open filter page and open "Exported to" page and verify the integration in query is selected in "Exported page"
  6. Change the integration option > Save > View results and verify the query has been updated
  7. Start removing integration from query and verify "Suggestion" list is appear containing all the Integations once it become exported-to:
  8. Choose one suggestion and verify query is updated and new filter has been applied
  9. Verify if updated integration is not connected to any workspace or workspace filter is applied and selected workspace/workspaces not connected to updated integration the Exported to filter is not applied in Filters page.

Test 03 - Negation

  1. Export some expenses on different integrations and open Reports page
  2. In search query type type:expense exported-to:"Sage Intacct"
  3. Verify any expense that is exported to "Sage intacct" is not included in search result
  4. Verify entering negation filter-exported-to:"QuickBooks Online" does not apply exported-to filter and does not effect "Exported to" page items
  5. Enter type:expense -exported-to:"QuickBooks Desktop" exported-to:"QuickBooks Online" and verify search result show expenses those are
    • Not exported to QuickBook Desktop
    • Exported to QuickBook Online
  6. Open filters page > "Export to" and verify QuickBook Online is selected

Test 04 - Multiple workspaces

  1. Create at least two workspaces
  2. Connect both with different accounting integrations
  3. Open Reports page > Filter > Exported to page
  4. Verify both accounting integrations are available
  5. Navigate back and open Workspace filter
  6. Select one workspace and open Exported to page again
  7. Verify only integration that's linked to selected workspace is listed
  8. Select more than one workspace and verify all integrations are displayed in Exported to page
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."

  • 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 there are no new alerts related to the canBeMissing param for useOnyx
  • 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

Android: Native
Android.Native.mp4
Android: mWeb Chrome
Android.mWeb.Chrome.mp4
iOS: Native
IOS.Native.mp4
iOS: mWeb Safari
IOS.mWeb.Safari.mp4
MacOS: Chrome / Safari
macOS.Chrome.mp4

@codecov

codecov Bot commented Jan 31, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/CONST/index.ts 92.56% <100.00%> (+0.12%) ⬆️
src/SCREENS.ts 100.00% <ø> (ø)
src/components/MoneyReportHeader.tsx 0.00% <ø> (ø)
src/components/Search/SearchAutocompleteInput.tsx 100.00% <100.00%> (ø)
src/hooks/useAdvancedSearchFilters.ts 82.50% <ø> (ø)
src/hooks/useExportedToAutocompleteList.ts 100.00% <100.00%> (ø)
src/hooks/useExportedToFilterOptions.ts 100.00% <100.00%> (ø)
src/hooks/useFilterFormValues.tsx 100.00% <ø> (ø)
src/libs/AccountingUtils.ts 63.63% <100.00%> (+63.63%) ⬆️
...avigation/linkingConfig/RELATIONS/SEARCH_TO_RHP.ts 100.00% <ø> (ø)
... and 16 more
... and 12 files with indirect coverage changes

@samranahm samranahm changed the title [WIP]Add support for exported-to: in search filters [WIP] feat: Add exported-to filter in search Jan 31, 2026
@samranahm samranahm marked this pull request as ready for review February 1, 2026 19:27
@samranahm samranahm requested review from a team as code owners February 1, 2026 19:27
Copilot AI review requested due to automatic review settings February 1, 2026 19:27
Comment thread src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersExportedToPage.tsx Outdated
Comment thread src/components/Search/SearchAutocompleteList.tsx Outdated
Comment thread src/CONST/index.ts Outdated
Comment thread src/components/Search/SearchAutocompleteList.tsx Outdated

Copilot AI 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.

Pull request overview

This PR adds support for the exported-to: filter in the search functionality, allowing users to filter expenses and reports by the accounting integration they were exported to (Xero, QuickBooks Online, QuickBooks Desktop, NetSuite, Sage Intacct, or Certinia), as well as by custom export template names.

Changes:

  • Added exported-to filter support in search query parser with both camelCase (exportedTo) and kebab-case (exported-to) syntax
  • Implemented SearchFiltersExportedToPage component to allow users to select export destinations from a UI
  • Added Certinia as a new supported accounting integration throughout the codebase

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/CONST/index.ts Added EXPORTED_TO constants, CERTINIA integration name, and predefined integration filter values
src/SCREENS.ts Added ADVANCED_FILTERS_EXPORTED_TO_RHP screen definition
src/types/onyx/Policy.ts Added Certinia connection type definition
src/types/form/SearchAdvancedFiltersForm.ts Added exportedTo and exportedToNot filter keys and allowed them in expense/chat/invoice type filters
src/libs/SearchParser/baseRules.peggy Added exportedTo grammar rule supporting both camelCase and kebab-case syntax
src/libs/SearchParser/searchParser.js Generated parser code for exportedTo filter
src/libs/SearchParser/autocompleteParser.js Generated autocomplete parser code for exportedTo filter
src/libs/SearchParser/searchParser.peggy Added exportedTo to key alternatives in search grammar
src/libs/SearchParser/autocompleteParser.peggy Added exportedTo to autocomplete key alternatives
src/libs/SearchQueryUtils.ts Added logic to build and parse exportedTo filter values
src/libs/SearchAutocompleteUtils.ts Added validation for exportedTo filter values
src/libs/AccountingUtils.ts Added functions to map connection names to search values and get predefined connection names
src/libs/ReportUtils.ts Updated getIntegrationIcon to support CertiniaSquare icon
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersExportedToPage.tsx New page component for selecting export destinations with integration icons
src/pages/Search/AdvancedSearchFilters.tsx Added exportedTo filter configuration and display logic
src/components/Search/SearchMultipleSelectionPicker.tsx Added leftElement support for custom icons in picker items
src/components/Search/SearchAutocompleteList.tsx Added autocomplete support for exportedTo filter with integration and template values
src/components/ReportActionItem/ExportWithDropdownMenu.tsx Added CertiniaSquare to lazy-loaded icons
src/components/MoneyReportHeader.tsx Added CertiniaSquare to lazy-loaded icons
src/components/ImportedFromAccountingSoftware.tsx Added CertiniaSquare to lazy-loaded icons
src/pages/inbox/report/ReportDetailsExportPage.tsx Added CertiniaSquare to lazy-loaded icons
src/libs/Navigation/linkingConfig/config.ts Added route configuration for EXPORTED_TO filter page
src/libs/Navigation/linkingConfig/RELATIONS/SEARCH_TO_RHP.ts Added EXPORTED_TO screen to search-to-RHP relations
src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx Added SearchFiltersExportedToPage to modal stack navigator
src/hooks/useAdvancedSearchFilters.ts Added EXPORTED_TO to allowed filters for expense, chat, and invoice types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libs/SearchParser/baseRules.peggy Outdated
Comment thread src/libs/SearchAutocompleteUtils.ts Outdated

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

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

Comment thread src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersExportedToPage.tsx Outdated
@samranahm

Copy link
Copy Markdown
Contributor Author

Taking a look, will fix them ASAP.

@aimane-chnaif

Copy link
Copy Markdown
Contributor

All tests failed

@samranahm

Copy link
Copy Markdown
Contributor Author

We changed useSearchContext to useSearchStateContext in this PR #83206 and it recently merged. Updating the hook to use useSearchStateContext

@samranahm

Copy link
Copy Markdown
Contributor Author

@aimane-chnaif We're good to go.

@aimane-chnaif

Copy link
Copy Markdown
Contributor

@samranahm stale filter issue is not fixed yet

Screen.Recording.2026-02-25.at.8.01.49.pm.mov

@samranahm

Copy link
Copy Markdown
Contributor Author

@aimane-chnaif This is expected and match the behavior with categories/tags

@samranahm

Copy link
Copy Markdown
Contributor Author
Kapture.2026-02-26.at.01.07.36.mp4

@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: 24cc0c2c4b

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

Comment thread src/hooks/useExportedToFilterOptions.ts
Comment thread src/components/Search/SearchAutocompleteList.tsx
@samranahm

Copy link
Copy Markdown
Contributor Author

Resolving merge conflicts.

@samranahm

Copy link
Copy Markdown
Contributor Author

Please let me know if you have any other concern.

@aimane-chnaif aimane-chnaif 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.

Approving. Just fix conflict

@samranahm

Copy link
Copy Markdown
Contributor Author

@JS00001 All yours.

@JS00001 JS00001 merged commit a5d05ef into Expensify:main Feb 26, 2026
32 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 @JS00001 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/JS00001 in version: 9.3.27-0 🚀

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

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #83710 was identified to be related to this PR.

@OSBotify

OSBotify commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.3.27-8 🚀

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.

9 participants