-
Notifications
You must be signed in to change notification settings - Fork 4.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
🪟 🧹 Cleanup Tooltip component usages #15789
Conversation
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.
Nice refactor! Just had a couple small questions but overall this looks good!
I tried it out locally and the tooltips/dropdowns look like they are working as expected
<Tooltip | ||
control={ | ||
<div className={styles.container}> | ||
<div className={styles.icon}> |
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.
Why have this intermediate div with its own styling that contains <InfoIcon>
, instead of just putting className={styles.icon}
on the <InfoIcon>
component directly? Can those positioning styles not be applied directly to SVGs or something like that?
flip(), | ||
shift(), | ||
], | ||
whileElementsMounted: autoUpdate, |
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.
Is this needed because you are now using a portal to place the tooltip on the document.body?
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.
Yes. Now it needs to move the tooltip when the user scrolls on the page.
<LineBlock> | ||
<FormattedMessage id="settings.accessManagement.roleEditors" /> | ||
</LineBlock> | ||
<InfoTooltip> |
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.
Nice abstraction 👍
@@ -81,11 +72,9 @@ export const PathPopout: React.FC<PathPopoutProps> = (props) => { | |||
placeholder={props.placeholder} | |||
components={props.isMulti ? { MultiValue: () => null } : undefined} | |||
targetComponent={({ onOpen }) => ( | |||
<div onClick={onOpen}> | |||
<PathPopoutButton items={props.isMulti ? props.path?.map(pathDisplayName) : props.path} onClick={onOpen}> |
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.
Nice refactor, this looks so much better in the UI now! I had thought those dropdowns looked bad for a long while now :)
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.
There's a new version of this table in the works, but I figured I give it a little ❤️ until we get there.
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.
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!
@@ -2,9 +2,9 @@ import React from "react"; | |||
import { useIntl } from "react-intl"; | |||
|
|||
import { Button } from "components"; | |||
import { Tooltip } from "components/base/Tooltip"; |
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 a thought: Should we rename base
to ui
?
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 like the idea: base
is really generic, to the point that it doesn't convey much at all except "some of this might get overridden, maybe". ui
would make it clearer to me what other components I could expect to find in that directory, which already seems like a win.
@dizel852 good catch on that. I wasn't sure what sass supported but missed the warning. |
c760b3e
to
cb93ab2
Compare
I can't review for some reason. But |
…e duplicate tooltip
Update ArrayOfObjectsEditor to render description with TooltipTable
cb93ab2
to
e7da1e6
Compare
@tealjulia I'm going to separate the a11y focus/blur changes because after giving it a try, it may take some iterations. |
* Temp rename tooltip folder to lowercase * Move Tooltip to components/base and rename to one word * Move InfoTooltip to base/Tooltip and eliminate redundancies * Fix cursor field and primary key dropdowns in the catalog tree, remove duplicate tooltip * Update ArraySection to show tooltip at the top Update ArrayOfObjectsEditor to render description with TooltipTable * Update InfoTooltip to SCSS, ensure that it's centered aligned * Ensure that Tooltips auto update on scroll * Add TooltipLearnMoreLink to Tooltip index and update imports * Fix InfoTooltip icon math in SCSS
What
Followup to #14581
This cleans up the tooltip naming and gets rid of redundant tooltips
components/base/Tooltip
ToolTip
withtooltip
as it's one wordbase/Tooltip
TooltipTable
and show tooltip at the top, as designedScreen.Recording.2022-08-19.at.08.54.25.mov
InfoTooltip
part ofbase
and fixes vertical alignment:How
Lots of renaming and moving things around replaced styled-components with SCSS.
One thing that was changed in the tooltip was to render it a portal in the body. This allows the tooltip to render correctly even in situations where a parent overflow may be set to
hidden
, which is what was causing the catalog tree tooltips not to appear. For this, thefloating-ui
needs autoUpdate.Recommended reading order
Tests