Fix long press on attachments not opening context menu#85044
Draft
Fix long press on attachments not opening context menu#85044
Conversation
The context provider value in PureReportActionItem used JavaScript shorthand property notation for shouldDisplayContextMenuValue, which created a property named 'shouldDisplayContextMenuValue' instead of the expected 'shouldDisplayContextMenu'. All consumers (ImageRenderer, VideoPlayerThumbnail, BaseAnchorForAttachmentsOnly, etc.) destructure 'shouldDisplayContextMenu' from the context and got undefined, causing their onLongPress handlers to return early. Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
Contributor
Author
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
7 tasks
Contributor
|
@MelvinBot please close this, I have already created here. |
Contributor
Author
|
Closing this PR as requested by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
PR #81807 introduced a new local variable
shouldDisplayContextMenuValueinPureReportActionItemto conditionally hide the context menu for Concierge greeting messages. When updating thecontextMenuStateValueuseMemo object, JavaScript shorthand property notation was used (shouldDisplayContextMenuValue,), which creates a property namedshouldDisplayContextMenuValueinstead of the expectedshouldDisplayContextMenu.All consumers of
ShowContextMenuStateContext(ImageRenderer, VideoPlayerThumbnail, BaseAnchorForAttachmentsOnly, PreRenderer, MentionUserRenderer) destructureshouldDisplayContextMenufrom the context and were gettingundefined. TheironLongPresshandlers checkif (!shouldDisplayContextMenu) { return; }, and since!undefined === true, they return early — preventing the context menu from ever appearing on attachment long press.This fix explicitly maps the local variable to the expected property name:
shouldDisplayContextMenu: shouldDisplayContextMenuValue.Fixed Issues
$ #85040
Tests
Offline tests
N/A - This is a UI interaction fix that does not depend on network state.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Android: Native
N/A - One-line logic fix, no visual changes. Restores existing behavior.
Android: mWeb Chrome
N/A - One-line logic fix, no visual changes.
iOS: Native
N/A - One-line logic fix, no visual changes. Restores existing behavior.
iOS: mWeb Safari
N/A - One-line logic fix, no visual changes.
MacOS: Chrome / Safari
N/A - One-line logic fix, no visual changes.