Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
fix: Show empty state instead of No results when default view hides all rows
…ard-list # Conflicts: # tests/unit/OnyxDerivedTest.tsx # tests/unit/pages/Search/SearchSavePageTest.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
This targets the Onyx store bump in Expensify#98956 and builds on the unmerged
useOnyxStatefrom the Onyx store work.PERSONAL_AND_WORKSPACE_CARD_LISTis computed by OnyxDerived fromCARD_LISTand everyWORKSPACE_CARDS_LISTfeed. The engine runs outside React and writes the merged list back into Onyx and to disk on every write to either key, even when its content is the same. Its consumers are all Search surfaces, and the ones with a selector rescan the whole list on every render.This replaces the derived value with a
usePersonalAndWorkspaceCardListhook onuseOnyxStateover the same two keys. The merge is the samemergeCardListWithWorkspaceFeedscall, keeping personal cards. It is memoized on the pair of inputs, so it runs once per write however many consumers are mounted, and a merge with the same content returns the previous object. The hook also keeps each selector's output per merged list, so consumers don't rescan an unchanged list. Neither key is redirected to the Search snapshot, so Search keeps reading live data. All 7 consumers use the hook. The config, its key and its type are removed. The persisted row is left on disk, as with theTODOSremoval.This is independent of the
NON_PERSONAL_AND_WORKSPACE_CARD_LISTmigration in #81 and does not stack on it. It repeats the same memoized merge helper and hook shape, so the two conflict trivially insrc/selectors/Card.ts, the Onyx jest mock and the card selector tests.A new reassure test runs unchanged on the base and on this branch, with
useSearchSections,useFilterFeedData,useFilterCardValueanduseAdvancedSearchFiltersmounted 3 times each. Render counts are the same in every scenario. With 9,000 cards, 10 writes that leave the merged list unchanged go from 133 ms to 19 ms of render time and from 733 ms to 330 ms for the whole write loop. Writes that really change the list are about the same.Fixed Issues
$ https://github.com/callstack-internal/expensify-issues/issues/3080
PROPOSAL:
Tests
card:in the search bar. Verify the autocomplete suggests your personal card and the workspace cards.Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari