eui icon indicating copy to clipboard operation
eui copied to clipboard

[EuiDataGrid] Right-aligned clickable cell contents and cell actions are hard to use

Open flash1293 opened this issue 2 years ago • 11 comments

If the content of a cell is both right aligned and clickable (e.g. a link), then the cell actions sliding in on hover make it hard to hit the link: bait

A straightforward solution to improve the issue in practice in a lot of cases is to change the alignment to left, but in situations like the one from the recording above with narrow columns it's easy for the popovers to cover the thing the user wants to click even for left aligned text.

A more complex solution might be to show the cell actions below/to the right of the actual cell in case of clickable content so they don't cover the very thing in the focus of the user.

flash1293 avatar Apr 21 '22 10:04 flash1293

Honestly I think most of this is due to the animation. This becomes a bigger problem when there are more icons (like security) and then animation shifts more. I'd suggest leaving the delay, and removing the animation.

snide avatar Apr 21 '22 13:04 snide

Not having an animation will make it slightly better, but at least for me I'm sure I will still hit the "filter out" button from time to time.

flash1293 avatar Apr 21 '22 13:04 flash1293

I definitely get wanting to immediately click the link itself, but couldn't the user could always click the expand icon or the Enter key and click the cell link from there? Alternatively, for columns where this is a known issue, would setting a wider default width make sense? (No worries if the answer to both is no or a more graceful solution would be preferred)

cee-chen avatar Apr 21 '22 15:04 cee-chen

click the expand icon or the Enter key and click the cell link from there

