Repository navigation
Conversation
Use lightweight search data without replacing full category rules or optimistic state. Refs Expensify/Expensify#661264
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.
|
|
@Eskalifer1 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] |
|
Hi @ShridharGoel, let me know if you need my help |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5737f96fd5
ℹ️ 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".
|
@Eskalifer1 You can start reviewing whenever possible |
|
Oh, okay. If it's not urgent, I'll do the review tomorrow. Thanks for waiting! |
|
Hi @ShridharGoel, I wanted to ask if this is the expected behavior. If a user opens a page and immediately tries to enter a category from a non-default workspace in the search bar, nothing will be displayed. I understand that this is expected based on the code, since we load categories only after the filter has been opened, but perhaps this should be noted for the QA team? 2026-07-22.23.22.13.mov |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3dab42174
ℹ️ 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".
|
This seems like rather strange behavior. If a user has two workspaces with no categories but they are enabled, the filter itself will be displayed, but once the categories are loaded, the filter will simply disappear from the list. 2026-07-22.23.37.39.mov |
|
I'm not sure if we want to fix this, so I'd like to hear your thoughts on it. Here’s what I’m talking about (for the best demonstration, it’s best to be on a slow internet connection, such as 3G): A user has two workspaces, each with its own categories. If they try to load it for the first time but it fails (the request fails), only the categories from the default workspace will be displayed—as expected— but if they open the filter again later, additional categories will load, this time without any additional information (like a Loader), which cause some categories to simply appear out of nowhere. I think this is okay and not critical, given that it’s more of an edge case, but I’d like to hear your opinion, since you might have more context on this. 2026-07-22.23.45.27.mov |
|
This is also related to the search field, but in this case to the Suggestions. If a user has two workspaces (in my example, each workspace has only one category; the names make it clear which category belongs to which workspace) and they previously searched for both of them, after which the cache was cleared (or something else that caused the category data to be cleared), then when selecting this item from the Suggestions in the filter, only one value will be displayed—from the main workspace—even though the filtering logic actually applies to both categories. After that, if you open the filter, all categories will load, but the value in the filter will still not change 2026-07-23.00.01.44.mov |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp96460-android-native.movAndroid: mWeb Chrome96460-android-web.moviOS: HybridApp96460-ios-native.moviOS: mWeb Safari96460-ios-web.movMacOS: Chrome / Safari2026-07-27.17.20.45.mov |
|
Thanks for the detailed review.
@mountiny @JS00001 Do you know if we are okay with this behaviour? Else, we will need to have
Can you share how you reached this state? Looks like we can't have 0 categories if the categories feature is enabled (it doesn't allow deleting all the categories).
|
Hi @ShridharGoel! You need to disable the 2026-07-23.09.08.01.mov |
| function resetSearchFilterSyncState() { | ||
| lastSyncedQuerySignature = null; | ||
| } |
There was a problem hiding this comment.
Do we use resetSearchFilterSyncState only for test? It seems like a bad pattern
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f80e2fb27f
ℹ️ 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".
Remove the test-only sync reset helper and use the existing signature setter for test isolation.
Yeah it was done to handle an edge scenario but reverted it now. Should be fine. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62aaab104c
ℹ️ 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".
|
@Eskalifer1 We can continue with the review, thanks |
Eskalifer1
left a comment
There was a problem hiding this comment.
Okay, if we are ok to move forward with the current code than LGTM!
|
🎯 @Eskalifer1, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.4.46-0 🚀
|
|
🤖 I reviewed this PR against the help site articles under Why: This change is an internal data-loading optimization — it lazily loads lightweight category data (name + enabled state) from every workspace when the Category filter opens, so categories from non-default workspaces show up in the Spend filters. The diff touches only hooks, actions, The relevant help article — Getting-Started-with-the-Spend-Page.md — already describes the Category filter generically ("Available filters vary based on the selected Type") and never documents a per-workspace limitation. Nothing in the current docs contradicts the new behavior, so there is no claim to correct and no new workflow to add. The same is true for Use-Search-Operators-to-Filter-and-Analyze.md, which documents the @ShridharGoel, since no docs changes are required, there's no linked help site PR to review. If you'd like the article to explicitly call out that the Category filter now spans all of your workspaces, reply with |
|
This PR failing because of the issue #97456 |
|
I don't think this is a regression from our PR. I checked, and this bug is reproducible in production—and it only occurs in the mobile layout—so it's an existing bug, not one introduced by this PR. cc: @ShridharGoel |
|
Yeah, that's anyways not marked as a deploy blocker |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Payment issue created: #97539 |
Explanation of Change
Load lightweight category data for every workspace only when the Category filter opens. Merge it with full category data already stored in Onyx so category rules and optimistic updates remain unchanged.
This makes categories from non-default workspaces available in the Spend filters without increasing the initial Search response. Only the category name and enabled state are merged into the existing
policyCategories_collection to keep the response small.Companion Auth PR: https://github.com/Expensify/Auth/pull/23042
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/661264
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components using that component are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Designlabel or tagged@Expensify/designso the design team can review the changes.mainwas merged into this PR after review, I tested again and verified the expected outcome.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2026-07-21.at.12.52.57.AM.mov