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

[DataGrid] Update aggregation label styling #13950

Closed
wants to merge 2 commits into from

Conversation

KenanYusuf
Copy link
Contributor

@KenanYusuf KenanYusuf commented Jul 23, 2024

Fixes #5530 and #9104

Problem

Aggregation labels are currently quite prominent in the header cell due to their color, font-weight and transformation to uppercase - this doesn't make sense hierarchically as they should not have equal or more importance than the header title itself.

The other issue we have is that the aggregation label is too close to the header title when the grid density is set to compact.

before

Solution

This PR updates the aggregation label style to use the secondary text color, regular font-weight, and removes the text transformation.

Removing the text transformation also makes the casing for the aggregation consistent with how the option is displayed in the column menu select.

localhost_3001_playground_(Styling Screenshot)

Note: ideally there would be more space below the aggregation label, too, as it is too close to the border. Perhaps we could solve that here, or separately as part of this issue? #5274

Preview: https://deploy-preview-13950--material-ui-x.netlify.app/x/react-data-grid/aggregation/

@KenanYusuf KenanYusuf requested review from noraleonte and a team July 23, 2024 10:34
@KenanYusuf KenanYusuf added component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer labels Jul 23, 2024
@mui-bot
Copy link

mui-bot commented Jul 23, 2024

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

Generated by 🚫 dangerJS against 47a7d31

@romgrk
Copy link
Contributor

romgrk commented Jul 23, 2024

Isn't the blue color used to connect the aggregation function name to the aggregation value at the bottom? I like the casing change but I'd keep the color as it is.

@KenanYusuf
Copy link
Contributor Author

KenanYusuf commented Jul 23, 2024

Isn't the blue color used to connect the aggregation function name to the aggregation value at the bottom? I like the casing change but I'd keep the color as it is.

@romgrk I think that was the intention, but I don't think the connection is at all obvious. I think the primary color should be reserved for highlighting important information (as it does for the aggregation value), and interactive elements like links and buttons.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I'm fine with the color change. It's worth mentioning that the usage of the accent color for aggregation wasn't super consistent – e.g. it's only used for the footer aggregation values, but not for the inline values – see examples in https://deploy-preview-13950--material-ui-x.netlify.app/x/react-data-grid/aggregation/#usage-with-row-grouping

The color change warrants a minor release IMO.

@joserodolfofreitas What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we can trust the designers' take on this. Both Kenan and Nora agree that the accent color doesn't provide a clear connection and that the color generates even more confusion in terms of UX.

We never got a ticket regarding this, though, so maybe it doesn't matter that much.
Let's see how users will receive this update.

Copy link
Contributor

@noraleonte noraleonte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice improvement 👏 The header is much more consistent now, and the type hierarchy is on point 👌 I'll tentatively approve, but I'd wait for an ok from the grid team too 🎉

Copy link
Member

@joserodolfofreitas joserodolfofreitas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing this front forward!

fontWeight: theme.typography.fontWeightMedium,
color: (theme.vars || theme).palette.primary.dark,
textTransform: 'uppercase',
top: '50%',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can move the label down a bit to avoid a potential collision with the column header text?
WDYT @KenanYusuf ?

Screenshot 2024-07-26 at 15 36 12

In case of a custom aggregation label

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it could be moved down more.

The problem with that is the available space on density="compact"

Screenshot 2024-07-26 at 14 42 00

As it stands, the aggregation label is already touching the bottom border when the label has a descender e.g. avg.

I would propose that we create a separate set of density factor values for column headers to ensure that our header cells always have enough space for the various elements including the aggregation label. What do you think @cherniavskii

We have an issue open already to look into this problem #5274, but I could do it as part of this PR.

Copy link
Contributor Author

@KenanYusuf KenanYusuf Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a separate PR for the above #14022 - I am going to hold off merging this PR until that one is merged so that we can increase the spacing a little more.

@KenanYusuf KenanYusuf marked this pull request as draft July 29, 2024 10:42
@KenanYusuf KenanYusuf marked this pull request as ready for review July 29, 2024 10:42
@KenanYusuf
Copy link
Contributor Author

Going to re-open a PR with these changes and some other updates to column headers soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Improve aggregation label and value UX
6 participants