-
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
Context-menu repositioned #4194
Conversation
I guess this is me. I was hoping to have someone else give this an initial review. @roryabraham are you available to help ? |
@parasharrajat Are you able to add some benchmarks to the description? 🙏 |
I am not sure on How exactly we record that? but I'll try. I saw that you posted some stats on the issue, I'll take that as a reference. |
@marcaaron I can help review 😄 |
Also @parasharrajat conflicts |
1f141bf
to
baf1d29
Compare
Ok cool, let's skip my suggestion for now. It will add more complexity to what is already pretty complex changes. |
Testing is going really well @parasharrajat I have built the PR on Android in release mode and seeing a reduction in chat switching times of about 0.7 seconds. The metrics on dev are probably inflated a bit as release builds are more efficient in general but that is still a HUGE improvement. |
Yeah. Release build will be faster. |
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.
Changes look good to me. I'm gonna test this on web and iOS next, but maybe @roryabraham can do a last review. Let's get this merged!!
if (!props.isVisible) { | ||
return {isVisible: false}; | ||
} | ||
return null; |
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.
Ok, we can maybe try to improve this in a follow up I don't have a better suggestion at the moment.
}); | ||
} | ||
|
||
isActiveReportAction(actionID) { |
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.
Missing JS doc
if (!contextMenuRef.current) { | ||
return; | ||
} | ||
return contextMenuRef.current.hideDeleteModal(); |
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.
NAB, is there some reason we are returning this function?
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.
Sorry, It must have been left unintentionally. Only isActiveReportAction needs return value. I will update it.
Savings on iOS release builds are less significant, but still really good with an averages of 233 ms in my most recent test. |
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.
Looking better, only a few minor NAB code style comments at this point.
import {hideContextMenu, showDeleteModal} from './ReportActionContextMenu'; | ||
|
||
/** | ||
* Gets the markdown version of the message in an action. |
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.
NAB:
* Gets the markdown version of the message in an action. | |
* Gets the HTML version of the message in an action. |
* @param {Number} reportID - Active Report Id | ||
* @param {Object} reportAction - ReportAction for ContextMenu | ||
* @param {String} draftMessage - ReportAction Draftmessage | ||
* @param {Function} [onShow=() => {}] - Run a callback when Menu is shown |
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.
NAB this is weird:
* @param {Function} [onShow=() => {}] - Run a callback when Menu is shown | |
* @param {Function} [onShow] - Run a callback when Menu is shown |
* @param {Object} reportAction - ReportAction for ContextMenu | ||
* @param {String} draftMessage - ReportAction Draftmessage | ||
* @param {Function} [onShow=() => {}] - Run a callback when Menu is shown | ||
* @param {Function} [onHide=() => {}] - Run a callback when Menu is hidden |
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.
* @param {Function} [onHide=() => {}] - Run a callback when Menu is hidden | |
* @param {Function} [onHide] - Run a callback when Menu is hidden |
}); | ||
} | ||
|
||
runAfterContextMenuHide() { |
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.
NAB because both names are bad:
runAfterContextMenuHide() { | |
runAndResetOnPopoverHide() { |
|
||
// We use a combination of sequenceNumber and clientID in case the clientID are the same - which | ||
// shouldn't happen, but might be possible in some rare cases. | ||
// eslint-disable-next-line react/jsx-props-no-multi-spaces |
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.
bump – reasonably certain we don't need this eslint-disable
if (!props.isVisible) { | ||
return {isVisible: false}; | ||
} | ||
return null; |
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.
Would be good to leave a code comment explaining this.
|
bec3d56
Changes done. Please review. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
There's a problem with this PR on web. We need to remove this code I think as the method was renamed maybe? this.runAfterContextMenuHide = this.runAfterContextMenuHide.bind(this); |
#4297 for a fix. There is one more thing that is throwing a warning. |
🚀 Deployed to staging in version: 1.0.81-5🚀
|
🚀 Deployed to production in version: 1.0.82-7🚀
|
Details
Fixed Issues
$ fixes #4106
Tests | QA Steps
Tested On
Screenshots
I will update screenshots after the first code review.
Web
context.mp4
Mobile Web
Desktop
iOS
Android