-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Tooltips: Support long labels #77735
Conversation
Hey, good job on this one! 🎉 While testing I noticed some things that were not covered:
|
Feedback: |
@adela-almasan This #2 point happened because it is a custom component. In trend tooltip case it's |
@Develer |
@adela-almasan got it, then I'll update that one also 👍🏻 |
Let's acknowledge that we are dealing with edge cases here, and rarely will there be a situation where both labels and values are super long. But it can happen. A few things to consider:
2 and 3 from above are a song of future improvements, so for now, we need to introduce some rules for the logic:
If 4 and 5 are hard to calculate or implement, than we should go back to responsiveness? :-) |
@@ -18,13 +14,18 @@ export const SeriesList = ({ series }: SeriesListProps) => { | |||
return ( | |||
<> | |||
{series.map((series, index) => { | |||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions | |||
const label = series.label as string; |
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.
Hi all! I have types clashing. The question is about the Trend tooltip. Do we really need SeriesList component? It looks totally replaceable by VizTooltipRow
component I implemented here.
I noticed that in SeriesList the label can be label?: React.ReactNode
type. Are there any scenarios we have to render ReactNode in a label instead of just a string?
Can we take a look at this part together?
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.
Hey! Context PR for the React.ReactNode
type - probably we'll get the chance to test more with complex cases with timeseries. I think SeriesList
looks like a wrapper for VizTooltipRow
now, so that should be fine - we can iterate depending on how things evolve.
@Develer I'm ok approving and merging if the approach (value on second row) is the one you and @lukasztyrala have discussed yesterday. I can't say it's my favorite, but we can obviously iterate. |
What is this feature?
This PR provide tooltip's long labels support.
Which issue(s) does this PR fix?:
Fixes #77247
Special notes for your reviewer:
Please check that: