Handle queries that use both a date preset and a custom range in Search filters UI#87972
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@shubham1206agra 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] |
JmillsExpensify
left a comment
There was a problem hiding this comment.
Agree with this change. LG to product
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-04-17.at.8.23.32.PM.mov |
|
NAB: It would be great if we can remove the old date filter from query altogether if possible. |
yeah, we talked about this under the issue, but decided to go for updating the dropdown button/popup UI for now instead. but we could revisit the approach of modifying the query, though preferably in a separate PR |
jasperhuangg
left a comment
There was a problem hiding this comment.
nice looks good! cc @neil-marcellini wanna give it a look?
|
🚧 @jasperhuangg 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.3.61-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This PR fixes internal logic for merging conflicting date constraints in |
Explanation of Change
When a raw query string combines a date preset (e.g. date:year-to-date) and also some explicit date constraints (e.g. date<=2026-04-30), buildFilterFormValuesFromQuery now resolves the preset to concrete dates and merges it with the explicit constraints into a single range. The UI enforces mutual exclusivity between presets and other date modifiers, but users can type any combination in the query bar and we also get those types of queries after clicking on a data point on a chart grouped by date/month/year. Additionally, when duplicate date bounds appear in a query the tighter bound is now kept instead of silently dropping one.
Fixed Issues
$ #86452
PROPOSAL: #86452 (comment)
Tests
type:expense date:last-12-months date>=2026-04-01 date<=2026-04-30. (adjust to use the current month, not necessarily April)Offline tests
N/A
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Nagranie.z.ekranu.2026-04-15.o.22.08.22.mov
Android: mWeb Chrome
Nagranie.z.ekranu.2026-04-15.o.22.05.49.mov
iOS: Native
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-15.at.22.14.57.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-04-15.o.22.03.54.mov