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

[Joy] Add Breadcrumbs component #32697

Merged
merged 27 commits into from Aug 8, 2022
Merged

[Joy] Add Breadcrumbs component #32697

merged 27 commits into from Aug 8, 2022

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented May 9, 2022

Done:

  • Initial implementation
  • Apply Joy theme
  • Demos (Playground, Basic Usage, Collapsed Breadcrumbs, With Menu)

Demos: https://deploy-preview-32697--material-ui.netlify.app/joy-ui/react-breadcrumbs/

@hbjORbj hbjORbj added component: breadcrumbs This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy labels May 9, 2022
@mui-bot
Copy link

mui-bot commented May 9, 2022

Details of bundle changes

@mui/joy: parsed: +0.77% , gzip: +0.68%

Generated by 🚫 dangerJS against bb4f99e

@hbjORbj hbjORbj requested a review from siriwatknp May 9, 2022 11:59
@hbjORbj hbjORbj self-assigned this May 9, 2022
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 18, 2022
@siriwatknp
Copy link
Member

siriwatknp commented May 31, 2022

Props

maxItems

I think the maxItems prop should be removed. This example is too specific from the UX perspective. The ... does not have to behave that way (one example is the overflow menu)

Developers can compose the ... by themselves. Joy should make it easy to do it by composing other components like using IconButton or Button. I expect the usage to be like this:

<Breadcrumbs maxItems={2} aria-label="breadcrumb">
  <Link underline="hover" color="inherit" href="#">
    Home
  </Link>
  {collapsed ? (
    <Button size="sm" onClick={uncollapse}>...</Button>
    ):(
    <React.Fragment>
      <Link underline="hover" color="inherit" href="#">
        Catalog
      </Link>
      <Link underline="hover" color="inherit" href="#">
        Accessories
      </Link>
    </React.Fragment>
  )}
  <Link underline="hover" color="inherit" href="#">
    New Collection
  </Link>
  <Typography color="text.primary">Belts</Typography>
</Breadcrumbs>

variant

I think let's remove the variant & color props from the breadcrumbs because I could not see the benefit of having them. If someone wants the variant, they can just use Sheet as a parent.

Demos

Here are some examples that I think we should add:

Basic

Combination of colors, separators, icons. When size changes, the size of icon & separator & text should change relative to the breadcrumb size.

Screen Shot 2565-05-31 at 10 20 07

The ••• button

Screen Shot 2565-05-31 at 10 21 23

With menu

You can use the MUI Base menu to test the composition.

Screen Shot 2565-05-31 at 10 23 37

Screen Shot 2565-05-31 at 10 24 29

https://youtu.be/kHL3gxAlvK8?t=236

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

mbrookes commented Jun 4, 2022

This example is too specific from the UX perspective.

I would go further and say that it's incorrect. If the point of maxItems is to limit the width of the breadcrumbs, it doesn't make much sense to expand the breadcrumbs. Google uses a menu in Docs:

image

so it seems we should update the Material UI implementation.

I expect the usage to be like this

That's fine for a static example, but for most use cases the links are going to be programmatically generated. If it gets too complex, it might still be better as a feature of the component rather than an example.

The ••• button

More correctly, an ellipsis is a unicode symbol "⋯" rather than three separate dots.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 5, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 1, 2022
@hbjORbj hbjORbj requested a review from siriwatknp August 3, 2022 08:16
@siriwatknp
Copy link
Member

siriwatknp commented Aug 4, 2022

For the docs, giving feedback here might be easier.

Introduction

  • The separator should have default value /

Component

I think this section should demonstrate props and how to use them with minimal code sample (it should stick to 1 prop if possible)

  • Basic usage: choose the breadcrumbs that you think it is the most common (3 styles are too much).
  • Separator: let's add a demo that uses an icon from @mui/icons-material as a separator.
  • Accessibility: Add a suggestion about aria-current="page", read more

In each demo that you use Link, please add this so that clicking on it does not trigger the link behavior:

// The `preventDefault` is for demonstration purposes, generally, you don't need it in your application
<Link onClick={event => event.preventDefault()}>

Common examples

The idea of this section is to showcase advanced/real-world examples that use the component to build more complex interfaces. Also, stress test the component to make sure that the customization experience is great.

The demo you added is useful but I think it should be in this category. Or you can update the demo to make it look like Google

Also, you can replace MenuUnstyled with Joy Menu.

@hbjORbj hbjORbj requested a review from siriwatknp August 5, 2022 10:21
@hbjORbj
Copy link
Member Author

hbjORbj commented Aug 5, 2022

Thanks for the detailed feedback, Jun. I addressed them. Let me know.

@hbjORbj hbjORbj requested a review from siriwatknp August 5, 2022 11:13
@siriwatknp
Copy link
Member

siriwatknp commented Aug 8, 2022

Last review

Sorry for the multiple reviews. Next time, I will consolidate them in once.

1. The code block in the introduction

image

This once should be like this:

<Breadcrumbs>
  <Link />
  ...
</Breadcrumbs>

2. CSS variables

Let's shorten the Breadcrumb so that the preview and editor are in side-by-side. (reduce from 4 to 3 items if you have to)

image

3. Collapsible example

Too many colors in the demo. I think it is better to use just 1 color (may by info) and use comment that developers can change the color or put the link to learn more about the Link color instead.

Screen Shot 2565-08-08 at 10 28 00

4. Menu example

It is nice to add the link to the menu component page.

Screen Shot 2565-08-08 at 10 30 40

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Thanks Benny!

@hbjORbj hbjORbj merged commit 87c1948 into mui:master Aug 8, 2022
@mbrookes
Copy link
Member

A reminder (again) to please have a native English speaker review new or significantly changed docs before merging. We're accumulating significant non-technical debt. cc @samuelsycamore - you might like to submit a PR to clean the docs up for this component, and Joy UI as a whole.

@samuelsycamore
Copy link
Member

samuelsycamore commented Aug 19, 2022

cc @samuelsycamore - you might like to submit a PR to clean the docs up for this component, and Joy UI as a whole.

Good idea. I'll create a new issue to track revisions and start submitting PRs for the pages we have so far.

Edit: Here's that issue—#33998

daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: breadcrumbs This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants