-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DataGrid] Improved column menu design and api #6619
Conversation
These are the results for the performance tests:
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
packages/grid/x-data-grid/src/hooks/features/columnMenu/useGridColumnMenu.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, we are almost there! 👍
Would be great to get Gerda's feedback on it! cc @gerdadesign
packages/grid/x-data-grid-premium/src/components/GridColumnMenuRowUngroupItem.tsx
Show resolved
Hide resolved
packages/grid/x-data-grid-premium/src/components/GridPremiumColumnMenu.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
packages/grid/x-data-grid-premium/src/hooks/utils/useKeepGroupedColumnsHidden.ts
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid-pro/src/tests/columnHeaders.DataGridPro.test.tsx
Outdated
Show resolved
Hide resolved
scripts/x-data-grid-pro.exports.json
Outdated
@@ -10,13 +10,15 @@ | |||
{ "name": "CursorCoordinates", "kind": "Interface" }, | |||
{ "name": "daDK", "kind": "Variable" }, | |||
{ "name": "DATA_GRID_DEFAULT_SLOTS_COMPONENTS", "kind": "Variable" }, | |||
{ "name": "DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS", "kind": "Variable" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to export these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, we don't need these extra exports, removed them in 4f488b6
This is shaping up really well! Just noticing two things:
|
You are right, this demo doesn't follow the default styling guidelines as the purpose is to depict the customizability possible with the column menu. Though the padding did look a bit off, I adjusted it, thanks for pointing out.
I checked, the icons use the same colors as in material-ui |
Thanks for calling this out! It is in the Material UI Menu component. I opened a new issue: mui/material-ui#35589 about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice UX improvement 👍
function GridColumnMenuContainer(props: GridColumnMenuProps, ref) { | ||
const { hideMenu, currentColumn, open, id, labelledby, className, children, ...other } = props; | ||
const StyledMenuList = styled(MenuList)(() => ({ | ||
minWidth: 248, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's not a bit too much width on mobile. The column menu feels a bit big. Hiding more information on the screen than might be necessary.
I might have found design opportunities in the aggregation introduced in this PR. I have found them while I was reviewing the changes in https://mui.com/blog/mui-x-v6/. Should we create issues for them? cc @gerdadesign @MBilalShafi
https://deploy-preview-6619--material-ui-x.netlify.app/x/react-data-grid/aggregation/ How about we remove the hover?
Screen.Recording.2023-03-21.at.17.06.01.movhttps://deploy-preview-6619--material-ui-x.netlify.app/x/react-data-grid/aggregation/#filtering |
I think the same will be the experience on mobile with aggregation/grouping items shown even if the width constraint is not applied, but we can save some space on Community/Pro versions by adding a media query. 👍
That makes sense, to improve the user's expectation until we propose a better UX for aggregation item (a dedicated panel or part of some other panel etc)
I think it's because of an issue with What we can possibly do:
I feel the third option is a sweet spot.
So maybe for now it makes sense to go for possibility no.3 Have tried to apply the above-mentioned changes in #8424 cc @gerdadesign |
Fixes #7025
Fixes #4929
Preview: https://deploy-preview-6619--material-ui-x.netlify.app/x/react-data-grid/column-menu/#column-menu-with-pro-premium-options
Changelog
Breaking changes
column
andcurrentColumn
is now renamed tocolDef
DATA_GRID_DEFAULT_SLOTS_COMPONENTS
export has been removedSome of the components have been renamed for consistency.
Community Package:
Pro package:
Premium package:
Design