mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[DataGridPro] Improve compact density UI for header filters

Open MBilalShafi opened this issue 1 year ago • 1 comments

Fixes #13048

The current UI of the inputs being used in filter input components doesn't leave much room for the label to be shown on the top, this PR hides the top label when density="compact"

Before Preview: https://stackblitz.com/edit/react-jre9au?file=Demo.tsx After Preview: https://codesandbox.io/p/sandbox/busy-alex-ds3g7r

MBilalShafi avatar Aug 28 '24 12:08 MBilalShafi

Deploy preview: https://deploy-preview-14373--material-ui-x.netlify.app/

Generated by :no_entry_sign: dangerJS against b22d23d6777ae1fd5822d4e10bcb3431797c237f

mui-bot avatar Aug 28 '24 12:08 mui-bot

@MBilalShafi definitely an improvement over the current design, however, I worry that we're impacting usability by removing the label as there is no other way to tell which operator is selected without removing the value or opening the operator menu.

What do you think of modifying the control styles slightly so that they take up the whole column header cell? We could drop the font-size to 14px, and adjust the floating label position so that it's closer to the input value. Here's a quick mockup:

Header filter mockup (3)

Let me know what you think.

kenanyusuf avatar Aug 30 '24 12:08 kenanyusuf

@KenanYusuf Thank you for creating the mockup. So much crammed-up space previously didn't seem nice to me which is why I was inclined to remove the label altogether instead of reducing the font sizes. But in the mockup, it looks kinda decent. 👍

MBilalShafi avatar Sep 02 '24 10:09 MBilalShafi

The position of the filter operator icon feels off.

With the default density it is aligned with the content and the input reset icon default

For compact density it is centered compact

arminmeh avatar Sep 30 '24 11:09 arminmeh

Thanks @arminmeh for pointing it out. We are having an active discussion around updating the header filters UI (around the text underline) and UX (around keyboard navigation), due to which the current PR is kind-of stale, I'll mark it as a Draft until then.

Feel free to check or jump into the conversation.

MBilalShafi avatar Sep 30 '24 11:09 MBilalShafi

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 23 '24 08:12 github-actions[bot]

Closing for now in favor of https://github.com/mui/mui-x/pull/15991, will reopen the PR around the figma discussion if needed.

MBilalShafi avatar Jan 13 '25 12:01 MBilalShafi