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

[tooltip] Reconsider tooltip min-width and label truncations #2048

Closed
Tracked by #169986
markov00 opened this issue May 23, 2023 · 5 comments · Fixed by #2261
Closed
Tracked by #169986

[tooltip] Reconsider tooltip min-width and label truncations #2048

markov00 opened this issue May 23, 2023 · 5 comments · Fixed by #2261
Assignees
Labels
enhancement New feature or request :tooltip Related to hover tooltip usability

Comments

@markov00
Copy link
Member

markov00 commented May 23, 2023

Is your feature request related to a problem? Please describe.
There are valid cases where longer labels are required to be displayed in their entirety.
Some of these cases are:

  • You can quickly understand from the structure of the label if the value refers to some sort of subcategory or not, for example when showing hierarchical path names like root.package.app.service.version
  • The right-hand side of the label is more important than the left-hand side

image

Describe the solution you'd like
The ideal path is to be always able to visualize the entire label on the tooltip but, as always, it depends on the length of it.
We can't represent a label that is as long as the current screen width (it will occlude too much in the current view), but is also true that we cannot limit too much the width and always truncate the label.
A trade-off should be considered.
We should also consider its effects on the legend (longer label on legend will shrink the chart)

Describe alternatives you've considered
The multi-line wrapping was already considered in the design but could increase the height of the tooltip too much depending on the number of lines to wrap every single text. The design idea was to wrap the text at a max 300px width.
Screenshot 2023-05-23 at 11 14 21

The beginning/middle truncation of text is an alternative option, but doesn't fully cover the extent of the problem and is a custom solution (we need to compute that manually because this type of text truncation is not available in HTML out of the box)

Additional context
This and other similar situations are examples of the need for a full extent tooltip width or a tooltip with a different truncation.

cc @gvnmagni

@markov00 markov00 added enhancement New feature or request :tooltip Related to hover tooltip labels May 23, 2023
@timductive
Copy link
Member

timductive commented Aug 1, 2023

Some more examples of where this is a problem.
image
image

@markov00 markov00 added the needs design A design pass is required and not available label Aug 25, 2023
@gvnmagni
Copy link

After a few conversations we decided that the optimal solution would be to provide these series of solution to our users.

  1. We should offer different ways of truncation that could be customized according to need. Users would be able to pick which option they prefer between begin, middle and end
  2. If no truncation is desired, tooltips could enlarge up until 500px of width and then break string into multiple lines

The following image shows these options in place. If there is anything that we missed please feel free to reach out so that we can include all we need in this update 😊

Frame 151

@gvnmagni gvnmagni removed the needs design A design pass is required and not available label Aug 28, 2023
@nickofthyme nickofthyme self-assigned this Nov 13, 2023
@teresaalvarezsoler
Copy link

hey @gvnmagni @markov00 we are looking to implement this with @mbondyra. Instead of making it configurable, I think a better solution will be to make it adjustable depending on the content:

When there are long values we could provide the solutions mentioned above:

  1. Auto-expand tooltip width up to 500px
  2. Multi-line up to say 2-3 lines and middle truncate afterwards
  3. Auto-expand tooltip height up to xxx px (it seems there is still space even in small screens) image

Btw, why when users right click do we make the tooltip shorter and narrower? Can we keep the original size? image

@mbondyra
Copy link
Contributor

@nickofthyme @markov00 this issue has been closed with my PR 🔝 but I am not sure if it should be as we were exploring different routes? Just asking to give it visibility.

@nickofthyme
Copy link
Collaborator

I think you were correct in closing this. I think we just open up a separate issue for addressing the label truncations described in #2048 (comment).

markov00 added a commit to elastic/kibana that referenced this issue Dec 7, 2023
## Summary

fix #171408
improves the style of tooltip by enlarging its size see
elastic/elastic-charts#2048
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Dec 7, 2023
## Summary

fix elastic#171408
improves the style of tooltip by enlarging its size see
elastic/elastic-charts#2048

(cherry picked from commit f684005)
kibanamachine added a commit to elastic/kibana that referenced this issue Dec 7, 2023
…172890)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Lens] Fix tooltip size and partition rerendering
(#172802)](#172802)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco
Vettorello","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-07T20:55:24Z","message":"[Lens]
Fix tooltip size and partition rerendering (#172802)\n\n##
Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/171408\r\nimproves the style of
tooltip by enlarging its size
see\r\nhttps://github.com/elastic/elastic-charts/issues/2048","sha":"f6840055d4c828787aab742ce082ab8911e8a5a9","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Visualizations","release_note:skip","backport:prev-minor","v8.12.0","v8.13.0"],"number":172802,"url":"https://github.com/elastic/kibana/pull/172802","mergeCommit":{"message":"[Lens]
Fix tooltip size and partition rerendering (#172802)\n\n##
Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/171408\r\nimproves the style of
tooltip by enlarging its size
see\r\nhttps://github.com/elastic/elastic-charts/issues/2048","sha":"f6840055d4c828787aab742ce082ab8911e8a5a9"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172802","number":172802,"mergeCommit":{"message":"[Lens]
Fix tooltip size and partition rerendering (#172802)\n\n##
Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/171408\r\nimproves the style of
tooltip by enlarging its size
see\r\nhttps://github.com/elastic/elastic-charts/issues/2048","sha":"f6840055d4c828787aab742ce082ab8911e8a5a9"}}]}]
BACKPORT-->

Co-authored-by: Marco Vettorello <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request :tooltip Related to hover tooltip usability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants