mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.9k stars 1.19k forks source link

[data grid] Improved filter panel #6419

Open joserodolfofreitas opened 1 year ago

joserodolfofreitas commented 1 year ago

Summary

The current filter panel has a couple of usability problems.

image

Motivation

Initial Proposals and ideas

Potential issues we can cover

Challenges

Examples

Dev Express

image

Syncfusion'

image

AG Grid

Screen Shot 2022-10-07 at 11 29 03

There are a few problems to consider though, specially on the AG Grid example, you can't always know which column you're filtering, because there's no indication on the panel itself, and assuming based on its position is not reliable, Is it filtering on country or sport?

image

Telerik doesn't seem to have such a panel and is based on filtering on the header option.

yaredtsy commented 1 year ago

@joserodolfofreitas if the filter panel is verticalized. Would it be long when we use multi-filtering? since the current one works by adding a new filter component below?

image.

AG Grid uses a sidebar for multi-filtering.

image

joserodolfofreitas commented 1 year ago

That's a good point, @yaredtsy. It could get long depending on the number of filters active. But generally speaking, all the solutions are on the table yet. For instance, we might verticalize the single-column panel, and align each of those panels horizontally in case of multi-filtering (if that presents a better trade-off between the available options).

Do you have a preference on this matter?

yaredtsy commented 1 year ago

I think it would be great if they are collapsable and shows the headerName only image . and the active components will expand and they are verticalized.

yaredtsy commented 1 year ago

@joserodolfofreitas I have built a demo. you can check it out at https://codesandbox.io/s/stupefied-breeze-1rvgx0?file=/demo.tsx

joserodolfofreitas commented 1 year ago

Thank you for the example, @yaredtsy! It does a solid job helping us explore this path.

Before implementing this feature, we'll explore other possibilities as well, most likely with a visual concept/design first. There's also a discussion on #6247 where we may consider implementing a Query Language for the filter text inputs, which enables users to type yared OR jose, or > 17, for instance.

If we pursue that path, it may also impact how we'll re-design the filter panel.

joserodolfofreitas commented 1 year ago

As a note: perhaps the solution using hooks to empower users to change the layout in the Date Pickers works well here too.

cherniavskii commented 11 months ago

Related issue https://github.com/mui/mui-x/issues/5183

chatterz commented 5 months ago

The mobile behavior of the current filter popper is not yet perfect.