-
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
Table Component: Improve text-wrapping behavior of cells #82872
Table Component: Improve text-wrapping behavior of cells #82872
Conversation
I attach here a video before the fix, and other one with the final result applying the change. |
Cool. Do you know where to find this file on a installed Grafana under Linux (Ubuntu). I would like to change it right there with nano. Feasible? |
In my understanding, the file that needs to be changed is a TypeScript file that needs to be built or compiled. It is not directly used by grafana like a CSS file. |
@ahuarte47 thanks for another contribution! I'm going to test this out quickly but generally speaking this seems like a much better way to handle this scenario! |
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 ran through this and at least for the moment I'm unable to get this to work 😢. Did a commit get missed perhaps?
Sad of reading that, can I test a dashboard sample? maybe one from dev-dashboard package? My test for text-wrapping.json NOTE: |
Re-tested this and appears to be working fine, not sure exactly what I was doing 😕. It does get cut-off if the table is small enough, but we effectively already have that problem. We can address that as a follow-up PR. Thanks for the contribution! |
@ahuarte47 @codeincarnate I would not close and say this fixes #25623 , that would make a lot of people who voted for that issue upset . They are looking for text wrapping cells (not the hover effect) . But this should be a good improvement for those users (but not a complete fix) |
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.
3bc6d31
to
ef9d380
Compare
Please @codeincarnate @torkelo may I ask for your help to review again, thanks in advance! |
@ahuarte47 I'll be able to take a look this evening 😃 |
Gave it another run-through and it appears to be working fine in each case now. Missed the issue fix label before and very much agree this doesn't close that. Thanks there @torkelo 🙏 |
Thanks a lot @codeincarnate !!!! |
@ahuarte47 @codeincarnate this seems to have made it a bit worse for some scenarios, it always wraps and breaks up strings (even when there is no white space) So large values or single strings that would just extend a bit to the right are now broken up Text strings that where somewhat readable in narrow columns now become very hard to read. It seems the hover view is always using the same width as the cell, the whole point of the hover effect was to give the cell more room to show the value and not be constrained by the column width. |
I can create other PR with a new option in the ui table settings to enable this. Disabled by default. Do you agree? |
@ahuarte47 no I do want a UI option for this, can we make it so that it does not wrap until at the edge of the table? The old behavior was so much nicer, except part of it that goes beyond the right side of the table is not visible |
I can see the value of both cases, it's nice for cases with blobs of text but for longer strings it makes it more difficult to read. It may be possible to look at value length and determine from there. Agreed though that having this happen at table boundaries makes sense. I'll throw something together to see what can be done. |
Haven't quite finished it but testing out logic based around string length and seeing how it goes, not much at all right now as I'm mostly playing with it but progress will be in the just linked PR 😸 |
I like very much this simple but effective solution using the length of the text, thank you very much! |
Thanks @ahuarte47 🙏 A quick update, still working through the specifics but expecting to have PR out of draft today. |
* Fix text-wrapping of cells in Tables * Set wordbreak on hover for long texts without spaces
Made some updates to the mentioned PR, haven't quite gotten it working completely but I'm close and should be able to finish this one later 😄 |
* Fix text-wrapping of cells in Tables * Set wordbreak on hover for long texts without spaces
Is there a plan to allow a user to view headers that are too long in the table plugin? It seems weird that this would only be a feature for cells? |
What is this feature?
This PR fixes the visualization of strings in tables that do not fit the space of its cell. Full content is showed when user moves the cursor over the cell.
Why do we need this feature?
Long texts in cells are clipped if they do not fit the space if its cell. User can not view the full content of the string.
Who is this feature for?
[Add information on what kind of user the feature is for.]
Which issue(s) does this PR fix?:
It partially improves the issue #25623
Special notes for your reviewer:
Please check that: