Skip to content
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] Enforce visibleCellActions shown (overflowing extra actions to the cell popover) #5675

Merged
merged 6 commits into from
Mar 31, 2022

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Mar 2, 2022

Summary

closes #5132

Cell action buttons on the cell will only show a maximum number of actions on the cell (default limit is 2, but this is configurable via columns.visibleCellActions). The remaining items in the columns.cellActions array will only be displayed on the cell expansion popover, in a second column-style footer.

Screencap

screencap

QA

https://eui.elastic.co/pr_5675/#/tabular-content/data-grid-cell-popovers#cell-actions-and-cell-popovers

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in Chrome, Safari, Edge, and Firefox
- [ ] Props have proper autodocs and playground toggles

- [ ] Checked Code Sandbox works for any docs examples

  • Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@snide
Copy link
Contributor

snide commented Mar 2, 2022

Yes! This feels so tidy! Likely this will be a breaking change in Security, who made some hacks to make this work in the alerting view. We'll want to let them know it's coming.

cc @monina-n and @mdefazio on the design side as well.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5675/

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a small suggestion, but everything else looks good. Couldn't find any issues in the preview build, and those new tests are great!

src/components/datagrid/body/data_grid_cell.tsx Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@cchaos cchaos self-requested a review March 2, 2022 19:47
@chandlerprall
Copy link
Contributor

Approved, but let's hold off on merging until we can coordinate with the security folks as Dave mentioned (I've reached out to Andrew)

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5675/

@cchaos
Copy link
Contributor

cchaos commented Mar 3, 2022

Ok, I've just been doing some thinking around the design (mainly treatment of the buttons in the popover) aspect of this thing. The demos look great because everything is actually pretty lined up well based on the content chosen. But I have some concerns with the "raggedy-ness" that happens with stacks of centered buttons. Specifically:

image

A. Choosing more inconsistent labels showcases the ragged reading margins
B. If the consumer decides the first 2 primary aren't the paired ones, there's still a raggedness and the reading order odd
C. If we decide just to stack them all, both are even far more an issue
D. We could just stack it all and align them left (like our context menus). This one makes the most sense/easiest to provide but we do lose the nicety we get with being able to pair a common pattern of filter in/out.

So... with that, a solution could be:

image

E. Keep the first two in a row, but just left align the subsequent buttons.
F. But allow the consumer to ask to "stack" the primary actions.

@cee-chen
Copy link
Contributor Author

cee-chen commented Mar 3, 2022

E was indeed @mdefazio's original mock, but the buttons looked really weird in terms of click/hover areas with alignItems="flexStart":

screencap

It wasn't clear to me whether or not the buttons should have been intentionally full width or not, and the missing hitbox felt annoying to me UX-wise - I also thought centering looked less weird especially on cells with very long content - see below example:

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5675/

@cchaos
Copy link
Contributor

cchaos commented Mar 7, 2022

Yep, I agree with all your concerns, but I think the (un)readability of centered content outweighs them. My suggestion would be to use EuiContextMenuItems in place of EuiEmptyButtons. But it might require adding support for color.

@cee-chen
Copy link
Contributor Author

cee-chen commented Mar 7, 2022

My suggestion would be to use EuiContextMenuItems in place of EuiEmptyButtons

This would convolute our API/typing a ton unfortunately, since the way we handle cellActions is we tell consumers we're passing them a component that will either be an EuiButtonIcon (if on the cell) or an EuiButtonEmpty (if in the popover), and consumers render that component with whatever button props they want. At a glance there's a whole bunch of diffferent props between EuiButton* and EuiContextMenuIcon, so it would likely be a mess. it would be much simpler to customize the styling of the popover buttons to look more like what we want them to than change the underlying component.

For now I've simply added alignItems="flexStart" onto the secondary actions footer, feel free to play around with it

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5675/

@cchaos
Copy link
Contributor

cchaos commented Mar 8, 2022

I've pushed you a simple change to the buttons in which I wrap each button (primary and secondary) in a <div> so they don't expand within the flex items.

Reasoning:

These buttons are EuiEmptyButtons, so they don't have visible bounds unless they're focused. When they expand, they cause white space to be clickable (as shown in your gifs). While this seems off compared to our context menus, they are more likely to cause mis-clicks because of how wide the popover can get compared to the link text.

Restricting the button's interactive area to just the text/icon is less likely to cause mis-clicks and create intentionality.

The then lines of the left end of the primary and secondary buttons so we don't have the weird layout.

