-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add Mark as Read/Unread option to LHN Context menu #20254
Conversation
@0xmiroslav @luacmartins One of you needs to 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] |
Ready for review! iOS is still being a pain for me. @0xmiroslav, can you take a look? 😁 |
src/libs/actions/Report.js
Outdated
function markCommentAsUnread(reportID, reportActionCreated) { | ||
function markCommentAsUnread(reportID, reportActionCreated = '') { | ||
// If no action created date is provided, use the last action's | ||
const actionCreationTime = reportActionCreated || allReports[reportID].lastVisibleActionCreated; |
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.
reportActionCreated = ''
Do we need empty string as default value? This is always ignored in this condition: reportActionCreated ||
.
And for null safety, use lodashGet for allReports[reportID].lastVisibleActionCreated
.
And need to check if DateUtils.subtractMillisecondsFromDateTime(undefined, 1)
returns current time or any other weird value.
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.
Agree that we should use lodashGet
here and maybe default to the current timestamp if we can't find anything.
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.
I guess you are right. removed the default.
And need to check if DateUtils.subtractMillisecondsFromDateTime(undefined, 1) returns current time or any other weird value.
Current time!
src/libs/actions/Report.js
Outdated
function markCommentAsUnread(reportID, reportActionCreated) { | ||
function markCommentAsUnread(reportID, reportActionCreated = '') { | ||
// If no action created date is provided, use the last action's | ||
const actionCreationTime = reportActionCreated || allReports[reportID].lastVisibleActionCreated; |
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.
Agree that we should use lodashGet
here and maybe default to the current timestamp if we can't find anything.
Comments addressed! |
OFF HOLD and ready! |
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.
LGTM! @0xmiroslav all yours
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.
LGTM2. One minor thing:
src/languages/en.js
Outdated
@@ -266,6 +266,7 @@ export default { | |||
copyURLToClipboard: 'Copy URL to clipboard', | |||
copyEmailToClipboard: 'Copy email to clipboard', | |||
markAsUnread: 'Mark as unread', | |||
markAsRead: 'Mark as Read', |
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.
markAsRead: 'Mark as Read', | |
markAsRead: 'Mark as read', |
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.
ah nice catch. Yea let's address that @Gonals
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.
Done!
@Gonals just missing this comment |
Done! |
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.
LGTM
All yours @0xmiroslav |
Mark as unread doesn't work well in thread. This can be out of scope since same issue happens on unread button from mini context menu.
unread.indicator.bug.mov |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.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.
LGTM2!
We did not find an internal engineer to review this PR, trying to assign a random engineer to #20249... Please reach out for help on Slack if no one gets assigned! |
✋ 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/luacmartins in version: 1.3.29-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.29-11 🚀
|
Details
Fixed Issues
$ #20249
Tests
Mark as unread
option should show up. Press itUnread
read
Mark as Read
option (TheMark as Unread
one should be there).Offline tests
QA Steps
Same as tests
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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android