-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover] Truncate table header to 3 lines #171013
Conversation
1b472b0
to
0a8fc25
Compare
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
Thx a lot for this POC @mbondyra 🎉 , I've a question, would it be possible to limit the height of the table header to e.g. 3 lines and on top of that apply truncation? Thx |
@kertal it is possible and simple to implement if you want to apply truncation at the end of the string. IF you want to middle truncate in multi-line string, that's unfortunately not possible atm. |
0a8fc25
to
8425a64
Compare
8425a64
to
ffe11dd
Compare
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.
Looks and works great, thanks! We're going to discuss merging this early next week.
Hi @mbondyra, I'm testing it locally from a plugin that uses the with |
I think it's a good idea that we can show more header information, particularly useful for longer ECS fields, I only think that the Icons are taking up unneeded space on lines 2 and 3, and if that space could be filled with text would be more valuable. What do you think about making the Token Icon inline as suggested below, so we have more space to show the column header? |
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.
Could we include this feature as an optional property (i.e headerRowHeight
)in the <UnifiedDataTable/>
component and fallback it to 1, so plugins that use the Table (such as cloud_security_posture can opt for enabling that feature and also have more control over how much to truncate?
Usage suggestion (on Discovers page to apply the 3 row truncate):
<UnifiedDataTable
//...
headerRowHeight={3}
/>
Hi @opauloh!
No, that's a bug, thank you for finding it!
I like it, but I would like a designer's opinion too! @andreadelrio, could you let us know what you think?
Sure, that's a good idea, I'll add it 👌🏼 |
thx for the feedback @opauloh, I've a question. While those field tokens make sense in the Discover context (exploring the structure of the data, providing quick visual feedback about field types), I wonder if the are useful in the Security / Findings context, where I assume the type of the field might be redundant information? |
6b4dec8
to
15183ab
Compare
f1cb1ab
to
9468980
Compare
@davismcphee I added the inline icon! I also noticed I didn't update the timestamp column header so I added that too. For numeric columns, the text is aligned to the right and it looks weird, but if we want to wrap it to 3 lines, I don't see other option. |
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.
Working great overall, just about ready to merge!
For numeric columns, the text is aligned to the right and it looks weird, but if we want to wrap it to 3 lines, I don't see other option.
I played around with this a bit and found that if we use float: right
instead of text-align: right
it allows us to right align the header content but still have the text wrap from the left. I think this should solve the issue for us.
Since I made the changes in my local branch anyway, I figured I'd just open a PR against yours here: mbondyra#9. I was also going to leave a couple of other very minor nits, but figured since I was in here anyway I'd just take care of them too.
If you could take a sec to test and confirm that the change works, and merge it into this branch if it does, this PR will be all good to go on my end. Thanks for all the work on this!
Fyi: there are some updates coming to Eui data grid header #173569 |
[Discover] Improve numeric column text wrapping and some minor touchups
@jughosta thanks for the heads up! I'll wait for the eui update to be merged and test again. |
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.
Noooo, we were so close to being good to merge and now there's conflicts from the EUI upgrade 😢 But this is all ready to go on my end now, so once you get a chance to resolve the conflicts I'll do a super quick test again and click the approve button 👍
…/multiline_table # Conflicts: # packages/kbn-unified-data-table/src/components/__snapshots__/data_table_columns.test.tsx.snap # packages/kbn-unified-data-table/src/components/data_table.scss # packages/kbn-unified-data-table/src/components/data_table_columns.tsx
… into discover/multiline_table
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.
Tested one final time and it's still working as expected after the EUI upgrade 👍 The new three dots icon on hover causes things to look a little odd when the header text wraps since it shifts the text, but I don't think there's much we can do about that.
Thanks for the patience and all the work on this @mbondyra! Now quick, let's merge this before they change things on us again 😄
@andreadelrio @MichaelMarcialis if you could take a look too that would be great! |
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.
Design changes LGTM. Thanks @mbondyra !
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @mbondyra |
@mbondyra I use font size large on my chrome. Due to this i see the scrollbar appearing on the table header which is quite weird. Not sure if its a bug but should be checked from accessibility perspective |
Truncates table headers to 3 lines: