-
Notifications
You must be signed in to change notification settings - Fork 583
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
feat: Long-press artwork context menu for Android #11359
feat: Long-press artwork context menu for Android #11359
Conversation
87895ca
to
c44814b
Compare
<Box pr={2}> | ||
<RouterLink |
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.
Moving ContextMenuArtwork
inside RouterLink
so RouterLink's onPress
still works.
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.
kind of surprised it interferes since I thought it only listened for long press, but if it is necessary it is necessary
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've tried a few combinations, and having a TouchableHighlight
for the long press within the Touchable
component from palette-mobile for the normal press was the only combination that worked. 🤷
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.
thanks for explaining
`, | ||
}) | ||
|
||
describe("on Android", () => { |
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 was not able to test the context menu on iOS with react-native-context-menu-view
.
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.
You can try to mock the module with returning a View
as a ContextMenu
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 gave it a try, but it's not so easy to mock the ContextMenu
component because it's not only rendering children but also taking an array of actions to render and managing the long press behavior. So simply mocking it with View, unfortunately, doesn't give us anything to test :/
ccd90a0
to
9aea512
Compare
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.
looks good to me!
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.
small comment but nothing blocking 👏
<Box pr={2}> | ||
<RouterLink |
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.
thanks for explaining
} | ||
|
||
const artworkFragment = graphql` |
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.
nitpick: can we make this call when the context menu or the bottom sheet shows up to avoid calling this data when it's not required
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 could be something to try out! I will merge the PR as it is right now and give it a try to lazy load the data for the context menu on long press.
It might work but it could lead to issues with how the opening animation works for the context menu 🤔
`, | ||
}) | ||
|
||
describe("on Android", () => { |
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.
You can try to mock the module with returning a View
as a ContextMenu
f3ce05f
4e0d984
to
f3ce05f
Compare
This PR resolves ONYX-1474
Description
This implements the Artwork card long-press context menu for Android using a bottom sheet.
AREnableArtworkCardContextMenuAndroid
Screenshots
Android
iOS
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.