An additional click is a pretty high friction for such an interaction IMHO. Also (and that's a separate issue) it doesn't work in Discover because the link formatter is not applied in the popover.

for columns where this is a known issue, would setting a wider default width make sense

It doesn't help for right aligned texts, but it definitely improves the issue for left alignment (at the expense of a less dense table)

flash1293 avatar Apr 21 '22 15:04 flash1293

Related: https://github.com/elastic/kibana/issues/133739

cee-chen avatar Jun 14 '22 16:06 cee-chen

@miukimiu any thoughts or recommendations on how we could potentially move or redesign the cell actions hover/UX for the scenarios in this issue as well as in https://github.com/elastic/kibana/issues/133739? Is displaying the actions outside the cell an option?

cee-chen avatar Jun 14 '22 17:06 cee-chen

I also would a favor showing the actions outside the cell given there's not enough screenspace ... or to just show the expand icon for this case , icons would then be displayed in the cell expansion. Also had the same use case when trying out a grid @jughosta created. Wanted to click on a link in a cell, but that was a challenge since the cell actions didn't want me to click the link 😄

kertal avatar Jul 05 '22 08:07 kertal

https://github.com/elastic/kibana/issues/99312 has a worse example of this. Just brainstorming, but it sounds like data grid needs to check when the cell is too small for the cell actions to display without blocking the majority of the content, and figure out some other way of displaying the cell actions. Maybe a popover?

cee-chen avatar Jul 27 '22 18:07 cee-chen

I would just opt for a minimum width of that cell / column based on the number of cell actions + extra for content reveal.

cchaos avatar Jul 27 '22 18:07 cchaos

a minimum width of that cell

That's tricky, if the cell contains legitimately very long content that the user wants to hide, we'd essentially not be allowing users to resize column widths smaller than their content.

Maybe a static minimum would be helpful here, e.g. a minimum of 20px + width of cell actions?

cee-chen avatar Jul 27 '22 18:07 cee-chen

Yeah sorry that's what I meant, the minimum width being based on the total width of the cell actions (plus some extra, probably a tiny bit more that 20px. It could even use ch (character) based length. Like min-width: ${cellActionsWidth} + 5ch (5 characters).

cchaos avatar Jul 27 '22 18:07 cchaos

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

github-actions[bot] avatar Jan 24 '23 00:01 github-actions[bot]

Yes, still valid

jughosta avatar Jan 24 '23 08:01 jughosta

👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

github-actions[bot] avatar Jul 24 '23 00:07 github-actions[bot]

Don't close please

jughosta avatar Jul 24 '23 07:07 jughosta

Copying thoughts from our discussions here: https://github.com/elastic/kibana/issues/133739

Due to the flexible nature of the data grid cells and their contents, I'm thinking that any design that has these cell action buttons sharing the space with the cell contents is going to be problematic. It can be problematic in situations where right-aligned cell contents can be covered in non-single-line instances. It's also problematic in situations when the user has narrowed their data grid column width (which potentially covers cell contents, truncates cell contents, or causes the action buttons to be cut off).

image

Image

I think the best path forward to address all these cases would be to change the placement of these cell action buttons to be displayed outside and above the target cell's content area. The action buttons should be aligned to the target cell's left or right side to match the alignment of the text within the cell. For example, here's a quick rough mockup of what I'm thinking:

image

We could also account for overly narrow columns by not forcing the actions below to adhere to the width of the target cell.

image

In this way, the cell being focused/targeted will never having its own contents obscured by its related actions. Thoughts?

MichaelMarcialis avatar Nov 03 '23 14:11 MichaelMarcialis

Love it - but do you mind posting a mockup / visual of what you anticipate the hover state looking like (i.e., when there's no blue border, which only appears on focus state)?

cee-chen avatar Nov 03 '23 20:11 cee-chen

@MichaelMarcialis Not sure what you had in mind, but here's what I spiked out so far:

datagrid_cells

I basically made the background color on hover the same as the border color, to match the focus theme. It's not quite as convincing on borderless data grids however:

BTW, I also opinionatedly overrode (via !important css) any colors that consumers may have applied to the icon via EuiButtonIcon props. This is worth noting as it was previously something we allowed devs to customize (e.g. setting an accent icon) but no longer makes sense to do with this new design (just IMO). If you agree with making that choice, we can enforce this via types if necessary as a breaking change.

cee-chen avatar Nov 04 '23 06:11 cee-chen

@MichaelMarcialis Here's what I came up with for the hover state:

Essentially the focus ring now also shows on mouse hover and immediately turns blue on click/keyboard enter. The above comment/question about needing to override custom action colors still remains. You can try it out here: https://eui.elastic.co/pr_7343/#/tabular-content/data-grid

BTW, while working on this, I removed the previous hover delay, as actions no longer occlude cell content, and users having immediate access to cell actions feels better. I also took the time to spike out #5686 and aligned cell expansion popovers to the new cell actions - IMO, the new design looks and feels incredibly natural/delightful with it:

datagrid_cells

cee-chen avatar Nov 05 '23 20:11 cee-chen

Thanks, @cee-chen! Apologies for the delay, as I was out on PTO yesterday. Will review all these scenarios and see if I can provide you a comprehensive document with all the different states accounted for.

MichaelMarcialis avatar Nov 07 '23 16:11 MichaelMarcialis

Hey, @cee-chen. I put together my thoughts in a quick Figma document. I'll also include a screenshot here for visibility. My suggestions here are largely the same as you've shared above with some small differences, including:

  • Rather than the light gray for the hover border and button background colors, I suggest using a slightly darker gray (the same used for our text-colored buttons).
  • Rather than showing the action buttons immediately on hover, I think it still would be nice to have the actions appear after a delay before transitioning in. The inner cell border can continue to show with no delay on hover though.

Anyway, let me know if that makes sense or if you have any questions. Thanks!

Frame

MichaelMarcialis avatar Nov 16 '23 21:11 MichaelMarcialis

Thanks Michael! Both items have been updated in #7343. LMK if https://eui.elastic.co/pr_7343/#/tabular-content/data-grid looks and animates how you would expect. If so, would appreciate you approving the PR!

One note on the animation delay - it makes the removed border-radius on the corner with the actions look a tad weird in the split second before the actions pop up. I doubt most would notice, but if it's bothersome, maybe we should consider doing away with the outline border-radius entirely?

cee-chen avatar Nov 16 '23 23:11 cee-chen

Closed by https://github.com/elastic/eui/pull/7343

cee-chen avatar Nov 21 '23 23:11 cee-chen