[Discover] Add row height options#122087
Conversation
|
@elasticmachine merge upstream |
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
|
@elasticmachine merge upstream |
There was a problem hiding this comment.
Started testing and I'm excited that we will soon support this long awaited functionality in Discover. Sharing my thoughts while testing:
I think default Density should be normal, and we should add this value to local storage, so users don't have to reconfigure it every time. for me it looks a bit buggy when switching e.g. to Expanded in Safari (Chrome seems to be fine):

-
Via the URL I was able to configure invalid states like -1 , also 10000, so we need better validation here
-
There's a difference in the way what's being displayed when selecting
SingleorCustomset to 1

In the current way this is implemented we can't storesingle, since a given row height of 1 is automatically assumed to be a custom height of 1, asking @elastic/kibana-design for feedback if we should also supportsingle, in this case we would need to rethink the way we handle persistence in state and saved object.
if we would need to support single we could do it the following way mapping to integers
-1 : auto height
0: single
1: custom 1
2: custom 2
.....
src/plugins/discover/public/embeddable/saved_search_embeddable_component.tsx
Outdated
Show resolved
Hide resolved
I think given that |
@andreadelrio Yes, we should fix the mixtures of font-sizes. But I think we should stick to a single size, and that's the size that's being displayed when choosing compact. When I look at the expanded view, especially with the Document column the font size is very large compared to the rest of the page. @dmitriynj |
| name: i18n.translate('discover.advancedSettings.params.rowHeightTitle', { | ||
| defaultMessage: 'Maximum lines of document explorer cell', | ||
| }), |
| category: ['discover'], | ||
| description: i18n.translate('discover.advancedSettings.params.rowHeightText', { | ||
| defaultMessage: | ||
| 'The maximum lines that a cell in a table should occupy. Auto height might be enabled by setting value to -1. Single option could be enabled by setting value to 0.', |
There was a problem hiding this comment.
I'd suggest to change to
Displayed lines of a document explorer's cell. Auto height can be enabled by setting the value to -1. The explorer's single option can be enabled by setting value to 0.
FYI @gchaps
There was a problem hiding this comment.
@kertal In looking at other documents, the term "row height" seems to be appropriate here. It's also the word you use in the pop-up. Here is a suggestion:
Row height in the Document Explorer
The number of lines to allow in a row. A value of -1 automatically adjusts the row height to fit the contents. A value of 0 displays the content in a single line.
I'm a little confused over the term Single and whether it is the same as setting Custom to 1.
There was a problem hiding this comment.
@gchaps sounds good, yes "single". Thing is you can configure the height in the explorer to show just 1 line in 2 ways. Either you could choose Single or Custom with a height of 1. They look a bit different in terms of truncation, and work differently under the hood
I think we're ok to wait for both to be available. I'll make sure to follow up to have mine approved asap. |
…-height-options # Conflicts: # src/plugins/discover/public/application/context/context_app.test.tsx # src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx # src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx # src/plugins/discover/public/components/discover_grid/discover_grid.test.tsx # src/plugins/discover/public/components/discover_grid/discover_grid.tsx # src/plugins/discover/public/embeddable/saved_search_grid.tsx
|
@elasticmachine merge upstream |
|
@dmitriynj thanks for the updates, it is looking better. Wanted to check why content seems to be getting cut off when setting a custom # of lines? See below for the 3 lines case: |
I think I know why, when you disable the following in the browser it works: |
There was a problem hiding this comment.
Code LGTM, great work! Tested remote using Firefox, Safari, Edge, Chrome. Works as expected with the following limitations:
-
As mentioned in the description, once row height is changed locally, this state can't be overwritten by URL state, this should be fixed on EUI level
-
As discussed when showing the
Document columnwith a certain number of lines, the last line gets cut off, this will high likely be a CSS fix somewhere? @andreadelrio -
The reset to default makes no sense for our case, but that's also an EUI issue https://user-images.githubusercontent.com/463851/152003576-34d283c2-c413-44d8-8353-9ff2c554e244.mp4
-
And since we now display the loading state when loading a saved search, I encountered that when loading e.g. an e-commerce saved search followed by a flights saved search, when navigating back using the browsers
backbutton, the loading state is displayed twice and also data is requested twice ... one load is triggered because the index pattern of the url changes, the other because of the change of the saved search. It shows a weakness of our current state handling, shouldn't be a blocker, but we should improve it.
All in all, don't think any of this should block us from merging, but of course we should fix those issues. We want flags, cats, dogs with flexible height in the Document explorer!

|
I was looking at a CSS override for the line-height but I think a cleaner way to solve this is using EuiDataGrid settings, so I've set @kertal @dmitriynj let me know what you think and if there are any risks with this approach. |
ryankeairns
left a comment
There was a problem hiding this comment.
Since Andrea contributed, and I've verified locally, going ahead with an approval from design. This looks really nice, great work!
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: cc @dmitriynj |
|
@andreadelrio it's a nice solution, and no hack 👍 thx so much! |







Summary
Closes #109107
This PR adds ability to change row height options of
Document explorer.rowHeightusing toolbar, updating rowHeight from URL will not work.Priority for applying rowHeight
localStorage) or advanced setting (uiSettings)Checklist
Delete any items that are not applicable to this PR.