-
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 Context menu with Pin option to LHN #16079
Conversation
OFF WIP! All yours @cead22 |
I revived this slack discussion because I'm not convinced this is a good change |
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 think we this PR should have the following tests, but I'm curious for your thoughts
- All uses of showContextMenu
- All uses of PressableWithSecondaryInteraction
- Deleting a report and make sure nothing breaks since hideDeleteModal changed
reviewing now |
These changes shouldn't have affected other menus, right? We can add a test to just make sure the new "Pin/Unpin" doesn't show for other menus, but I think it'd be enough to change in
Yep. This was a bigger one. Adding tests.
Where did it change? 😕 |
Conflicts solved AGAIN! |
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.
👍
✋ 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/cead22 in version: 1.3.23-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/cead22 in version: 1.3.23-0 🚀
|
|
||
React.useEffect(() => { | ||
ReportActionContextMenu.hideContextMenu(false); | ||
}, [optionItem.isPinned]); |
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.
@Gonals we should add null safety check on this line. Sometimes app crashes when logout because optionItem
is undefined returning here:
Lines 197 to 202 in 0813e2c
// When a user signs out, Onyx is cleared. Due to the lazy rendering with a virtual list, it's possible for | |
// this method to be called after the Onyx data has been cleared out. In that case, it's fine to do | |
// a null check here and return early. | |
if (!report || !personalDetails) { | |
return; | |
} |
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.
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.23-7 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.23-7 🚀
|
@@ -52,11 +55,16 @@ const defaultProps = { | |||
|
|||
const OptionRowLHN = (props) => { | |||
const optionItem = SidebarUtils.getOptionData(props.reportID); | |||
|
|||
React.useEffect(() => { |
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'm actually not seeing why this is necessary. I removed this and everything seems to work fine.
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.
That discussion started from here.
Finally landed on #16079 (comment)
I think that using |
{ | ||
textTranslateKey: 'common.unPin', | ||
icon: Expensicons.Pin, | ||
shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID, isPinnedChat) => type === CONTEXT_MENU_TYPES.REPORT && isPinnedChat, |
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.
Pin/UnPin options should not be visible on MoneyRequest chats as they are not pinnable. #20255
Minor miss in implementation - Pin/Unpin should have made the composer in focus - #21861 |
@abdulrahuman5196 how will this work on Mobile devices. So I don't agree that these unpin/pin should focus on the composer even on web. |
This case was not considered while implementing the context menu in Sidebar. Issue: Context menu from LHN is visible even if report page is opened on resize Steps to reproduce:
|
Details
Surrounding the existing TouchableOpacity with a PressableWithSecondaryInteraction component did not work on mobile, as the triggered touch event was the TouchableOpacity one, so I replaced the TouchableOpacity with the PressableWithSecondaryInteraction and gave it opacity capabilities. All working nice now!
Fixed Issues
$ #15960
Tests
Offline tests
Not relevant
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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