-
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
Fix LHN - Click and long pressing a user report with lots of messages opens popover inside report #27904
Closed
redpanda-bit
wants to merge
7
commits into
Expensify:main
from
redpanda-bit:fix/hold-to-show-popover-wrong-screen
Closed
Fix LHN - Click and long pressing a user report with lots of messages opens popover inside report #27904
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
95f187e
fix: left hand navigation row opens modal in wrong screen
redpanda-bit 719964d
test: add useFocusEffect to navigation mock
redpanda-bit cc87d7e
refactor: use hook instead of HOC for useWindowDimensions
redpanda-bit 3ce5f60
fix: use isSmallScreenWidth inside longpress callback instead of useF…
redpanda-bit 3dac180
fix: eslint rule no conditional hooks OptioRowLHN
redpanda-bit d2783d2
Merge branch 'main' into fix/hold-to-show-popover-wrong-screen
redpanda-bit 654aaa0
Merge branch 'Expensify:main' into fix/hold-to-show-popover-wrong-screen
redpanda-bit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,15 @@ function OptionRowLHN(props) { | |
const optionItem = props.optionItem; | ||
const [isContextMenuActive, setIsContextMenuActive] = useState(false); | ||
|
||
useFocusEffect( | ||
useCallback(() => { | ||
isFocusedRef.current = true; | ||
return () => { | ||
isFocusedRef.current = false; | ||
}; | ||
}, []), | ||
); | ||
|
||
if (!optionItem) { | ||
return null; | ||
} | ||
|
@@ -106,19 +115,8 @@ function OptionRowLHN(props) { | |
const hasBrickError = optionItem.brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR; | ||
const defaultSubscriptSize = optionItem.isExpenseRequest ? CONST.AVATAR_SIZE.SMALL_NORMAL : CONST.AVATAR_SIZE.DEFAULT; | ||
const shouldShowGreenDotIndicator = | ||
!hasBrickError && | ||
(optionItem.isUnreadWithMention || | ||
ReportUtils.isWaitingForIOUActionFromCurrentUser(optionItem) || | ||
(optionItem.isTaskReport && optionItem.isTaskAssignee && !optionItem.isCompletedTaskReport && !optionItem.isArchivedRoom)); | ||
!hasBrickError && (optionItem.isUnreadWithMention || optionItem.isWaitingForTaskCompleteFromAssignee || ReportUtils.isWaitingForIOUActionFromCurrentUser(optionItem)); | ||
|
||
useFocusEffect( | ||
useCallback(() => { | ||
isFocusedRef.current = true; | ||
return () => { | ||
isFocusedRef.current = false; | ||
}; | ||
}, []), | ||
); | ||
/** | ||
* Show the ReportActionContextMenu modal popover. | ||
* | ||
|
@@ -195,6 +193,7 @@ function OptionRowLHN(props) { | |
]} | ||
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON} | ||
accessibilityLabel={translate('accessibilityHints.navigatesToChat')} | ||
needsOffscreenAlphaCompositing={props.optionItem.icons.length >= 2} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
> | ||
<View style={sidebarInnerRowStyle}> | ||
<View style={[styles.flexRow, styles.alignItemsCenter]}> | ||
|
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.
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 did not introduced these changes! Is this normal on a merge workflow? This doesn't happen in rebase workflows.
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, I imagine something got messes up with the re-push. I'd recommend just moving your changes to a new branch fresh from
main
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.
😞 a lot of learnings, I tell you. Here is the new branch: https://github.com/redpanda-bit/Expensify-App/tree/fix/popover-showing.
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.
At this point, I think you can just create a PR for that branch and we'll close this one
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 new PR: #28614.