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
…errors # Conflicts: # src/components/Tables/WorkspaceListTable/WorkspaceRowBrickRoadIndicator.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.CARD_FEED_ERRORSis computed by OnyxDerived from four keys: the card list, the workspace card lists, the domain card feeds and the current date. The engine runs outside React, writes the result back into Onyx and to disk, and every card write hands consumers a new object even when no error changed. Its consumers are mostly report-action items (expense previews, the expense view, the receipt view) and the workspace list rows, so one card write re-renders every one of them that is mounted.This moves the compute, unchanged, into a pure function and memoizes it on the four input references.
useCardFeedErrorsstays the single hook every consumer uses; it now reads the four keys withuseOnyxState, so one write computes once no matter how many consumers are mounted, and a write that leaves the errors equal keeps the old reference and re-renders nothing. The hook takes an optional selector, which the workspace list row uses to subscribe to its own workspace's RBR flag only. The current date stays a dependency and part of the memo key, because the 90-day grace-period checks read the clock. The config, its key, its type and the second copy of the default error state are removed. The persisted row is left on disk, as with theTODOSremoval.A new reassure test runs unchanged on the base and on this branch, with 10 expense previews and 20 workspace rows mounted. On 10 renames of a healthy card, the previews stop re-rendering (100 preview renders before, 0 now) and the renders take 22 ms instead of 35 ms. The whole write loop over 2,000 workspace cards goes from 265 ms to 150 ms. A write that really changes the errors costs the same on both. The commit count stays at 11 because other card-list subscriptions still re-render the tree on each card write.
Fixed Issues
$ https://github.com/callstack-internal/expensify-issues/issues/3076
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