Repository navigation
refactor: remove unsafe Search chart assertions - #100148
Conversation
Seatbelt-Operation: main-refresh-100148-20261014-latest-sign-ab3e633e
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Seatbelt-Operation: main-refresh-100148-20261014-26cd-sign-7843c99b
Resolve chart configuration and test conflicts. Seatbelt-Operation: legacy-100148-20261017-sign-b94722f6-8b54-48a9-b118-b62612803c91
Seatbelt-Operation: main-20261030-100148-sign-e5e98177-9804-4c3c-9e8b-34e2fd5f8c8e
Seatbelt-Operation: main-20261030-100148-empty-sign-52c543de-8ab1-466d-ae0b-84efa90688f7
Seatbelt-Operation: main-20261031-100148-100148-sign-951e6216-c98c-4cb0-a5af-ceeb9846e179
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required.
|
@situchan Could you please take a look at this when you get a chance, Thanks! |
Seatbelt-Operation: merge-main-20261106-100148-sign-d87f93e9-6445-4aea-8e31-027a6ab4f29c
| titleIconName: 'Users', | ||
| getLabel: (item: GroupedItem) => (item as TransactionMemberGroupListItemType).formattedFrom ?? '', | ||
| getFilterQuery: (item: GroupedItem) => `from:${(item as TransactionMemberGroupListItemType).accountID}`, | ||
| getLabel: (item: GroupedItem) => (item.groupedBy === CONST.SEARCH.GROUP_BY.FROM ? (item.formattedFrom ?? '') : ''), |
There was a problem hiding this comment.
The changes in this PR conflicts with #104927 on the chart config
Both PRs rewrite the same lines in chartGroupByConfig.ts and its test, in opposite ways.
#104927 replaces these groupedBy guards with 'x' in item checks, so whichever merges second conflicts and undoes the other.
App/src/components/Search/chartGroupByConfig.ts
Lines 38 to 68 in 3f5383c
App/src/components/Search/chartGroupByConfig.ts
Lines 48 to 77 in 5c3f8d5
There was a problem hiding this comment.
Resolved. #104927 no longer changes chartGroupByConfig.ts or its test, so this PR is the only one that touches them. It uses the groupedBy guard for each entry.
…company size Address review: getCountryCode has one signature that looks the value up in CONST.ALL_COUNTRIES and returns undefined for an unknown value, and normalizeCountryCode is one generic function, so the overloads, IntlStore.get overloads and translateCountry are gone. The chart change is left to Expensify#100148 and the companySize change moved to Expensify#106381. Tests now cover only the changed country behaviour.
|
Please merge main after all comments are resolved. Applies to all existing/upcoming PRs |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safaritest.mov |
|
@situchan Merged main. The new |
blimpich
left a comment
There was a problem hiding this comment.
LGTM
– written by Claude on Ben's behalf
|
🚧 blimpich 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/blimpich in version: 9.5.37-0 🚀
|
|
No help site update needed — this PR prevents crashes and invalid filters when chart data doesn’t match the selected grouping, without adding a feature, changing the expected workflow, or making existing article guidance incorrect. |
|
Deploy Blocker #106755 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.37-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Search charts check the expense group before reading labels or composing drilldown filters. Matching groups keep their existing values; mismatched groups return empty labels and queries, and missing optional labels still display as empty.
Intentional change: pressing a chart point from another group now adds no filter. In a time chart it previously crashed, and in other charts it added a filter built from
undefined.Changed files
src/components/Search/chartGroupByConfig.tstests/unit/Search/chartGroupByConfigTest.tsFixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
Upstream Jest passed.
npx jest tests/unit/Search/chartGroupByConfigTest.ts --runInBandcovers ten group types, mismatches, missing labels, date bounds and account ID zero.Platforms: Android native, Android mWeb Chrome, iOS native, iOS mWeb Safari and macOS Chrome/Safari.
Category drilldown
Setup: Use Expenses Search with an existing filter covering multiple categories.
Month drilldown
Setup: Use expenses spanning at least two months with an existing search filter.
Offline tests
No additional offline case: these guards read existing grouped items and compose labels and queries; network, cached-data and reconnect handling are unchanged.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Screenshots/Videos (8)
Category Bar desktop
PR-100148-C01-D.mp4
Category Bar phone-sized
PR-100148-C01-M.mp4
Month Line desktop
PR-100148-C02-D.mp4
Month Line phone-sized
PR-100148-C02-M.mp4
Merchant Pie desktop (extra evidence, no matching case)
PR-100148-C03-D.mp4
Merchant Pie phone-sized (extra evidence, no matching case)
PR-100148-C03-M.mp4
Earlier revision: Category Bar desktop
01-category-bar-desktop.mp4
Earlier revision: Month Line desktop
02-month-line-desktop.mp4