-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactor tooltip #14048
Refactor tooltip #14048
Conversation
@francoisl @mollfpr One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosWeb14048.-.Web.movMobile Web - Chrome14048.-.mWeb-Chrome.movMobile Web - Safari14048.-.mWeb-Safari.movDesktop14048.-.Desktop.moviOS14048.-.iOS.movAndroid14048.-.Android.mov |
@s77rt can you also add the action performed from the issue? We also should make sure that the initial issue is fixed. |
@mollfpr I didn't notice it was from the participant page, the issue was too old to remember but I used the context menu from the chat messages (both pages use |
Yeah, I'll do the video for the participant's page, we can keep your video as is. Just need to update the test case with the action performed on the issue. Also, give note that the web test should be using the Safari browser for that case. |
Added a note about Web to test on Safari. |
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.
LGTM 👍
The checklist is here
Regarding the latest commit we have agreed to remove the newly added feature |
Screen.Recording.2023-01-06.at.12.44.59.PM.mov@s77rt It's not a big issue but we can improve that by applying the following if you want index 580b8f9ab..aa7fbf232 100644
--- a/src/components/Modal/BaseModal.js
+++ b/src/components/Modal/BaseModal.js
@@ -92,6 +92,7 @@ class BaseModal extends PureComponent {
// eslint-disable-next-line react/jsx-props-no-multi-spaces
onBackButtonPress={this.props.onClose}
onModalWillShow={DomUtils.blurActiveElement}
+ onModalWillHide={DomUtils.blurActiveElement}
onModalShow={() => {
if (this.props.shouldSetModalVisibility) {
Modal.setModalVisibility(true); after Screen.Recording.2023-01-06.at.12.43.36.PM.mov |
@getusha Thanks, I'm aware of that, didn't add that because it's not required, the tooltip will always hide anyway |
Performance Comparison Report 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
I don't think the above is an issue, but confirming with @AndrewGable since he's been working on this new perf comparison report a lot and he's familiar with it. |
Discussed internally, this seems to be a known issue that's being worked on in #14074. Removing the blocker label. |
🚀 Deployed to staging by @francoisl in version: 1.2.50-6 🚀
|
🚀 Deployed to production by @Julesssss in version: 1.2.50-14 🚀
|
This PR caused a regression #14858 This was my fault here, and to my defence I got confused by the comment here App/src/libs/Navigation/NavigationRoot.js Line 32 in d42e443
|
I think this one is caused by this PR too #15271 |
// and it's tooltip will stay visible. | ||
// We blur the element manually to fix that (especially for Safari). | ||
// More info: https://github.com/Expensify/App/issues/13146 | ||
DomUtils.blurActiveElement(); |
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.
This can be a problem with this logic. For instance when the page is not changed on navigation. Normally, the navigation is handled by the framework, and clicking on links only changes the URL in the address bar without reloading the page.
This creates a possibility for an implementer to update the content of the page without changing the page.
If that happens, it will interfere with natural behavior. Thus this is dangerous. I always suggest restricting the impact of logic to a sufficient context. stateChange
fires literally every change in state which could be anything(not only navigation) and thus this action might cause regressions.
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.
Also, this change outdates the function name parseAndLogRoute
. We should update that to reflect the new logic.
cc: C+
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 think you are referencing to an outdated code, this has been moved to a better place #15249
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.
Just saw one regression from it #14048 (comment)
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.
Or does the new place also have the same effects? LMK I will check
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 think you are referencing to an outdated code,
Oops, I see.
IIRC, It was never being shown before, at some point we decided to show the tooltip on focus but caused a regression, turns out that regression is not from this PR but from RNW and we fixed that, so maybe we can bring back that feature again. |
Sorry, I didn't get it. Are you saying that we reverted the newly implemented behavior of this PR in some other PR due to regressions? But I can still see code changes of this PR on main. Can you please share links to the PR/regressions you are mentioning? It will help me understand better. |
Can we take this to Slack? I think it would be better to explain what went in this PR as there is a lot to say. A conversation may be better and faster. |
Sure. |
Opened a new discussion https://expensify.slack.com/archives/C01GTK53T8Q/p1678466671693099 |
I was reading about this PR and its issue. But there are a lot of discussions and It seems like the proposal was changed around 10 times to reach this solution. But still, I haven't got the full context of it. Can someone please help me with the following questions?
|
@parasharrajat initially we were hiding the tooltip by detecting Hope it helps 🙂 |
Thanks. So if |
I think my explanation above answers this.
Blur event only bubbles to elements that are focusable. |
@s77rt I read that. Do you have any example of Tooltip in our app where blur events were not bubbling? I want to test over it the new solutions we are working on. |
@parasharrajat Basically the reported ones on #12025 Screen.Recording.2022-10-20.at.1.44.47.AM.mov |
@francoisl @mollfpr
Details
Refactored the tooltips and achieved natural tooltip behaviour.
or focusFixed Issues
$ #13146
PROPOSAL: #13146 (comment)
Tests
Important: on Web, the test must be done on Safari (Chrome is already working fine).
Offline tests
n/a
QA Steps
Important: on Web, the test must be done on Safari (Chrome is already working fine).
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
web.mp4
Mobile Web - Chrome
mweb-chrome.mp4
Mobile Web - Safari
mweb-safari.mp4
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4