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] Cell actions cleanup + bug fixes #5592

Merged
merged 13 commits into from
Feb 8, 2022

Conversation

cee-chen
Copy link
Contributor

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

Summary

This PR is part cleanup and 2 separate bugfixes.

Cleanup:

  • (123f45b, dc95fe9) Rename any reference to "cell buttons" to "cell actions", as it's both more true to the API name, and more accurate since there can be multiple cell actions in addition to the cell expansion button
  • (75d8911) Remove unnecessary conditional CSS and DRY out duplicate expandButtonIcon/actionButtonIcon CSS

Bug 1: c1f3ce8 & 8d1d0aa

Setting both isExpandable: false and cellActions: [a, b, c] would not correctly disable/hide the cell expansion action button. 8d1d0aa fixes that behavior and conditionally renders the expand button only if isExpandable is true.

Bug 2: 969e3a2 & f8f1279

closes #4960

This is not a perfect fix to the linked issue, but I think it's most straightforward one. Cell actions will no longer perform the slide in animation when mousing out and back in to the cell when it's already been clicked. However, the tradeoff is that the cell actions show up instantly without a slide in animation if a user is really fast about hovering & immediately clicking into the cell (which is arguably still a better UX than the animation replaying on every hover).

after

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
- [ ] Added documentation
- [ ] Checked Code Sandbox works for any docs examples

- [ ] Checked for breaking changes and labeled appropriately
- [ ] Checked for accessibility including keyboard-only and screenreader modes

  • A changelog entry exists and is marked appropriately
  • Revert [REVERT] commit

- to be more specific and intentional about what we're referring to
- `__expandButtonIcon` is redundant with `__actionButtonIcon` - DRY it out and have the expand popover action use `__actionButtonIcon`

- isActive CSS is no longer used whatsoever - remove conditional CSS and need for `popoverIsOpen` prop

- Rename animation / last cellButton reference to cellActions
@cee-chen
Copy link
Contributor Author

cee-chen commented Feb 2, 2022

Argh, actually, 969e3a2 isn't a super great fix it looks like because now the animation is flickering every time the cell expansion button is clicked. This may need a more thorough JS fix after all. Investigating...

EDIT: f8f1279 should be the final fix - thankfully still CSS only.

@kibanamachine
Copy link

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

- remove `:hover:not(:focus)` in favor of simply having `:focus` disable animations, which lets us DRY out CSS with `.euiDataGridRowCell--open`

- add `:focus-within` catch that prevents flickering animation issue after cell popover expansion close

- (lint) remove unnecessary brackets around `euiDataGridRowCell--open` class
`border` in particular was causing the cell slide in animation to look wonky

- this is worth applying to all cell action button icons, not just the cell expansion popover, since it will also fix issues for custom actions that have `display="fill"`
@kibanamachine
Copy link

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

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.

Changes LGTM; tested the PR preview and confirm the changes are in place, and cannot break other UI interactions.

However, the tradeoff is that the cell actions show up instantly without a slide in animation if a user is really fast about hovering & immediately clicking into the cell (which is arguably still a better UX than the animation replaying on every hover)

💯 I think that's even better

I've added @miukimiu as a reviewer 'cuz that's too much CSS change for me to feel ok calling good

@cee-chen
Copy link
Contributor Author

cee-chen commented Feb 8, 2022

@miukimiu Just discovered that this affects my upcoming work for cell popover customization, so I'd super love to get this merged in sooner rather than later if possible! 🙇‍♀️

Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

Thanks, @constancecchen! LGTM! 🎉

Tested both fixes in Chrome, Firefox and Safari. I also looked at the SCSS changes.

@cee-chen
Copy link
Contributor Author

cee-chen commented Feb 8, 2022

Thanks a million!!!

@cee-chen cee-chen enabled auto-merge (squash) February 8, 2022 21:07
@kibanamachine
Copy link

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

@cee-chen cee-chen merged commit ae099d7 into elastic:main Feb 8, 2022
@cee-chen cee-chen deleted the datagrid/cell-button-actions branch February 8, 2022 22:03
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] Hovering over a highlightet cell starts button animation again
4 participants