Fix: do not display new line when creating request money.#32177
Fix: do not display new line when creating request money.#32177MonilBhavsar merged 9 commits intoExpensify:mainfrom teneeto:fix/29376-do-not-display-new-line-when-creating-request-money
Conversation
|
Assigning @Santhosh-Sellavel as C+ in the linked issue |
|
IMO, the logic should be diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js
index 6da3c1d34e..503da2e724 100644
--- a/src/pages/home/report/ReportActionsList.js
+++ b/src/pages/home/report/ReportActionsList.js
@@ -335,17 +335,14 @@ function ReportActionsList({
(reportAction, index) => {
let shouldDisplay = false;
if (!currentUnreadMarker) {
- // Check if the report type is "REPORTREVIEW" and last actor is the current user.
- // Return shouldDisplay new marker action (terminate flow).
- // This is to avoid displaying the new line marker when a current userrequests money.
- if (ReportActionsUtils.isReportPreviewAction(reportAction) && reportAction.childLastActorAccountID === Report.getCurrentUserAccountID()) {
- return shouldDisplay;
- }
const nextMessage = sortedReportActions[index + 1];
const isCurrentMessageUnread = isMessageUnread(reportAction, lastReadTimeRef.current);
shouldDisplay = isCurrentMessageUnread && (!nextMessage || !isMessageUnread(nextMessage, lastReadTimeRef.current));
if (!messageManuallyMarkedUnread) {
- shouldDisplay = shouldDisplay && reportAction.actorAccountID !== Report.getCurrentUserAccountID();
+ // Check if the report type is "REPORTREVIEW" and last actor is the current user.
+ // Return shouldDisplay new marker action (terminate flow).
+ // This is to avoid displaying the new line marker when a current user requests money.
+ shouldDisplay = shouldDisplay && ((ReportActionsUtils.isReportPreviewAction(reportAction) ? reportAction.childLastActorAccountID : reportAction.actorAccountID) !== Report.getCurrentUserAccountID());
}
if (shouldDisplay) {
cacheUnreadMarkers.set(report.reportID, reportAction.reportActionID);cc @gedu |
Also thought about it this way. But again, I was thinking that if we weren't going to show the new line marker for a particular message, then it's better to have returned early. In all I think this approach is safer. Thanks. |
|
There is a logic below to cache report action data for unread markers. I believe if we return early, we won't be caching that and would eventually lead to some inconsistency. |
…isplay-new-line-when-creating-request-money
…ing-request-money
|
Had a chat with @teneeto. One of the test case is failing where we're not displaying green line above REPORTPREVIEW actions. The issue is one of the hook here - is not trigerred because for Money requests, the report actions remains same and only child report's actions are added. We'll update the hook dependency toreport.lastVisibleActionCreated which is updated everytime a new action(Comment or IOU) is added/removed cc @gedu
|
|
@Santhosh-Sellavel this is ready for a review! |
|
Looks good |
|
I'll get to this tomorrow. |
|
@Santhosh-Sellavel if you could please prioritise this today, thanks! |
|
Tests Step 3 fails
, the green line is still displayed after requesting money Screen.Recording.2023-12-06.at.5.33.04.PM.movcc: @MonilBhavsar |
|
@Santhosh-Sellavel this is expected. If the green line is already there, it should persist. If it is not there, it should not show up. |
|
Cool can we update steps please it's bit confusing. |
|
Updated. Let me know if it is unclear, thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: Native & iOS: NativeScreen.Recording.2023-12-06.at.10.52.03.PM.movScreen.Recording.2023-12-06.at.10.55.54.PM.movAndroid: mWeb Chrome & iOS: mWeb SafarimWebs.movMacOS: Chrome / Safari & MacOS: DesktopScreen.Recording.2023-12-06.at.5.33.04.PM.movScreen.Recording.2023-12-06.at.8.40.52.PM.mov |
|
Step 7
Is this working as expected? @MonilBhavsar Screen.Recording.2023-12-06.at.11.23.32.PM.movDeleteCase.mov |
|
Yes, it is expected except marker is not sometimes going to next message and gets disappear. We are fixing that issue here #31714 |
|
Cool LGTM then, @MonilBhavsar I am AFK. Please review and merge 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/MonilBhavsar in version: 1.4.10-0 🚀
|
|
🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 1.4.10-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.10-1 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.10-1 🚀
|
Details
This PR seeks to fix the inconsistency between how the new line marker (green line) is displayed when a user requests money and when a user splits a bill.
When a user Splits a bill, the new line marker isn't displayed to the current user. It's different when a user requests money, the green line is displayed. The solution was to mute the green line when a viewing user requests money.
Also updates hook dependency #32177 (comment)
Fixed Issues
$: 29376
PROPOSAL: 16170
Tests
Clear the green marker on the chats
Clear the unread marker
Clear the unread marker
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
https://drive.google.com/file/d/1ACkFZPw-IdlnNmXtVh-O22g4MmKLQJH4/view?usp=sharing
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Screen.Recording.2023-11-29.at.14.40.56.mov
Android