Add debug option to LHN context menu#50519
Conversation
|
@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] |
|
I just pushed the changes you requested 😄 I did notice a possible bug during my refactor which I reported in
|
|
@pac-guerreiro Some left comments. Please help to check |
|
Nice catches once again 😄 Just pushed the changes you requested! |
|
Just added the missing equality check to memo! |
| // We only want to re-render when the report action that is attached to is changed | ||
| if (prevReportAction !== nextReportAction) { | ||
| return false; | ||
| } | ||
|
|
There was a problem hiding this comment.
@pac-guerreiro I am having trouble with this place. It seems lodashIsEqual(prevPropsWithoutReportActions, nextPropsWithoutReportActions); can't detect the different between prevReportAction and nextReportAction
There was a problem hiding this comment.
@pac-guerreiro note that we implemented a customized function instead of lodashIsEqual function only in memo
There was a problem hiding this comment.
I only want to make sure our change doesn't break any old behavior
There was a problem hiding this comment.
reportActions was injected into the component by withOnyx as a prop, but I removed withOnyx and reportActions is now returned by useOnyx, so it doesn't make sense to do this check anymore inside memo.
The component will be re-rendered if useOnyx is triggered by some change to reportActions, so I think the old behaviour should be the same
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-11.at.16.41.34.movAndroid: mWeb ChromeScreen.Recording.2024-10-11.at.16.39.30.moviOS: NativeScreen.Recording.2024-10-11.at.16.41.05.moviOS: mWeb SafariScreen.Recording.2024-10-11.at.16.36.25.movMacOS: Chrome / SafariScreen.Recording.2024-10-11.at.16.32.34.movMacOS: DesktopScreen.Recording.2024-10-11.at.16.35.27.mov |
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks great thanks. I like what you did cleaning up the shouldShow arguments!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.0.49-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.49-2 🚀
|
| const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, { | ||
| canEvict: false, | ||
| }); | ||
| const transactionID = ReportActionsUtils.getLinkedTransactionID(reportActionID, reportID); |
Details
Fixed Issues
$#46992
PROPOSAL:
Add option to debug a report from LHN context menu without triggering OpenReport API call. This way a user can debug the current state of the report without replacing it with the state from the API.
Tests
Offline tests
Same as tests
QA Steps
Same as tests
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
Android.-.Native.mp4
Android: mWeb Chrome
Android.-.Chrome.mp4
iOS: Native
iOS.-.Native.mp4
iOS: mWeb Safari
iOS.-.Safari.mp4
MacOS: Chrome / Safari
MacOS.-.Chrome.mp4
MacOS: Desktop
MacOS.-.Native.mp4