Skip to content

[Payment due @Krishna2323] Add paginated tag filters with server-side search - #99831

Merged
JS00001 merged 67 commits into
Expensify:mainfrom
ShridharGoel:shridhar/paginated-tag-filters
Sep 22, 2026
Merged

JS00001 merged 67 commits into
Expensify:mainfrom
ShridharGoel:shridhar/paginated-tag-filters

Conversation

@ShridharGoel

@ShridharGoel ShridharGoel commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

This PR makes the tag filter show all the available tags via scrolling and searching options. Earlier, tags filter showed only a limited set of tags initially and the user had to scroll in the expenses list to load more expenses, after which more tags showed up in the tags filter.

We are now using a light-weight collection for storing the tags for the filter.

How it works:

  1. When you open the tag filter, the first 200 tags load
  2. When you scroll down, more tags load automatically
  3. When you type in the search box, the server finds matching tags
  4. A loading spinner shows at the bottom while more tags are loading

When the Tag filter shows:

  • The Tag filter option appears if any workspace has tags enabled

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/657334
PROPOSAL:

Tests

  1. Open the Search page
  2. Click on the Filters button
  3. Click on the Tag filter
  4. Verify tags load in the list
  5. Scroll to the bottom of the list
  6. Verify more tags load (infinite scroll)
  7. Type in the search input
  8. Verify tags are filtered by the search query
  9. Select a tag and verify it appears in the selected items
  10. Close and reopen the filter to verify selected tags persist
  • Verify that no errors appear in the JS console

Offline tests

  1. Open the Search page
  2. Click on the Filters button
  3. Click on the Tag filter
  4. Turn off network connection
  5. Verify the tag list shows previously loaded tags
  6. Verify scrolling does not load new tags (offline)

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 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
Screen.Recording.2026-08-30.at.8.48.20.PM.mov

@codecov

codecov Bot commented Aug 30, 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 93.22% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
...lterDropdowns/SearchAdvancedFiltersPopup/index.tsx 98.14% <ø> (-0.04%) ⬇️
src/components/SelectionList/BaseSelectionList.tsx 84.24% <100.00%> (+0.09%) ⬆️
src/hooks/useAdvancedSearchFilters.ts 97.29% <100.00%> (-0.21%) ⬇️
src/hooks/useFilterFormValues.tsx 100.00% <ø> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
src/libs/ExportOnyxState/common.ts 80.95% <ø> (ø)
src/libs/HttpUtils.ts 90.09% <100.00%> (+0.09%) ⬆️
src/libs/SearchQueryUtils.ts 89.25% <100.00%> (-0.06%) ⬇️
... and 7 more
... and 7 files with indirect coverage changes

@ShridharGoel
ShridharGoel marked this pull request as ready for review August 30, 2026 14:33
@ShridharGoel
ShridharGoel requested review from a team as code owners August 30, 2026 14:33
@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and grgia and removed request for a team August 30, 2026 14:33
@melvin-bot

melvin-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

@grgia 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: 2701438b95

ℹ️ 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/useSearchTagFilters.ts Resolved
Comment thread src/hooks/useSearchTagFilters.ts Resolved
Comment thread src/hooks/useSearchTagFilters.ts Resolved
Comment thread src/hooks/useSearchTagFilters.ts Resolved

@JmillsExpensify JmillsExpensify 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.

No product review required.

@MelvinBot

Copy link
Copy Markdown
Contributor

⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai.

Run details

Comment on lines +125 to +130
if (isOffline) {
// When offline, update the search query so TagSelector can filter cached results locally
setSearchTagFiltersPagination(false, '', query);
return;
}

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.

NAB. can the offline branch of searchTags keep stateRef.current.hasMore and nextCursor instead of false, ''?

For this edge case:

Open the tag filter in a workspace with more than 200 tags, go offline, type a letter and clear it, then go back online: only the first 200 tags stay, with no scrolling for more until you close and reopen the filter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks

grgia
grgia previously approved these changes Sep 22, 2026

@grgia grgia 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.

@JS00001

JS00001 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@ShridharGoel conflicts!

Preserve hasMore and nextCursor so reconnect does not treat partial results as a complete cache.
…g-filters

# Conflicts:
#	src/components/Search/FilterComponents/MultiSelect.tsx
@JS00001

JS00001 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

reviewing

Comment thread src/hooks/useSearchTagFilters.ts Resolved
Comment thread src/libs/actions/Search.ts Resolved
Comment thread src/libs/actions/Search.ts Resolved
@JS00001

JS00001 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

A few comments @ShridharGoel then, this is looking good

@JS00001

JS00001 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Lets :shipit: since @grgia & @Krishna2323 have already approved!

@JS00001
JS00001 merged commit e635f26 into Expensify:main Sep 22, 2026
36 of 38 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.92-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Yes — help site changes are required. Draft PR created: Docs updates for E/A#99831 Tag filter pagination and server-side tag search

What changed for members

This PR changes three things a member can observe in the Tag filter on the Spend page, and none of them were documented:

Behavior Before After
Which tags the Tag filter lists Only tags on expenses already loaded, so members had to scroll the expense list to make more tags appear Every tag they have access to — first 200 load, more load as you scroll
The filter's search box Matched only the partial, already-loaded set Searches all tags server-side
When the Tag filter row appears Only once tags actually existed Whenever any workspace has tags enabled, even with zero tags created
Code evidence

What the docs PR does

One file: docs/articles/new-expensify/reports-and-expenses/Getting-Started-with-the-Spend-Page.md, which owns the Filters workflow. It adds three ## sections under # Filters and adds tag-filter keywords to the article metadata:

  • How to find a tag using the Tag filter on the Spend page
  • How the Tag filter behaves offline
  • Why the Tag filter appears when you have no tags yet

I checked every other help site article that mentions tags or filters. None of them describe how the Tag filter loads its options, so no other files needed changes.

Labels and feature names (Spend, Filters, Tag, No tag, Workspace) were verified against src/languages/en.ts and src/libs/SearchUIUtils.ts. Browser control was unavailable in this run, so I could not confirm them against the live UI — please spot-check the labels when you review.


@ShridharGoel, 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

@jponikarchuk

Copy link
Copy Markdown

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/lakchote in version: 9.4.92-8 🚀

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

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #102152

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.

8 participants