Part 3 - Thread personalDetailsList through hasExpensifyGuidesEmails and currentUserLogin through isJoinRequestInAdminRoom#92502
Conversation
…ntUserLogin through isJoinRequestInAdminRoom Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
…ort param order Signed-off-by: krishna2323 <belivethatkg@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b40d2d960
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| const styles = useThemeStyles(); | ||
| const currentUserPersonalDetail = useCurrentUserPersonalDetails(); | ||
| const [reportOwnerPersonalDetail] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailByAccountIDSelector(report?.ownerAccountID)}); | ||
| const [personalDetailsList] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); |
There was a problem hiding this comment.
❌ PERF-11 (docs)
useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST) subscribes to the entire personal details collection without a selector. This component will re-render whenever any personal detail changes, even though the data is only used to compute a boolean via canCurrentUserOpenReport -> canAccessReport -> hasExpensifyGuidesEmails. Note that this component already has a narrowed subscription to the same key on line 89 (with personalDetailByAccountIDSelector), so the new broad subscription negates the benefit of the existing selector.
Consider using a selector that computes the boolean the component actually needs, or computing whether the report has Expensify guides participants directly in the selector. For example, if the report's participant account IDs are available, the selector could check only those IDs against the guides domain and return a boolean.
Reviewed at: 0903a05 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
| const [betas] = useOnyx(ONYXKEYS.BETAS); | ||
| const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${props.route.params.reportID}`); | ||
| const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); | ||
| const [personalDetailsList] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); |
There was a problem hiding this comment.
❌ PERF-11 (docs)
useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST) subscribes to the entire personal details collection without a selector. This HOC will re-render whenever any personal detail changes, even though personalDetailsList is only passed to canAccessReport to ultimately compute a boolean (hasExpensifyGuidesEmails). Since PERSONAL_DETAILS_LIST is a large, frequently-updated collection, this broad subscription can cause unnecessary re-renders.
Consider using a selector that narrows the data to what is actually needed, or computing the boolean result (hasExpensifyGuidesEmails) directly inside a selector if the report participant IDs are available at this point.
Reviewed at: 0903a05 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
| @@ -78,6 +78,7 @@ export default function (shouldRequireReportID = true): <TProps extends WithRepo | |||
| const [reportLoadingState] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${props.route.params.reportID}`); | |||
| const [isLoadingReportData] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); | |||
| const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); | |||
There was a problem hiding this comment.
❌ PERF-11 (docs)
useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST) subscribes to the entire personal details collection without a selector. This HOC will re-render whenever any personal detail changes, even though personalDetailsList is only passed to canAccessReport to ultimately compute a boolean (hasExpensifyGuidesEmails). Since PERSONAL_DETAILS_LIST is a large, frequently-updated collection, this broad subscription can cause unnecessary re-renders.
Consider using a selector that narrows the data to what is actually needed, or computing the boolean result (hasExpensifyGuidesEmails) directly inside a selector if the report participant IDs are available at this point.
Reviewed at: 0903a05 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
…ecks Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b54172a9a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…AccessedReport Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Explanation of Change
Fixed Issues
$ #66413
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
Verify that no errors appear in the JS console
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
Monosnap.screencast.2026-06-03.18-56-05.mp4