Skip to content

Persist filters across view in Search - #96466

Merged
JS00001 merged 162 commits into
Expensify:mainfrom
bernhardoj:feat/95976-persist-filters-across-search
Sep 10, 2026
Merged

JS00001 merged 162 commits into
Expensify:mainfrom
bernhardoj:feat/95976-persist-filters-across-search

Conversation

@bernhardoj

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #95976
PROPOSAL:

Tests

Same as QA Steps

  • Verify that no errors appear in the JS console

Offline tests

Same as QA Steps

QA Steps

  1. Open Spend > select any suggested/saved search that has default filter bars (for example,
  2. Verify the default filter bars don't have "X" button and there is no "Reset" button yet
  3. Apply any other filter (except Type)
  4. Verify the new filter has an "X" button and the "Reset" button appears
  5. Verify the selected suggested search is still highlighted
  6. Switch to another suggested/saved search
  7. Switch back to the previous suggested/saved search
  8. Verify the previous last filters applied are restored
  9. Press the "Reset" button
  10. Verify the filters are reset back to their default state

Make sure it works with saved search too. Please test adding and deleting saved search too.

  • 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 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 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)
  • 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.
  • 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

@bernhardoj
bernhardoj requested review from a team as code owners July 20, 2026 10:03
@melvin-bot

melvin-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

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

@melvin-bot
melvin-bot Bot requested review from a team and JS00001 and removed request for a team July 20, 2026 10:03
@melvin-bot

melvin-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

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

@melvin-bot
melvin-bot Bot requested a review from JS00001 September 10, 2026 09:28
@trjExpensify

Copy link
Copy Markdown
Contributor

Is this bug or expected? After reset on saved search, columns (saved on the top of saved search) still remaining

bug.mov

Yeah, I think this is expected. In the vid you reset the filters, but not the columns. The button for that is inside the columns selector.

@JS00001
JS00001 merged commit e1071f8 into Expensify:main Sep 10, 2026
37 of 40 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.4.76-0 🚀

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

@MelvinBot

MelvinBot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Yes — help site changes were required. Draft PR: #100898

This PR changes behavior that three published articles described incorrectly:

Change in this PR Docs impact
Each search view keeps its own filters (nvp_searchFilters) Articles implied filters are lost when you navigate away
Clear replaced with Reset, shown only when filters differ from the view's defaults Button was undocumented
Default filters render first and have no x button Undocumented — likely support question ("why can't I remove this filter?")

Files updated in the docs PR:

  • docs/articles/new-expensify/reports-and-expenses/Getting-Started-with-the-Spend-Page.md — new ## How filters are saved for each Spend view and ## How to reset filters on a Spend view sections, two FAQ entries, and a screenshot placeholder for the filters bar.
  • docs/articles/new-expensify/reports-and-expenses/Use-Search-Shortcuts.md — each shortcut keeps its last filters; corrects the "Can I customize the search shortcuts?" FAQ, which said nothing about a shortcut could be changed.
  • docs/articles/new-expensify/reports-and-expenses/Using-Reports-in-New-Expensify.md — one line after the filter steps and one in the saved search section.
How the copy was verified

Labels were checked against the live UI on web, not inferred from the diff: the filters bar shows Filters, Display, Save, Create; applying a filter adds a pill with an x and a control labeled exactly Reset (matching common.reset in src/languages/en.ts:278 and SearchFiltersResetButton.tsx). The switch-away-and-back check could not be completed in the test session because a "Take a test drive" overlay blocked the sidebar, so that part of the copy is based on the PR and issue description — please confirm it.

Writing follows docs/HELP_AUTHORING_GUIDELINES.md (task-based ## headings, no new # headings), docs/HELPSITE_NAMING_CONVENTIONS.md (bold, sentence-case UI labels, no quotation marks), and docs/TEMPLATE.md.

@bernhardoj, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run · no recording available

@vincdargento

Copy link
Copy Markdown

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

@vincdargento

Copy link
Copy Markdown

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

@vincdargento

Copy link
Copy Markdown

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

@jponikarchuk

Copy link
Copy Markdown

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

@jponikarchuk

Copy link
Copy Markdown

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 9.4.76-1 🚀

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

Bundle Size Analysis (Sentry):

mukhrr added a commit to mukhrr/App that referenced this pull request Sep 14, 2026
Port "Edit filters" onto the savedSearchID model from Expensify#96466: drop previousHash, save edits under the existing id, highlight via setCurrentSearchKey, compare saved queries by hash in canSaveEditedView.
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.