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
…ccount-id-map # Conflicts: # src/components/MoneyRequestConfirmationList/sections/AttendeeField.tsx # src/libs/actions/OnyxDerived/configs/loginToAccountIDMap.ts # tests/unit/OnyxDerived/loginToAccountIDMapTest.ts
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.
LOGIN_TO_ACCOUNT_ID_MAPis computed by OnyxDerived from one key,PERSONAL_DETAILS_LIST. The engine rebuilds the whole map on every personal-details write, writes it back into Onyx and to disk, and every write hands consumers a new object even when no login moved. One consumer isAttendeesCell, a Search row, so every row on the Search page re-renders on any personal-details write.This replaces the derived value with selectors over the live personal details list (not the Search snapshot), like the derived value read. The map keeps the config's rules: logins are lowercased, and when two accounts share a login a closed or optimistic one loses. It is cached per personal details list reference, so all rows mounted at once share one build per write instead of each row building its own.
AttendeesCellselects only the accountIDs of its own attendees, so a write that doesn't change them leaves the row alone.AttendeeFieldandMoneyRequestViewread the full map through a newuseLoginToAccountIDMaphook. The config, its key and its type 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 50 Search rows mounted. Ten renames of a user who attends none of the rows go from 11 row renders (256 ms) to 1 (17 ms), and with 5,000 more people in the list from 11 renders (244 ms) to 1 (32 ms). The whole write loop over the large list goes from 958 ms to 68 ms, because the engine no longer rebuilds and stores a 5,000-entry map on each write. When the account behind an attendee's login really changes, every row still re-renders on both, and the time is the same within noise.
Fixed Issues
$ https://github.com/callstack-internal/expensify-issues/issues/3075
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