-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: hide new marker for pending deleted action in online mode #33162
Conversation
@eVoloshchak 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] |
@ArekChr could you please help to review this as it is regression from a PR |
@@ -679,7 +679,7 @@ function ReportActionItem(props) { | |||
> | |||
{(hovered) => ( | |||
<View style={highlightedBackgroundColorIfNeeded}> | |||
{props.shouldDisplayNewMarker && <UnreadActionIndicator reportActionID={props.action.reportActionID} />} | |||
{props.shouldDisplayNewMarker && ReportActionsUtils.shouldShowNewMarker(props.action) && <UnreadActionIndicator reportActionID={props.action.reportActionID} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of here, can we add this logic in ReportActionsList component instead where we determine if we should display marker or not. Just to keep all logic at same place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, the new marker would be at the next message(if exists). Is this expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MonilBhavsar Can you please check the PR again? I moved the logic to ReportActionsList
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the best place to add IMO https://github.com/Expensify/App/pull/33162/files#diff-9ac76d645ad53156c86195c1a8f5adb3bb9b71f78351e43c4e1b6d6896921c4eR336
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MonilBhavsar
Can you please check if the link is correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was updated after merging main
https://github.com/Expensify/App/pull/33162/files#diff-9ac76d645ad53156c86195c1a8f5adb3bb9b71f78351e43c4e1b6d6896921c4eR351
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, unread marker would move to the next message(if exists) when deleting a message with unread marker. Is this an expected behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes expected!
Clarification: message should be from sender
@ArekChr could you also please take a look and help with checklist, thanks! |
@ArekChr is now not in C+ team, but developer role focusing on waves |
@MonilBhavsar - I think we need a new C+ for this. |
Can I be? |
Yes! @situchan please review. |
@s-alves10 please sync main as 2.3k commits are behind |
Will you take a look again? |
Please take a look at this comment #33162 (comment) |
I updated the logic as per #33162 (comment) |
@@ -350,7 +350,7 @@ function ReportActionsList({ | |||
if (!currentUnreadMarker) { | |||
const nextMessage = sortedReportActions[index + 1]; | |||
const isCurrentMessageUnread = isMessageUnread(reportAction, lastReadTimeRef.current); | |||
shouldDisplay = isCurrentMessageUnread && (!nextMessage || !isMessageUnread(nextMessage, lastReadTimeRef.current)); | |||
shouldDisplay = isCurrentMessageUnread && (!nextMessage || !isMessageUnread(nextMessage, lastReadTimeRef.current)) && !ReportActionsUtils.shouldHideNewMarker(reportAction); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
src/libs/ReportActionsUtils.ts
Outdated
return !isDeleted || isPending || isDeletedParentAction(reportAction) || isReversedTransaction(reportAction); | ||
} | ||
|
||
/** | ||
* Checks if the new marker should be shown for the report action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Checks if the new marker should be shown for the report action. | |
* Checks if the new marker should be hidden for the report action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
lint failing |
@s-alves10 the bug (#31637) is still reproducible on this branch Screen.Recording.2024-01-04.at.6.31.42.PM.mov |
The above bug was fixed. Will you check it again? |
Latest change looks good |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for the co0nversation with @MonilBhavsar to be finalized.
What does this mean? |
My mistake, I was looking at stale comments. |
✋ 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/tylerkaraszewski in version: 1.4.23-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.23-4 🚀
|
Details
Hide the delete pending actions
Fixed Issues
$ #33118
PROPOSAL: #33118 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
33118_android_native.mp4
Android: mWeb Chrome
33118_android_chrome.mp4
iOS: Native
33118_ios_native.mp4
iOS: mWeb Safari
33118_ios_safari.mp4
MacOS: Chrome / Safari
33118_mac_chrome.mp4
MacOS: Desktop
33118_mac_desktop.mp4