-
Notifications
You must be signed in to change notification settings - Fork 13.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
feat: smart tooltip in datasourcepanel #18080
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18080 +/- ##
==========================================
+ Coverage 66.23% 66.30% +0.06%
==========================================
Files 1594 1595 +1
Lines 62620 62630 +10
Branches 6310 6308 -2
==========================================
+ Hits 41479 41525 +46
+ Misses 19493 19454 -39
- Partials 1648 1651 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/testenv up |
@geido Ephemeral environment spinning up at http://54.202.172.219:8080. Credentials are |
superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.ts
Outdated
Show resolved
Hide resolved
/testenv up |
@geido Ephemeral environment spinning up at http://52.35.46.208:8080. Credentials are |
@zhaoyongjie One thing that I found weird was that when the text is not truncated and I hover a column, for example, I get the original column name but when the text is truncated I only get the verbose name. I was expecting to see both the original column name and the verbose name. This applies to both columns and metrics. |
Hi @michael-s-molina, If a column has a verbose name and it is un-truncated, it will show Currently, tooltip just show verbose name or database column name, not both. |
I think they are different information and both should be present. One thing is to see the original column name which is important and should always be visible. Another thing is to see the full truncated text which should display if the text gets truncated. Here's one example:
As the name will get truncated, the tooltip would display:
|
I know these different identifiers. Currently, only 1 name shown in the tooltip. let me list all the possibilities
Notice that long names will be truncated. The major discussion is 4. How to display tooltip when a column with a truncated verbose name. What do you think @geido @rusackas |
If I'm not mistaken (4) means you no longer have access to see the column name. I think we should indeed show the (non-truncated) verbose name AND the column name in the tooltip. This is weird, because it's not consistent. But, I don't think it's a good idea to hide information users might see as important. Another option I think I would prefer, is to make 3&4 consistent. This would mean showing the Verbose AND Column names in (3) and (4). For 3, the information is a bit redundant, but it at least establishes a regular pattern, so users don't have to think as much about what they're seeing as they go through the list. |
Nice method, I will update this PR for cases (3) and (4). Always showing verbose name and column name in the tooltip if column/metric has a verbose name. |
22ec75c
to
cc2b81c
Compare
@michael-s-molina @rusackas done this change. please review again. Thanks a lot. |
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 need to fix the typo and maybe revisit the tests descriptions to account for the latest changes.
superset-frontend/packages/superset-ui-chart-controls/test/components/labelUtils.test.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx
Outdated
Show resolved
Hide resolved
done, thanks for the review. |
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. Nice set of tests!
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
This PR intends to resolve 2 potential issues in the current Superset
column name
andmetric name
in the datapanel if defining a verbose name for these.can.t.show.column.name.mov
superset-frontend/src/explore/components/DatasourcePanel/index.tsx::LabelContainer
will re-render when we trigger from onMouseLeave or onMouseEnter event.This simple experiment can prove it.
rerender.in.datapanel.mov
closes: #13252
This PR removed some redundant logic to fix this.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After
default tooltip
default.tooltip.mov
add verbose name
show.verbose.and.original.column.mov
TESTING INSTRUCTIONS
(default) verify that
a) There is a tooltip on the
supersupersupersupersuper_long_column
b) There isn't a tooltip on the
short_column
c) There isn't a tooltip on the
count
d) there aren't tooltips when you scale datasouce-panel up.
verify verbose name name
a) tooltip will always appear column(metric) name and verbose name if you set verbose name in columns or metrics(except verbose truncated)
ADDITIONAL INFORMATION