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
…ort-actions # Conflicts: # tests/unit/OnyxDerivedTest.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 react-native-onyx.RAM_ONLY_SORTED_REPORT_ACTIONSholds the sorted actions, the last action and the one-transaction thread ID of every report. OnyxDerived keeps it alive for the whole session: everyREPORTorNETWORKwrite re-sorts the actions of every report, and every report-action write rebuilds the maps, even though only Search, the Search router, Share and the option-list hooks read it and none of them is mounted during normal inbox use.This moves the per-report compute, unchanged, into a selector and rebuilds
useSortedReportActionsDataonuseOnyxStateover report actions, reports and NETWORK, reading the offline state the same way the config did. The 8 callers don't change. Each report's result is cached on its frozen actions object and reused while the report, its chat report, its transaction thread's actions and the offline state stay the same. The sort itself only reruns when the report's own actions change. When no report changed, the hook returns the previous object, so consumers that key caches on its reference (the option-list cache, the router warmer) keep their cached work. The hook reads the live store, as the derived value did, not the Search snapshot. The config, its key, its type, its RAM-only entry and the deprecated notes pointing at it are removed.One behaviour is now more correct: the engine's incremental path did not rebuild a parent report when only its transaction thread's actions changed, so its combined list stayed stale until the next full recompute. The selector rebuilds it, giving the same result as a full recompute.
A new reassure test runs unchanged on the base and on this branch over 3,000 reports with 10 actions each. Report and NETWORK writes no longer re-render the readers (11 renders before, 1 now). With the Search router mounted, a loop of report and NETWORK writes takes 440 ms instead of 1,070 ms, and with no Search surface mounted the write loop takes 930 ms instead of 1,630 ms, because nothing is sorted any more when nothing reads the value. Opening the router right after every action changed costs the same on both: the sort moves from the write to the mount.
Fixed Issues
$ https://github.com/callstack-internal/expensify-issues/issues/3082
PROPOSAL:
Tests
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