Examples:
Screen Shot 2022-03-08 at 14 16 19 PM
Screen Shot 2022-03-08 at 14 16 26 PM
Screen Shot 2022-03-08 at 14 16 49 PM

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5675/

@MikePaquette
Copy link

Sorry to join this conversation late, but I'm wondering if/why we need to enforce a maximum of 2 items to be displayed?

During the RAC project, as we adopted the EUI data grid for alert table use, we agreed that the EUI default display of two items made sense, but our understanding was that an optional addition of another item would be acceptable if the impact to the overall width was nominal and there was good justification from the use case perspective. Why are we now changing this at the expense of a breaking change to the security solution?

In the security solution, the ability to add any ECS field displayed in a cell to the currently active timeline investigative workspace is a key differentiator that allows both threat hunter and SIEM analyst personas to easily start or continue an investigation. By forcing users to perform another click of the overflow icon to add the item to a Timeline, we are reducing the discoverability of this key feature, and adding another click for each item they want to add to the timeline, which will decrease their velocity. This is in direct conflict with one of our primary objectives, which is to increase analyst velocity during investigations so that we can help them reduce their mean-time-to-detect MTTD and mean-time-to-respond MTTR metrics.

The security usage includes 3 items (we use 5 in our non-EUI tables) in the display today, which seems to widen the display only minimally, like this:
image

Can we please reconsider and revert the "enforce" nature of this PR so as to not negatively impact our security solution users, and/or not burden security solution developers with extra work to build an alternate solution?

cc: @monina-n @adamwdraper @paulewing @oatkiller @chandlerprall @snide

@snide
Copy link
Contributor

snide commented Mar 9, 2022

@MikePaquette I'm going to set up a zoom invite your way. There's no immediate hurry to merge this PR and we have time to talk it through.

@mchopda
Copy link

mchopda commented Mar 9, 2022

@snide @MikePaquette I am interested in knowing the summary of the zoom meeting as I agree limiting the cell actions may not satisfy security use cases.

@cchaos
Copy link
Contributor

cchaos commented Mar 9, 2022

This PR is simply the implementation from feature request that was submitted back in September 2021: #5132. The EUI issue was created after lengthy discussion between designers on the current UX implications of having too many cell actions. You can further trace discussions by checking out the linked issues in #5132. If there was a breakdown in communication between solution needs and design expectations, I suggest we table this PR (put it to draft) and I'd like to refer everyone back to the originating issue to continue discussion.

@snide
Copy link
Contributor

snide commented Mar 15, 2022

OK. I think we have a consolidated front from design, product and engineering on how to move this PR forward. I've written up some prop changes here #5132 (comment) which themselves came from discussion #5089 (reply in thread) .

Further. We've agreed to hold this PR to merge for two weeks until 8.2 feature freeze to give solution teams adequate time to make changes.

@constancecchen or anyone else on this thread feel free to bug me if those discussions and decisions are unclear. Otherwise I think we have a solid path to merge this tidy bit of code! Thanks for everyone's patience.

+ use a separate EuiPopoverFooter for remaining secondary actions
- Add alignStart=flex onto secondary popover actions
- Don't expand empty buttons
- prop clarity, organization, etc.
@cee-chen
Copy link
Contributor Author

New code with columns.visibleCellActions API has been pushed up and is ready for review. Screencap:

screencap

@cee-chen cee-chen marked this pull request as ready for review March 18, 2022 18:13
@cee-chen cee-chen changed the title [EuiDataGrid] Enforce a maximum of 2 cellActions shown (overflowing extra actions to the cell popover) [EuiDataGrid] Enforce visibleCellActions shown (overflowing extra actions to the cell popover) Mar 18, 2022
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5675/

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes LGTM; tested the column.visibleCellActions change in the preview docs and it works as expected

@cee-chen
Copy link
Contributor Author

Hey, just a quick ping to everyone who's commented on this PR so far. 8.2FF is tomorrow so I'll likely be merging this PR in sometime this week. Does anyone see any issues with the user or developer experience of https://eui.elastic.co/pr_5675/#/tabular-content/data-grid-cells-popovers#visible-cell-actions-and-cell-popovers? If so, please speak up sooner rather than later 😃

@cee-chen
Copy link
Contributor Author

Going to go ahead and merge this, as 8.2 FF is past.

@cee-chen cee-chen merged commit ff944d6 into elastic:main Mar 31, 2022
@cee-chen cee-chen deleted the datagrid/5132 branch March 31, 2022 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EuiDataGrid cellAction and expand popover
7 participants