refactor: finalize Search router and delete legacy SearchList shell#95370
Conversation
…er-finalization # Conflicts: # tests/unit/Search/SearchUIUtilsTest.ts
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.
|
|
@ikevin127 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] |
|
@codex review |
|
@MelvinBot review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Review — LGTM ✅This is a well-scoped, behavior-preserving refactor. I traced the two behavioral-risk areas (the broadened router predicate and the exit-animation gate) and both hold up. No blocking issues. What I verified1. The broadened router predicate is correct. 2. Exit-animation behavior is preserved for invoice/trip. Legacy passed Other things I checked (all fine)
Optional nits (non-blocking)
Nice cleanup — |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-07-06.at.18.43.42.mov |
| /** Imperative handle for highlight-driven scrolling, set by the router. */ | ||
| ref?: ForwardedRef<SearchListHandle>; | ||
| }; | ||
| type ExpenseGroupedSearchViewProps = CommonSearchViewProps & {isAttendeesEnabledForMovingPolicy?: boolean; nonPersonalAndWorkspaceCards?: CardList}; |
There was a problem hiding this comment.
NIT: The extended props type CommonSearchViewProps & {isAttendeesEnabledForMovingPolicy?: boolean; nonPersonalAndWorkspaceCards?: CardList} is duplicated in both ExpenseFlatSearchView.tsx and ExpenseGroupedSearchView.tsx. I think we should extract a shared props in searchViewProps.ts
|
@BartekObudzinski please fill Tests section |
daledah
left a comment
There was a problem hiding this comment.
One minor nit about the duplicated but that's non-blocking. Code changes LGTM. Nice cleanup!
|
@daledah updated! |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Explanation of Change
This finalizes the Search list rendering refactor. Previously most search types rendered through a single large
SearchListcomponent backed by agetListItemfactory and one sharedrenderItemwith a wide prop bundle. Dedicated views composed directly overBaseSearchListwere already introduced for flat-expense, grouped-expense, chat, expense-report, and task.This change:
ExpenseFlatSearchViewandExpenseGroupedSearchView. Invoice and trip use the same row components (TransactionListItem/TransactionGroupListItem) and the samegetSectionsdata path as expense, so the router predicate is broadened fromtype === EXPENSEto "type is not chat, task, or expense-report", which matches howgetSectionsitself dispatches.shouldAnimate={type === CONST.SEARCH.DATA_TYPES.EXPENSE}gate.commonViewPropsobject spread across the five view invocations, removing the near-duplicate prop lists at the call sites.isTransactionMatchWithGroupItemfrom the deleted component intoSearchUIUtils.SearchListcomponent, thegetListItemfactory, and the sharedrenderItem.BaseSearchListis intentionally KEPT: it is the shared FlashList layer that every view renders directly.isTransactionMatchWithGroupItemmoving files. This is net zero: the deleted component's entry is removed andSearchUIUtilsincreases by the same count.Result:
<Search>is now a pure router over the five dedicated views, with no shared list component. Behavior is preserved for every search type.Fixed Issues
$ #95380
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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
Screen.Recording.2026-07-06.at.12.51.20.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-07-06.at.12.45.24.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-07-06.at.12.37.54.mov