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

[ui] New component catalog #1003

Merged
merged 30 commits into from
Oct 18, 2022
Merged

[ui] New component catalog #1003

merged 30 commits into from
Oct 18, 2022

Conversation

bharatkashyap
Copy link
Member

Screen.Recording.2022-09-15.at.2.49.22.AM.mov

@render
Copy link

render bot commented Sep 14, 2022

@oliviertassinari oliviertassinari requested a deployment to catalog-ui - toolpad-db PR #1003 September 14, 2022 21:24 — with Render Abandoned
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 19, 2022
@render
Copy link

render bot commented Sep 21, 2022

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 21, 2022
@Janpot
Copy link
Member

Janpot commented Oct 7, 2022

Few small points left:

  • Wasn't the "future components" section collapsible in the design as well?

  • Do the collapsible sections stay collapsed between reloads?

  • Should we update this icon as well? (I thought I saw it in one of the designs as a different icon but can't find it back now, maybe I'm dreaming)

    Screenshot 2022-10-07 at 16 52 39

@gerdadesign
Copy link
Member

gerdadesign commented Oct 7, 2022

Looking great overall! 👏

  • Can we add a little space in between the svg icon and the name of the component? The mockup had a gap of 10px, but it may need to be a little different in this iteration vs the MUI dark theme version.
  • Wondering if it's clear enough that the WIP components are not available yet. Perhaps giving them a darker background color to make them look a little more disabled?

Screen Shot 2022-10-07 at 11 00 29 AM

@oliviertassinari oliviertassinari requested a deployment to catalog-ui - toolpad-db PR #1003 October 11, 2022 08:07 — with Render Abandoned
@bharatkashyap
Copy link
Member Author

bharatkashyap commented Oct 11, 2022

This is basically the Table material icon vs the Grid material icon. I thought Table fit the representation of the actual component better (even though we name it Grid). I also thought we might use the Grid icon for something that matched the icon more in the future — ex if we added drag and drop layout components like CSS Grid, Flex, etc., or if we wanted to add a grid view to the canvas and could toggle it on/off.

The issue seems to be that we don't currently have the Table icon in the @mui/icons-material package, from what I can see: https://mui.com/material-ui/material-icons/?query=table

  • Wasn't the "future components" section collapsible in the design as well?

it was! But in this current iteration, we still have a lot of vertical space left over, so doesn't seem critical to me if it's not collapsible at the moment.

I think it's not too much effort to make it collapsible, and in doing so, it feels to me more appropriate to switch the order of the items in the sidebar like so:

Screenshot 2022-10-11 at 2 47 25 PM

  • Wondering if it's clear enough that the WIP components are not available yet. Perhaps giving them a darker background color to make them look a little more disabled?

I'm not sure if the hover effect in this case should make it lighter:

Screen.Recording.2022-10-11.at.3.05.07.PM.mov

or darker:

Screen.Recording.2022-10-11.at.3.07.42.PM.mov

given that while the components are disabled, the button itself does trigger an action (of redirecting to the GitHub issue)

Did you mean adding a background across the entire section, like so:
Screenshot 2022-10-11 at 3 51 13 PM

I'll go ahead with adding a background to the entire section, combined with a darker background on hover, subject to correction.

@gerdadesign
Copy link
Member

The issue seems to be that we don't currently have the Table icon in the @mui/icons-material package, from what I can see: https://mui.com/material-ui/material-icons/?query=table

Hmm, why would there be a discrepancy between this and the Material Icons? Is it possible to add it?

I think it's not too much effort to make it collapsible, and in doing so, it feels to me more appropriate to switch the order of the items in the sidebar like so:

Great! Thank you :D

I'll go ahead with adding a background to the entire section, combined with a darker background on hover, subject to correction.

Thank you! For the most part, darker seems to be the usual pattern for hover effects. This screenshot looks like the hover is quite dark—curious what's your system for choosing the gray values?

borderStyle: kind === 'create' ? 'dashed' : 'solid',
color: 'text.secondary',
'&:hover': {
backgroundColor: 'action.disabled',
Copy link
Member

@Janpot Janpot Oct 13, 2022

Choose a reason for hiding this comment

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

This looks right to me:

Suggested change
backgroundColor: 'action.disabled',
backgroundColor: 'action.hover',

It adds a black background with opacity, so it should be just additive with whatever is underneath. For future reference, I'd say adding action.disabled to a hover effect can be categorized as a code smell. And if we have to do it to make things look right, that'd probably be something that needs to fixed in the theme. Imagine a maintainer working on the theme in 6 months from now finding out we've been using action.disabled for all kinds of things other than disabled states.

@bharatkashyap
Copy link
Member Author

bharatkashyap commented Oct 13, 2022

Hmm, why would there be a discrepancy between this and the Material Icons? Is it possible to add it?

I think this is to do with the icon set being supported by @mui/icons-material being Material Icons, not Material Symbols

Thank you! For the most part, darker seems to be the usual pattern for hover effects. This screenshot looks like the hover is quite dark—curious what's your system for choosing the gray values?

Update this based on #1003 (comment) to have a lighter background on hover and a slightly darker background overall:
Screenshot 2022-10-14 at 1 36 55 AM

borderWidth: 1,
borderStyle: 'inset',
borderColor: 'divider',
backgroundColor: 'grey.200',
Copy link
Member

Choose a reason for hiding this comment

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

Will this work with a dark theme?

Copy link
Member Author

@bharatkashyap bharatkashyap Oct 14, 2022

Choose a reason for hiding this comment

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

I've made some updates to this PR to handle the new theme on the catalog when it gets merged.

Screen.Recording.2022-10-14.at.4.29.42.PM.mov

The issue is that given that they are independent pull requests, I can't seem to make any change that is dependent on the other to either pull request.

I think the solution is to merge this first, pull these changes into #988 and then handle any other changes there.

Copy link
Member

Choose a reason for hiding this comment

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

I'm mainly wondering whether it's possible to make this more theme-agnostic? Instead of specifying a specific color, rather darken/lighten the background. Or darken/lighten a theme color.

Testing whether a generic dark theme produces acceptable results is just a matter of switching the palette mode.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, I've made a change to use darken which is theme agnostic and does the job:

Screen.Recording.2022-10-18.at.2.18.38.PM.mov

@Janpot
Copy link
Member

Janpot commented Oct 16, 2022

I think this is to do with the icon set being supported by @mui/icons-material being Material Icons, not Material Symbols

Also see mui/material-ui#32846 (cc @oliviertassinari )

@render
Copy link

render bot commented Oct 18, 2022

@oliviertassinari oliviertassinari requested a deployment to catalog-ui - toolpad-db PR #1003 October 18, 2022 08:33 — with Render Abandoned
Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

👍 Alright, let's go

@bharatkashyap bharatkashyap merged commit 5a04a61 into master Oct 18, 2022
@bharatkashyap bharatkashyap deleted the catalog-ui branch October 18, 2022 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component discoverability in catalog
5 participants