Skip to content

[EuiDataGrid] How should the row height switcher toolbar control handle rowHeights overrides? #5411

Closed

Description

@cee-chen

Should the row heights switcher (state set by the user):

  1. Override the rowHeights overrides (state set by the consumer)?

  2. Or, should the control be automatically disabled if rowHeights exists (we assume that the consumer does not want their overrides to be overridden)?

See #5372 (review)

[...] 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".

Activity

  1. cee-chen commented on Nov 24, 2021

    @cee-chen
    ContributorAuthor

    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?

  2. elizabetdev commented on Nov 25, 2021

    @elizabetdev
    Contributor

    @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 rowHeights configuration we can give the option to override the default rowHeights configuration:

    Screenshot 2021-11-25 at 13 15 42

    • 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.

    Let me know what y'all think! 🧐

  3. ryankeairns commented on Nov 29, 2021

    @ryankeairns
    Contributor

    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.

  4. cee-chen commented on Nov 29, 2021

    @cee-chen
    ContributorAuthor

    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?

  5. ryankeairns commented on Nov 29, 2021

    @ryankeairns
    Contributor

    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.

  6. cee-chen commented on Nov 29, 2021

    @cee-chen
    ContributorAuthor

    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?

    cc @cchaos into this convo as well!

  7. cchaos commented on Nov 30, 2021

    @cchaos
    Contributor

    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.

    1. Developer initiated default row heights.
      1. User lands on the page with the DataGrid where the grid has been specifically laid out based on the contents.
      2. User has a hard time reading the small text, so they increase the grid settings to "Expanded".
      3. User sees an option for row height adjustment including "Auto fit" and "Single"
      4. User expects clicking this will ensure all content is revealed or every line changes to only a single line visible
    2. User adjust individual row heights.
      1. The reason they did so is because the content was not fully visible on the rows they wanted to see.
      2. Clicking around the grid interface, they find the display settings popover
      3. User sees an option for row height adjustment including "Auto fit" and "Single"
      4. 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)
  8. cee-chen commented on Dec 3, 2021

    @cee-chen
    ContributorAuthor

    Closed by #5428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions