-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiDataGrid] Add row height switcher to column #5080
Comments
For the design of this I would update the treatment as follows:
|
FWIW, Discover will need to add custom content to that popover. Specifically, a switch that applies the row height option to only their default view. That's product specific, so I think what I'm asking for is a means to add children form elements/content below the row height settings, like so: Note: don't take this screenshot as UI design guidance. I shared it only to demonstrate the need for additional content below the row height inputs Dave described above. |
@chandlerprall for the sake of clarity, and after the The remaining items are final review QA checks. Thanks! |
Hey @miukimiu! Do you mind taking a design pass on this from Dave and Ryan's comments? I'd like to start working on this but I'm a little confused on what it should look like (Dave's comment seems to suggest a dropdown or number input of some sort, whereas the existing screenshots suggest a button group). I'm also uncertain on the custom content/children requirement and would love to brainstorm that. |
I'm happy to provide any additional context, as needed. |
Hi @constancecchen , This is what it should look like if we all agree (Figma file):
@ryankeairns can you provide additional context? What is the "default view only"? From a design perspective the additional content could be restricted to a |
Default view in this case would be the display of the table when no columns are selected in discover (it's essentially a blob). In that format, you generally want the row height to be larger, and in the column view you want them to be smaller. I think possible we should just auto set that for users with a good default rather than giving them a toggle for it (which I think might be overly complex). Here was an alternative I had that might be a little easier to grok at first glance. It omits the "default view" stuff. Whichever way we go, I'd suggest using the words "Lines per row" rather than "number of rows" because it's a little more clear. Feel free to ignore or slant it @miukimiu or @ryankeairns. Just had some downtime. |
Apologies for the late reply! Having the default view 'auto-fit' makes sense although (not looking up how exactly that works) we'd want to insure it is capped since the Document field can be very long (does that initial blob cut off at 5 lines?). The 'max' issues is likely an implementation Kibana-side concern. There is some feedback supporting auto-fit / multi-lines per row as the default. Also, this is how it has long worked in Discover :) Anyway, back to the switch. This switch is rather Discover-specific, in my mind. You start with auto-fit / 5 lines in the default view and, upon adding a column, the data grid would change to 1 line per row. This switch determines whether or not the switch to a 1 line per row happens or if you retain the auto-fit or X lines per row setting. The preference here is less conclusive, thus the option. Maybe we set the switch question aside for the sake of this PR and just focus on the auto-fit / set number of lines per row UI. This is what I was implying by suggesting the possibility of adding children elements (i.e. let Discover decide what to do about the switch). |
Thanks y'all, I'm ++ to leaving off the custom content for now until we figure out exactly what we want from it. Also ++ to @snide's copy suggestion on "Lines per row" rather than "number of rows", agreed it's less confusing for me at least. Any thoughts or pushes as to which direction (@miukimiu or @snide)'s implementation I should go with? I will say that in Dave's first element, it wasn't clear to me that the number "3" was separate from the "autofit to content" action or that it would cause the number input to go away completely - I think I'd prefer more visual separation personally. |
@shaunmcgough and @timroes any thoughts on the switch? To this point, it seemed like something we wanted to provide as an option (to switch to a single line in the custom table state / after adding a column(s)). I think what that means here is the component (specifically the row height switcher UI) allows you to pass in child elements to the popover menu. @constancecchen +1 for a more distinct separation. Here is what I'm envisioning: |
@ryankeairns For me the component looks nice that way. I am just curious if we'll actually need that separate switch for "apply to default view only", since I am not 100% sure if users will really get what "default view" means. Or if we should just switch automatically to 1 line when a user switches to have configured columns and in case they remove the last one, back to our default for "default view", i.e. always have the user to configure it in whatever view they are in, without the ability to configure that it only applies for "default view". Also if the user would not be in default view anymore (i.e. has columns configured), would she still see that switch or would it now be "Apply to configured/current view only". In general I feel like this might cause more confusion for users than the benefits of it, and wonder if we should just try going without it for the beginning, and figure out if we're wanting to do that later if we're getting feedback from users, that it's annoying they need to "first configure columns (or not)" before setting the lines setting? |
Agree with this approach. Also 👍 to @ryankeairns' core design. |
Thanks Tim! I don't personally have any concerns with that approach either. Also, it's good for us to get into the habit of documenting our reasoning behind such decisions, so thanks for your take. For clarity's sake, the survey responses - while limited - did lean in the direction of applying the number of lines setting to both the default and custom (i.e. columns-added) view. I would have been more pro-switch if this were drastically flipped in the other direction. |
As per my comment in #5080 (comment):
So I agree with @timroes that users won't know what "default view" means and we should just try going without it for the beginning. For the design, I personally don't like toggle buttons when we have plenty of space inside the popover. I would go to something like this. But in case we all agree to go to what @ryankeairns is envisioning, I just noticed that we can't have the "auto" inside a number field. So we would need to keep the number disabled. Any of the options are fine for me. |
@miukimiu we could also switch the number input to a disabled text input, yeah? In this case, I feel the labels in the button group (from your comment) become less clear and their relationship to the input below it might be less strong. We may have used this pattern elsewhere but, in this case, it seems with the small number input we can fit it all on one line, keep the tighter label to input relationship, and benefit from a more action-oriented message on the button. |
Sounds good @ryankeairns! 👍🏽 @constancecchen we have a final design. |
Just want to double check something: does it sound right to everyone that the toolbar config should inherit the Also, the current mocks indicate the toolbar button should say "Row height of 3", but IIRC we're moving to "Lines per row" instead - any objection if I change the toolbar button text to |
@constancecchen sounds reasonable. |
@constancecchen Showcased the state of this configuration in our weekly where we talked about trying to combine this setting with the density setting as to not overload the toolbar with individual options. Here's a mock/prototype for how we could achieve this. I also updated the language and the "toggle" portion for this to be a bit more clear to the user what is going to happen. Static: |
Combining this with density feels related. I don't feel this new wording is as clear as the prior suggestion, however. If we're thinking of JSON documents, for example, wrapping is not the term that comes to mind. I personally prefer the Lines per row with Auto vs Number of lines toggle. |
I'm steering us away from using the terms We also encountered technical problems having only a single toggle and needed this third "Off" option to remove all wrapping and set it back to default single line truncation. I'm not 100% on "By line" but "Fit height" is also another well understood term and less ambiguous than "Auto". |
Perhaps we should loop in @gchaps or another docs team member to focus on the microcopy. I tend to like "Auto fit row height". We also likely could have inline or popup helper text here for some of these choices. Overall, this is going to be a real win and we are on the right track from a product perspective. |
Perhaps the label could be 'Row height' and the button group options are 'Single' 'Auto fit'/'Fit height' 'Custom' |
Just to check, should I also be moving the full-screen button and density/appearance button all the way over to the right as part of this work? I'm assuming I shouldn't be adding the |
@cchaos Just wanted to get your 2c on this - the current config for the toolbar's density toggle is called I'm thinking something like |
My guess is that const { showStyleSelector, showRowHeightsSelector } = this.props;
if (showStyleSelector || showRowHeightsSelector) {
render (
<EuiPopover button={iconButton}>
{showStyleSelector && styleSelector}
{showRowHeightsSelector && rowHeightsSelector}
</EuiPopover>
)
} |
Unfortunately we already have an API in place for a toolbar control that has multiple options in it, and that's not quite the syntax it uses: eui/src/components/datagrid/data_grid_types.ts Lines 580 to 589 in 788c822
My preference would be to follow a nested obj syntax like the above for more consistent configuration vs. 2 separate APIs. |
Sorry I'm not at all familiar with what exists today, so I'm purely basing my comment on the context provided in your question. My code was mostly an example of keeping the row heights selector and the density selector as two separate options that can be turned on/off individually. |
Right, we do want those still to be able to be turned off individually, but I also think it makes sense from a consumer standpoint to also be able to turn off the entire icon/control with just a single Just curious also, where should custom additional controls land in your above mock @cchaos? To the left of the columns/sort actions or to the right? |
I would think at some point we might want that to be configurable, but for now since it isn't, to the right. |
Sounds good! As a heads up that is a change from our current code, despite what our props description say it looks like we render custom additionalControls to the left of all other buttons 🤷 I'll update our props documentation as well when I'm doing this work! |
We discussed this briefly in our Discover sync yesterday and @snide suggested that it might make sense moving the row height toggle into EUI itself, since we might need this (in an aligned way) across different places in Kibana.
So we'd like to ask adding a row height switcher to the data grid, that looks similar to the following:
I think we need the following properties exposed on EUI to configure it from the outside:
initialRowHeight: 'auto' | 1 | 3 | 5
- to pass in which row height should be selected by default. I'd suggest we keep1
as default if it's not passed in.onRowHeightChanged(newVal: 'auto' | 1 | 3 | 5)
- to get notified if the user changes the row height, since we'll be storing this in Discover with the saved searchauto | 1 | 3 | 5
.cc @ryankeairns
The text was updated successfully, but these errors were encountered: