[DRAFT] Remove useSearchTypeMenuSections from NavigationTabBar#82669
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| const savedSearchQuery = Object.values(savedSearches ?? {}).at(0)?.query; | ||
| const lastQueryFromOnyx = lastSearchParams?.queryJSON ? buildSearchQueryString(lastSearchParams.queryJSON) : undefined; | ||
| Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: lastQueryFromOnyx ?? defaultActionableSearchQuery ?? savedSearchQuery ?? buildCannedSearchQuery()})); | ||
| Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: lastQueryFromOnyx ?? savedSearchQuery ?? buildCannedSearchQuery()})); |
There was a problem hiding this comment.
With this change we'll no longer first navigate users to either Submit or Approve queries, no? That's a change in product behavior.
There was a problem hiding this comment.
Hey @luacmartins, thank you for the comment, you are right. I'm looking for a solution that will give us a performance boost and does not change any product behaviour.
There was a problem hiding this comment.
Thanks! What solutions are you exploring?
There was a problem hiding this comment.
@luacmartins I'm checking a new approach with a new hook useDefaultActionableSearchQuery, it will subscribe to only one Onyx key COLLECTION.POLICY with a lightweight selector that determines if the user has an Approve or Submit role. This eliminates 9 Onyx subscriptions, 5 sub-hooks, and the expensive createTypeMenuSections computation while preserving the same default Approve/Submit search behavior on the Reports tab.
|
Closing in favor of #82898 |
…-renders
Explanation of Change
Fixed Issues
$ #82416
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari