You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiDataGrid] How should the row height switcher toolbar control handle rowHeights overrides? #5411
[...] when the user selects an option, change it for all the rows even the very specifically set by index ones [or] If the setting seems to be completely controlled/set by the consumer, or a selection can't be determined, just hide it.
This is probably the easier option and probably aligns more with the consumer's intention. If they're explicitly setting row heights for individual rows, then they probably don't expect the content to fit any other way.
If a consumer has deliberately chose specific heights for specific rows, my guess is they don't want the consumer to adjust the row heights at all.
As a user, if I chose to specifically set the row heights to single, and saw that row 2, 4, and 5 were the only ones not adjusting, I'd think there was a bug in the UI. So I'm more trying to find a solution that aligns the consumer's intent with the user's expectation. We can't truly know both, but we can predict by defaulting to specific outcomes and providing an "out".
CC @ryankeairns - any thoughts here? Does the Discover team have any plans on using both the new row height switcher and rowHeights overrides at the same time?
I’m more leaning into option 2. But I don’t see any problem with also allowing option 1.
By default, if a consumer passed rowHeights, the row height switcher toolbar would be disabled (option 2). But we can also allow consumers to override this (option 1).
We can assume that the consumer does not want their overrides to be overridden but there are some scenarios that users might want to override that. So in case, a consumer passed a rowHeights configuration we can give the option to override the default rowHeights configuration:
By default, if rowHeights exists the control is automatically disabled and an "Override default row height" switch appear.
Users can override that by switching on "Override default row height". Then when users select an option, all rows are overridden, even the very specific set by index ones.
By switching off "Override default row height", the state goes back to the rowHeights configuration set by the consumer.
As I've always understood the Discover use case, the consumer would set a default (i.e. suggested) row height and the user would be able to change it to their personal preference. The switch to 'override the default row height' feels unexpected to me.
If the consumer does not want the default to be overridden, then I would not expect to see any UI for Row height. In that way, perhaps it is a feature that the consumer chooses to expose/display or not.
Sorry to be clear, the switcher always overrides defaultHeight. This issue is about overriding specific rows heights, which is set by the rowHeights object config when the consumer wants (e.g.) row 2 to be 150px high (specific) but everything else to be 30px (default).
So in Elizabet's mocks should likely say "Override all row heights" not "Override default row height".
I think that switch works, but to be honest I'm more of a fan of reducing than I am of adding features for the sake of it. I'd be curious to hear what teams/consumers are even using the rowHeights config and why - I'm actually not even seeing any current usage in Kibana, and I'm curious who we implemented that for in the first place. To be honest, I think the row height switcher really negates most of the need for row-specific heights (since content and data is dynamic and going to display differently on each user's screen, presumably the user knows best what to set their row heights to).
@chandlerprall, do you have any context on where the impetus for rowHeights came from?
Thanks for clarifying. Yeah, I don't know of any specific use cases requiring the per-row settings and - barring any findings by others - would be in favor of minimizing further iteration given it's seemingly less common fit.
Just chatted a bit more with Chandler on rowHeights and found the reasoning for it! In the future, we plan to let users vertically drag to expand/contract individual rows to set their heights the same way we let users horizontally drag to expand/contract column widths. rowHeights is the API/object structure we will likely use at that point.
That upcoming functionality does raise a great question for the row height switcher: when individual rows have customizable/draggable heights, how should this row height switcher handle that? IMO, I still don't think it makes sense for the defaultHeight to override individual row height settings, but is there any way to make it clear that a specific row has a custom height set on it? And do we need to we make it clear on this toolbar control that it affects default heights only?
When trying to make a decision like this, I think about the most possible user flows. In this case there are two starting points, so here are what I consider the two main possible workflows.
Developer initiated default row heights.
User lands on the page with the DataGrid where the grid has been specifically laid out based on the contents.
User has a hard time reading the small text, so they increase the grid settings to "Expanded".
User sees an option for row height adjustment including "Auto fit" and "Single"
User expects clicking this will ensure all content is revealed or every line changes to only a single line visible
User adjust individual row heights.
The reason they did so is because the content was not fully visible on the rows they wanted to see.
Clicking around the grid interface, they find the display settings popover
User sees an option for row height adjustment including "Auto fit" and "Single"
User expects clicking this will ensure all content is revealed or every line changes to only a single line visible
Both user flows expect the same outcome which, in my mind, means that this is the optimal path. I'd truly advise against having to add another toggle just to enable/disable other controls. The UI can be "smart" enough to assume intent while also providing an "out". Which I would then say we could provide a button in the popover's footer to "Reset to defaults". This would return the grid to the consumer/engineer provided defaults (including density and any future display controls) without having to refresh the page.
So my suggestion summed up as tasks:
Density and row height controls always override engineer specifications if they're available to the user
Add a Reset to default button in the display controls popover that undos any changes the user made to the display selections
If the engineer does not want them to be overridden, they have to hide the control completely (this is content specific)
Activity
[PR feedback] Document recommendation for disabling row height switch…
[EuiDataGrid] Add rowHeightSwitcher logic + API change (#5372)
cee-chen commentedon Nov 24, 2021
CC @ryankeairns - any thoughts here? Does the Discover team have any plans on using both the new row height switcher and
rowHeightsoverrides at the same time?elizabetdev commentedon Nov 25, 2021
@constancecchen here's my design ideia.
I’m more leaning into option 2. But I don’t see any problem with also allowing option 1.
By default, if a consumer passed
rowHeights, the row height switcher toolbar would be disabled (option 2). But we can also allow consumers to override this (option 1).We can assume that the consumer does not want their overrides to be overridden but there are some scenarios that users might want to override that. So in case, a consumer passed a
rowHeightsconfiguration we can give the option to override the defaultrowHeightsconfiguration:rowHeightsexists the control is automatically disabled and an "Override default row height" switch appear.rowHeightsconfiguration set by the consumer.Let me know what y'all think! 🧐
ryankeairns commentedon Nov 29, 2021
As I've always understood the Discover use case, the consumer would set a default (i.e. suggested) row height and the user would be able to change it to their personal preference. The switch to 'override the default row height' feels unexpected to me.
If the consumer does not want the default to be overridden, then I would not expect to see any UI for Row height. In that way, perhaps it is a feature that the consumer chooses to expose/display or not.
cee-chen commentedon Nov 29, 2021
Sorry to be clear, the switcher always overrides
defaultHeight. This issue is about overriding specific rows heights, which is set by therowHeightsobject config when the consumer wants (e.g.) row 2 to be 150px high (specific) but everything else to be 30px (default).So in Elizabet's mocks should likely say "Override all row heights" not "Override default row height".
I think that switch works, but to be honest I'm more of a fan of reducing than I am of adding features for the sake of it. I'd be curious to hear what teams/consumers are even using the
rowHeightsconfig and why - I'm actually not even seeing any current usage in Kibana, and I'm curious who we implemented that for in the first place. To be honest, I think the row height switcher really negates most of the need for row-specific heights (since content and data is dynamic and going to display differently on each user's screen, presumably the user knows best what to set their row heights to).@chandlerprall, do you have any context on where the impetus for
rowHeightscame from?ryankeairns commentedon Nov 29, 2021
Thanks for clarifying. Yeah, I don't know of any specific use cases requiring the per-row settings and - barring any findings by others - would be in favor of minimizing further iteration given it's seemingly less common fit.
cee-chen commentedon Nov 29, 2021
Just chatted a bit more with Chandler on
rowHeightsand found the reasoning for it! In the future, we plan to let users vertically drag to expand/contract individual rows to set their heights the same way we let users horizontally drag to expand/contract column widths.rowHeightsis the API/object structure we will likely use at that point.That upcoming functionality does raise a great question for the row height switcher: when individual rows have customizable/draggable heights, how should this row height switcher handle that? IMO, I still don't think it makes sense for the defaultHeight to override individual row height settings, but is there any way to make it clear that a specific row has a custom height set on it? And do we need to we make it clear on this toolbar control that it affects default heights only?
cc @cchaos into this convo as well!
cchaos commentedon Nov 30, 2021
When trying to make a decision like this, I think about the most possible user flows. In this case there are two starting points, so here are what I consider the two main possible workflows.
Both user flows expect the same outcome which, in my mind, means that this is the optimal path. I'd truly advise against having to add another toggle just to enable/disable other controls. The UI can be "smart" enough to assume intent while also providing an "out". Which I would then say we could provide a button in the popover's footer to "Reset to defaults". This would return the grid to the consumer/engineer provided defaults (including density and any future display controls) without having to refresh the page.
So my suggestion summed up as tasks:
Reset to defaultbutton in the display controls popover that undos any changes the user made to the display selectionscee-chen commentedon Dec 3, 2021
Closed by #5428