Skip to content
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 data reference tooltips #47747

Merged
merged 2 commits into from
Sep 12, 2024
Merged

cleanup data reference tooltips #47747

merged 2 commits into from
Sep 12, 2024

Conversation

iethree
Copy link
Contributor

@iethree iethree commented Sep 6, 2024

discussion

Description

Before

Some short things get enormous tooltips

Screen Shot 2024-09-06 at 4 49 31 PM

Some long things don't get tooltips or ellipses at all

Screen Shot 2024-09-06 at 4 49 48 PM

After

Tooltips are a normal size, and long names get ellipsified properly

Screen Shot 2024-09-06 at 4 52 01 PM

There are still some cases where tooltips show up unnecessarily, but I didn't want to waste any more time on that.

Screen Shot 2024-09-06 at 4 47 01 PM

@metabase-bot metabase-bot bot added the .Team/AdminWebapp Admin and Webapp team label Sep 6, 2024
@@ -30,9 +31,7 @@ const ListItem = ({
</div>
<div className={S.itemBody}>
<div className={S.itemTitle}>
<ListItemName tooltip={name} tooltipMaxWidth="100%">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tooltipMaxWidth here was the biggest sin. I think with our old tooltip, this was based on the width of the container, and our new tooltips get appended to the body so the container is the screen width.

<ListItemName tooltip={name} tooltipMaxWidth="100%">
<h3>{name}</h3>
</ListItemName>
<Ellipsified tooltip={name}>{name}</Ellipsified>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I killed this styled component because it just made it all harder to reason about

@@ -30,9 +31,7 @@ const ListItem = ({
</div>
<div className={S.itemBody}>
<div className={S.itemTitle}>
<ListItemName tooltip={name} tooltipMaxWidth="100%">
<h3>{name}</h3>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nesting a component inside ellipsified prevented anything from actually getting an ellipsis

@iethree iethree requested a review from a team September 6, 2024 22:56
@iethree iethree added Type:Bug Product defects backport Automatically create PR on current release branch on merge labels Sep 6, 2024
@iethree iethree merged commit 10775a0 into master Sep 12, 2024
121 checks passed
@iethree iethree deleted the silly-tooltips-in-data-ref branch September 12, 2024 18:38
iethree added a commit that referenced this pull request Sep 12, 2024
* cleanup data reference tooltips

* update test
# Conflicts:
#	frontend/src/metabase/components/ListItem/ListItem.styled.tsx
iethree added a commit that referenced this pull request Sep 12, 2024
* cleanup data reference tooltips

* update test
@github-actions github-actions bot added this to the 0.50.26 milestone Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Automatically create PR on current release branch on merge .Team/AdminWebapp Admin and Webapp team Type:Bug Product defects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants