Fix reply in thread shows for thread parent#51721
Fix reply in thread shows for thread parent#51721neil-marcellini merged 14 commits intoExpensify:mainfrom
Conversation
|
@allgandalf 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] |
| return canDeleteTransaction(linkedReport); | ||
| if (!isEmptyObject(report) && (isMoneyRequestReport(report) || isInvoiceReport(report))) { | ||
| return canDeleteTransaction(report); | ||
| } |
There was a problem hiding this comment.
canDeleteReportAction is only being used in ContextMenuActions.
const linkedReport = isThreadFirstChat(reportAction, reportID) ? getReportOrDraftReport(report?.parentReportID) : report;
This logic was added in #40287 because the reportID of the thread parent message is the currently view report. But because the reportID now contains the reportID of the report action, we don't need this anymore.
There was a problem hiding this comment.
Makes sense, but can we please write a manual test that will verify this?
|
This will be the last usage of Lines 7205 to 7211 in a739661 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-11-08.at.3.35.56.PM.movAndroid: mWeb ChromeScreen.Recording.2024-11-08.at.3.34.40.PM.moviOS: NativeScreen.Recording.2024-11-08.at.3.43.00.PM.moviOS: mWeb SafariScreen.Recording.2024-11-08.at.3.44.34.PM.movMacOS: Chrome / SafariScreen.Recording.2024-11-08.at.1.40.12.PM.movMacOS: DesktopScreen.Recording.2024-11-08.at.3.22.21.PM.mov |
|
@bernhardoj apologies for the delayed review, can you please merge main ? |
|
Done |
allgandalf
left a comment
There was a problem hiding this comment.
Changes LGTM, this works well in offline mode too.
neil-marcellini
left a comment
There was a problem hiding this comment.
After seeing the code, I'm starting to think the proposal wasn't the best idea. I probably should have thought about it more carefully. I mostly have a lot of questions. The main question is, shouldn't we be able to determine if an action is a parent report action for a thread? If so, can we tweak the existing function to work reliably? Why or why not?
| return canDeleteTransaction(linkedReport); | ||
| if (!isEmptyObject(report) && (isMoneyRequestReport(report) || isInvoiceReport(report))) { | ||
| return canDeleteTransaction(report); | ||
| } |
There was a problem hiding this comment.
Makes sense, but can we please write a manual test that will verify this?
src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx
Outdated
Show resolved
Hide resolved
We can't tell if it's the thread first chat from the action alone. As seen in the function, we compare the action Lines 1594 to 1596 in c75b1bc What makes an action a thread first chat action? From the logic above, an action is a thread-first chat action if the action So, in my proposal, I think the better way is to mark an action as thread first chat in |
|
Note @neil-marcellini is OoO this week, I will raise the issue on slack to see if we should hold or add another internal reviewer :) |
|
I think this is low priority so we can wait until neil is back |
|
welcome back @neil-marcellini , would you be able to re-review the PR this week ? |
neil-marcellini
left a comment
There was a problem hiding this comment.
Ok thanks so much for explaining again. It's a pretty tricky and nuanced issue, and I agree with your reasoning that it's fragile and maybe confusing to pass a reportID into such a function. I don't like that we have to do so much parameter passing, but I guess it's the best way for now. There are still some outstanding issues to resolve but they should be pretty easy.
|
@neil-marcellini done |
neil-marcellini
left a comment
There was a problem hiding this comment.
Good to go, thanks!
|
✋ 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.66-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.66-8 🚀
|
Explanation of Change
A reply in the thread still shows for the parent thread message. This PR fixes it by passing isThreadFirstChat as param for every thread parent message.
Fixed Issues
$ #50262
PROPOSAL: #50262 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
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
android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4