Repository navigation
refactor: type date labels, state options, and account indicators - #103165
Conversation
…unt indicators Seatbelt-Operation: fresh-54053af7-sign-6824e9fc-fa97-471f-86fa-0e391484be1b
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Seatbelt-Operation: knip-54053af7-sign-5da5386e-1ae5-4b97-ac74-bbbeea894aa6
Seatbelt-Operation: c8b3925e-4ffe-4e2a-bd53-1fb27e3c250f
Seatbelt-Operation: main-20261030-103165-sign-888a6ca1-83f2-4fcd-9851-822a53ff892b
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15faf74637
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| createMock<OnyxMultiSetInput>({ | ||
| [ONYXKEYS.USER_WALLET]: {errors: {error: 'Wallet error'}}, | ||
| [ONYXKEYS.BANK_ACCOUNT_LIST]: { | ||
| // eslint-disable-next-line @typescript-eslint/naming-convention |
There was a problem hiding this comment.
Justify both new naming-convention suppressions
In the new multi-match test, both @typescript-eslint/naming-convention directives—here and on the login fixture—suppress the rule without an accompanying reason. AGENTS.md requires the app coding standards, whose CONSISTENCY-5 rule explicitly requires a justification because these suppressions hide violations from the seatbelt baseline. Add a brief explanation of why each fixture key requires this format, or avoid the suppressions.
AGENTS.md reference: AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in b13a722. Both new naming-convention suppressions now give their reason after -- on the same line, so eslint-disable-next-line still applies to the code below it.
Add a reason to the two naming-convention suppressions this PR added. Comments only. Addresses Expensify#103165 (comment) Seatbelt-Operation: repair-codex-103165-sign-628a2cdf-85b2-4ceb-9255-22d28c9062c0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
Seatbelt-Operation: merge-main-20261103-103165-sign-b1ae0e74-cabf-49f3-9529-454970d6cad4
|
@situchan Could you please take a look at this when you get a chance, Thanks! |
Resolve the useAccountIndicatorChecks.ts conflict by adding main's Wise more-info check to the ordered infoChecks list. Seatbelt-Operation: merge-main-20261106-103165-sign-117a7ae0-f535-487f-9c98-279c98d1581d
| const [rangeEphemeralValues, setRangeEphemeralValues] = useState<{ | ||
| from?: string; | ||
| to?: string; | ||
| }>(() => getRangeEphemeralValuesFromDateValues(normalizedDefaultDateValues)); |
There was a problem hiding this comment.
Any reason for reformatting?
There was a problem hiding this comment.
No reason. It was unintended. I reverted the line wrapping, so the only changes left in this file are the translation-key map and its two uses.
| const [loginList] = useOnyx(ONYXKEYS.LOGINS, { | ||
| selector: expensifyLoginsSelector, | ||
| }); |
There was a problem hiding this comment.
Reverted here too. I also reverted the same unintended wrapping in StateSelectorModal.tsx and in the existing test lines.
Address review: keep the existing single-line formatting so the diff only holds the real changes.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safaritest.mov |
|
Please fix react compiler check. It's failing |
Move the first-match lookup into getFirstMatchingStatus. Calling find on the local check list let the compiler drop the cache for every check, so they ran on each render. With the helper they stay cached, as on main.
|
Typecheck failing |
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 is a type-safety refactor that preserves existing behavior and labels, adds no user-facing feature, and makes no existing article sentence incorrect. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.37-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Use an explicit custom-date translation map, typed state values, and ordered account-indicator checks instead of unsafe assertions. Search date choices, State selection, and first-matching indicator priority are unchanged.
Changed files
src/components/Search/FilterComponents/DatePresetFilterBase.tsxsrc/components/StatePicker/StateSelectorModal.tsxsrc/hooks/useAccountIndicatorChecks.tstests/ui/DatePresetFilterBaseCustomDateModifiersTest.tsxtests/ui/StateSelectorModalTest.tsxtests/unit/useAccountIndicatorChecksTest.tsFixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
CI passed typecheck, ESLint, Oxfmt, spellcheck, React Compiler checks and Jest on this head.
DatePresetFilterBaseCustomDateModifiersTest,StateSelectorModalTestanduseAccountIndicatorChecksTestexercise the changed code.Use a build containing this PR and a signed-in ordinary test account. Run the supported product cases on Android native, Android Chrome, iOS native, iOS Safari, and macOS Chrome/Safari where each flow is available.
Search custom date
Start from Search with an expense query.
No additional manual case covers the State modal or account indicators because their behavior is unchanged.
StateSelectorModalTestcovers the 52 options, search order and pinned selection.useAccountIndicatorChecksTestcovers first-match priority, simultaneous matches and no-match results.Offline tests
N/A for an additional disconnect/reconnect case: this diff changes local date labels, State options, and indicator selection without changing a network request, persistence queue, retry, or reconnect path.
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 (3)
Search custom date desktop
PR-103165-C01-D.mp4
Search custom date phone-sized
PR-103165-C01-M.mp4
Recordings from earlier revisions
PR-103165-Chrome-QA-unmasked.mp4