Conversation
|
@s77rt Initial testing and performance comparison seems promising. Ready for your review. |
src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts
Outdated
Show resolved
Hide resolved
src/pages/home/ReportScreen.tsx
Outdated
| const parentReportSelector = (report: OnyxEntry<OnyxTypes.Report>): OnyxEntry<OnyxTypes.Report> => | ||
| report && { | ||
| type: report.type, | ||
| reportID: report.reportID, | ||
| parentReportID: report.parentReportID, | ||
| parentReportActionID: report.parentReportActionID, | ||
| }; | ||
|
|
There was a problem hiding this comment.
How did you choose this selector? As far as I can tell there is no indication on what fields we are using from parentReport
There was a problem hiding this comment.
I just deduced it from parentReport's usages and thought that might improve performance. But it's trivial anyway.
There was a problem hiding this comment.
I also saw a technique used for memoized report:
App/src/pages/home/ReportScreen.tsx
Lines 162 to 169 in a5989aa
I think we should apply to parentReport as well. Wdyt?
| if (!originalReportID || originalReportID === report.reportID) { | ||
| return; | ||
| } | ||
| const unsubscribeOnyx = onyxSubscribe({ |
There was a problem hiding this comment.
@s77rt Instead of using reportOrID approach, I used onyxSubscribe to conditionally subscribe to originalReportID, subscription with withOnyx will increase the re-render count 40 times 😱.
There was a problem hiding this comment.
Onyx.connect should not be used in components. Can you check for other options?
There was a problem hiding this comment.
Hmm but this is onyxSubscribe which I see was used a lot in components, for example ReportActionItemParentAction
There was a problem hiding this comment.
The usage there also does not follow our Onyx practices.
|
@gijoe0295 Any update on the use of |
| initialValue: null, | ||
| }, | ||
| adminChatReport: { | ||
| key: ({activePolicyID, policies}) => { |
There was a problem hiding this comment.
activePolicyID and policies won't be available here. They are populated after withOnyx. Let's use useOnyx and we can avoid such problem
| ); | ||
| } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_QUEUED) { | ||
| const linkedReport = ReportUtils.isChatThread(report) ? ReportUtils.getReport(report.parentReportID) : report; | ||
| const linkedReport = ReportUtils.isChatThread(report) ? parentReport : report; |
There was a problem hiding this comment.
Looks we can get ride of the parentReport. We only need 2 props from the parent
- reportID which can be replaced by report.parentReportID
- ownerAccountID write an util function for that
|
@gijoe0295 Any updates on this? |
|
@gijoe0295 What is the status of this PR? Can you please finish it up? |
|
After the changes in #41465, |
|
@gijoe0295 Any updates here? |
|
@gijoe0295 What can I do to help get this moving along? |

Details
Remove exported
getReport.Fixed Issues
$ #40316
PROPOSAL: #40316 (comment)
Tests
Offline tests
NA
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Screen.Recording.2024-04-22.at.03.19.21-source.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2024-04-22.at.02.57.34-source.mov
Screen.Recording.2024-04-22.at.03.00.55-source.mov
iOS: mWeb Safari
Screen.Recording.2024-04-22.at.03.02.27-source.mov
MacOS: Chrome / Safari
MacOS: Desktop
desktop.mov