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] Implement draggable columns with table headers #7136

Open
Tracked by #182611 ...
kertal opened this issue Aug 29, 2023 · 6 comments · May be fixed by #8015
Open
Tracked by #182611 ...

[EuiDataGrid] Implement draggable columns with table headers #7136

kertal opened this issue Aug 29, 2023 · 6 comments · May be fixed by #8015

Comments

@kertal
Copy link
Member

kertal commented Aug 29, 2023

Is your feature request related to a problem? Please describe.
We recently implemented draggable fields in Discover, so users can drag and drop fields on the EuiDataGrid and now since you can add fields this way, the next logical step would be to reorder these fields that turned into columns directly using the grid's table headers, without having to use a popover UI. What's more, Discover's EuiDataGrid will be soon become UnifiedDataTable, and replace the grid in Security Solutions Timeline. The current grid supports drag and drop columns ordering with the table headers.

Kapture.2023-08-29.at.09.49.56.mp4

Describe the solution you'd like
The solution how it could look like was drafted in a Figma

Bildschirmfoto 2023-08-29 um 09 38 33
@kertal kertal mentioned this issue Aug 28, 2023
6 tasks
@JasonStoltz JasonStoltz added the task A task associated with a larger Meta issue label Sep 11, 2023
@JasonStoltz JasonStoltz removed the task A task associated with a larger Meta issue label May 6, 2024
@JasonStoltz
Copy link
Member

This is probably a large ask. @cee-chen Anything thoughts off the top of your head around what the implementation might look like? A possible approach or challenges?

@cee-chen
Copy link
Member

cee-chen commented May 13, 2024

  1. Showing the entire column being dragged is probably impossible with virtualization. We show only the column header being dragged
  2. The drop zone is also in question. Are we limiting it to the header row (easiest)? Should we allow dragging to the anywhere in the column (e.g. over data cells) as well (harder)?
  3. What custom styles are we going to use to indicate drop zones? Do we just reuse the green background on https://eui.elastic.co/#/display/drag-and-drop? Or is there another style we need to consult with a designer for?
  4. Drop zones in stacking contexts can be buggy due to the underlying library using position: fixed (see docs) - this might be problematic for datagrids used in flyouts and will need QA testing

@JasonStoltz
Copy link
Member

Just looking at some other examples for a frame of reference:
https://adazzle.github.io/react-data-grid/#/columns-reordering

Showing the entire column being dragged is probably impossible with virtualization. We show only the column header being dragged

My 2 cents on it is that's OK. The React Datagrid example above works that way and seems like a fine experience.

The drop zone is also in question. Are we limiting it to the header row (easiest)? Should we allow dragging to the anywhere in the column (e.g. over data cells) as well (harder)?

Again, looking at the React Datagrid example -- it's just the header and it seems fine.

@kertal
Copy link
Member Author

kertal commented May 17, 2024

👍 for just using the column header for this operation

@kertal
Copy link
Member Author

kertal commented May 17, 2024

And it I don't think the whole header cell needs to be dragged in a visible way. GitHub Project boards do it like that

Kapture.2024-05-17.at.14.47.27.mp4

I think this way it's very clear where to drag to, and I think it's simpler to do that the eye-candy drag'n'drop

@mgadewoll
Copy link
Contributor

ℹ This issue can be picked up after this other update is done, as the update for interactive header columns should be included already.

@mgadewoll mgadewoll linked a pull request Sep 11, 2024 that will close this issue
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants