-
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
[HOLD for payment][$1000] Web - The popup menu overlaps the + icon on room #21809
Comments
Triggered auto assignment to @sakluger ( |
Bug0 Triage Checklist (Main S/O)
|
Dupe of #20198 |
This issue is about the position of popover over any chat when split bill is introduced when a user joins and and not about the fluctuating behaviour of popup menu. |
I agree with @priya-zha - this is a different popover (global-add vs in-chat-add) and also different behavior (the other issue is about switching between offline and online, this issue is about what happens when a new user joins a public room). |
Job added to Upwork: https://www.upwork.com/jobs/~01a5b67e57313ec40b |
Current assignee @sakluger is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The popup menu overlaps the + icon on room when menu items are dynamically added What is the root cause of that problem?
In PopoverWithMeasuredContent component, onLayout is called only after the first render. So the width and height are not calculated dynamically when contents are changed, and anchor position won't be changed as well.
This is the root cause What changes do you think we should make in order to solve the problem?We have to recalculate the width and height when contents are changed. Introducing a new state variable
Replace the below code
with
Replace the below code
with
Change the return part of the render function
This works as expected. Result21809.mp4What alternative solutions did you explore? (Optional) |
I've checked the above proposal, it solves the issue, but it also creates a bug, the popup glitches for a quick second, it's not visible in the above video, because of lower FPS of the video. Check this high FPS video, in which we can clearly see the glitch. popup-position-glitch.mp4Also the same result(as s-alves10's proposal) can be achieved by just adding the <Popover
// eslint-disable-next-line react/jsx-props-no-spreading
{...this.props}
anchorPosition={shiftedAnchorPosition}
>
+ <View onLayout={this.measurePopover}>
{this.props.children}
+ </View>
</Popover> edit: undo last edit |
📣 @ExGraviton! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Popup menu overlaps the plus icon(actions button) when the menu is dynamically changed after rendering. What is the root cause of that problem?The popup menu uses
App/src/components/PopoverWithMeasuredContent.js Lines 183 to 188 in 5997357
What changes do you think we should make in order to solve the problem?We can wrap the contents of <Popover
// eslint-disable-next-line react/jsx-props-no-spreading
{...this.props}
anchorPosition={shiftedAnchorPosition}
>
+ <View onLayout={this.measurePopover}>
{this.props.children}
+ </View>
</Popover> And move What alternative solutions did you explore? (Optional)Calculate the anchor position whenever the content changes. We can make the following changes in Add a new state variable { measuredChildren: null } Set state this.setState({isContentMeasured: true, measuredChildren: this.props.children}); } If return (
<>
{this.state.isContentMeasured && (
<Popover
// eslint-disable-next-line react/jsx-props-no-spreading
{...this.props}
anchorPosition={shiftedAnchorPosition}
>
{this.state.measuredChildren || this.props.children}
</Popover>
)}
{!_.isEqual(this.state.measuredChildren, this.props.children) && (
<View
style={styles.invisible}
onLayout={this.measurePopover}
>
{this.props.children}
</View>
)}
</>
); Result(alternate proposal)popup-position-fix.mp4The alternate proposal also solves the above mentioned glitch. |
@abdulrahuman5196 what do you think of the proposals so far? |
@s-alves10 From the proposal here #21809 (comment) But for the solution I wouldn't want to directly compare the children which is essentially a node and doesn't seem to be the optimised way. Maybe some other way of comparing? |
@ExGraviton I don't think we could consider the proposal here #21809 (comment) a valid new proposal, since it seems to be a minor optimization over the proposal here #21809 (comment) |
Hi @abdulrahuman5196, I also proposed that the same solution by just adding the
|
Yes. you're right, but However, we have some other ways as described here. I think 3rd method is preferred. Please let me know your thoughts |
@s-alves10 I am unable to understand what you are mentioning on the link? If it is better could you include the same in your proposal and ping? So that i can review again? |
@waterim 's solution was already discussed by other contributors. Changing anchor bottom or top isn't important here, I think. I really don't understand your decision. @abdulrahuman5196 |
@abdulrahuman5196 Given you have submitted an approval on a proposal already I will be unassigning myself here. Feel free to tag me if anything. Thanks! |
Change the anchor position alone didn't work as you had already pointed out in slack(Which was their first solution), but their latest proposal with combined approach of layout measurement solves the issue. And currently it is the simple and best available solution so far. On a side note: Regarding your proposal here #21809 (comment) , I am not aligned on the solution. Since it like we are trying to do solutions/workarounds to not directly compare children and also not aligned on the below point. Popover should be self-sufficient to re-align itself when its elements changes instead of parent providing the information.
|
Thank you for your explanation. I'm not saying my solution should be selected. The selected solution has the one difference:
Maybe. But the parent knows when we should remeasure the wrapper exactly. Anyway, I respect the decision. I wanted to say the review process should be fair. If the RCA is correct and the solutions are similar, I think the first proposal should be selected. |
Yes. I knew this already and pointed it out in slack as well. But without anchor position it is not working properly which i tested yesterday also. And the anchor position shift is not a minor change nor a PR level comment. So IMO the selected proposal can be considered a new proposal. |
I agree 👍 |
Just summarizing where we are - @waterim's PR is still in review, should get merged after a few more tests. The timeline is a bit funky on this one. @neil-marcellini approved the proposal on Aug 17, but there was already a draft PR on Aug 14. There won't be an efficiency bonus on this one, but given the complexity, there definitely shouldn't be a penalty either. |
@waterim is from callstack and agency PRs don't apply bonus/penalty timeline rule |
This issue has not been updated in over 15 days. @sakluger, @neil-marcellini, @waterim, @abdulrahuman5196 eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
@sakluger I think the payment is pending on this issue? |
Not regression
No. Minor case won't need any regression test |
Looks like the automation missed this GH issue. Thanks @abdulrahuman5196 for the bump in Slack. Summarizing payouts for this issue: Bug reporter: @priya-zha $250 (paid via Upwork) @waterim could you please share your Upwork profile so that I can send you an offer? |
@waterim is from callstack. No upwork |
@sakluger We can close this issue. |
Got it, thanks for clarifying! Closing out 👍 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The popup menu should not overlap the + icon on room when User B joins it
Actual Result:
The popup menu overlaps the + icon on room
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.33-3
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
green-2023-06-27_12.07.30.1.mp4
Recording.5211.mp4
Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687846865181099
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: