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

[Snackbar] Match the new specification #15122

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Mar 30, 2019

Closes #14785. I had a few changes to make to match the specification.

The new specification: https://material.io/design/components/snackbars.html.

Breaking changes

  • Dimensions changed.
  • Default transition is Grow instead of Slide.

@oliviertassinari oliviertassinari added design: material This is about Material Design, please involve a visual or UX designer in the process component: snackbar This is the name of the generic UI component, not the React module! labels Mar 30, 2019
@mui-pr-bot
Copy link

mui-pr-bot commented Mar 30, 2019

@material-ui/core: parsed: +Infinity% , gzip: +Infinity%
@material-ui/lab: parsed: +Infinity% , gzip: +Infinity%
@material-ui/styles: parsed: +Infinity% , gzip: +Infinity%
@material-ui/system: parsed: +Infinity% , gzip: +Infinity%

Details of bundle changes.

Comparing: 03e01e3...e735fe2

bundle parsed diff gzip diff prev parsed current parsed prev gzip current gzip
@material-ui/core +Infinity% 🔺 +Infinity% 🔺 0 349,848 0 89,858
@material-ui/core/Paper +Infinity% 🔺 +Infinity% 🔺 0 67,853 0 19,820
@material-ui/core/Paper.esm +Infinity% 🔺 +Infinity% 🔺 0 60,184 0 18,563
@material-ui/core/Popper +Infinity% 🔺 +Infinity% 🔺 0 30,463 0 10,530
@material-ui/core/styles/createMuiTheme +Infinity% 🔺 +Infinity% 🔺 0 17,364 0 5,726
@material-ui/core/useMediaQuery +Infinity% 🔺 +Infinity% 🔺 0 2,469 0 1,041
@material-ui/lab +Infinity% 🔺 +Infinity% 🔺 0 147,758 0 43,621
@material-ui/styles +Infinity% 🔺 +Infinity% 🔺 0 53,105 0 15,429
@material-ui/system +Infinity% 🔺 +Infinity% 🔺 0 17,136 0 4,528
Button +Infinity% 🔺 +Infinity% 🔺 0 87,928 0 26,054
Modal +Infinity% 🔺 +Infinity% 🔺 0 82,035 0 24,552
colorManipulator +Infinity% 🔺 +Infinity% 🔺 0 3,232 0 1,299
docs.landing +Infinity% 🔺 +Infinity% 🔺 0 49,914 0 10,815
docs.main +Infinity% 🔺 +Infinity% 🔺 0 645,455 0 200,410
packages/material-ui/build/umd/material-ui.production.min.js +Infinity% 🔺 +Infinity% 🔺 0 298,251 0 82,662

Generated by 🚫 dangerJS against e735fe2

@oliviertassinari oliviertassinari force-pushed the update-snackbar-implementation branch 4 times, most recently from b89cf43 to 61488d4 Compare March 30, 2019 17:44
@eps1lon
Copy link
Member

eps1lon commented Mar 31, 2019

Added detailed changes to the PR description. Could you correct them if they're wrong/incomplete? Helps people evaluating that change.

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

https://deploy-preview-15122--material-ui.netlify.com/demos/snackbars/#consecutive-snackbars is now outdated. There is no more downwards/upwards movement.

@oliviertassinari oliviertassinari dismissed eps1lon’s stale review March 31, 2019 11:22

updated, thank you

Copy link
Member

@joshwooding joshwooding left a comment

Choose a reason for hiding this comment

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

I prefer the old look of the 'Snackbars and floating action buttons (FABs)' demo which matches the other demos on the page but LGTM

Copy link
Member

@joshwooding joshwooding left a comment

Choose a reason for hiding this comment

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

@mbrookes
Copy link
Member

For the 'Snackbars and floating action buttons (FABs)' I think it would be preferable to show this at mobile width, so that it matches the new behaviour shown in the spec, regardless of the width of the browser. At first glance it is hard to see what is being demonstrated.

Alternatively, a toggle to switch the width, although that would muddy the distinction between what is required to implement the behavior, vs what is required to demo it.

Also, the app bar title "Out of my way" no longer makes sense, as the snackbar isn't now "pushing" the Fab out of the way.

Copy link
Member

@joshwooding joshwooding left a comment

Choose a reason for hiding this comment

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

I still prefer the old look of the 'Snackbars and floating action buttons (FABs)' demo which matches the other demos on the page (text button on a grey background) but LGTM

Copy link
Member

@mbrookes mbrookes left a comment

Choose a reason for hiding this comment

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

  1. The "Open snackbar" button didn't used to have a background, in order to to separate it from the "App":

image

Now it looks like it's a part of the "App", with the AppBar pushed down:

image

  1. The previous width looked more like that of a mobile app.

  2. Previously mentioned:

Also, the app bar title "Out of my way" no longer makes sense, as the snackbar isn't now "pushing" the Fab out of the way.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Apr 1, 2019

@mbrookes I'm removing the demo. I think that it's simpler this way.

I have a better idea.

@oliviertassinari oliviertassinari force-pushed the update-snackbar-implementation branch 2 times, most recently from b066c64 to 6953f95 Compare April 1, 2019 19:19
@oliviertassinari
Copy link
Member Author

@mbrookes Could you confirm it's good now?

Copy link
Member

@mbrookes mbrookes left a comment

Choose a reason for hiding this comment

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

Not all a direct result of this PR, but here are few observations from looking at the rest of the demos:

Customized:
The "Open success snackbar" button isn't obviously a button. Would an outlined outlined button be better?

Positioned:
After opening the first snackbar, the rest don't get an opening transition.

Control Direction:
Says "Slide is the default transition." This is no longer the case.

Change Transition:
Demos Slide, which is already shown in the Control Direction demo. Demos Grow, which is the default transition.

notistack:
The revised spec says not to stack snackbars, so if we're keeping this demo, the text should perhaps mention that.

@oliviertassinari
Copy link
Member Author

@mbrookes Thanks, it should be taken care of.

@mbrookes
Copy link
Member

mbrookes commented Apr 1, 2019

Just this one left:

Change Transition:
Demos Slide, which is already shown in the Control Direction demo. Demos Grow, which is the default transition.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Apr 2, 2019

Why do you want to remove it? The concerns are different, one is about changing the transition, the other about changing the Slide direction.

@eps1lon
Copy link
Member

eps1lon commented Apr 2, 2019

If the default transition is not Slide anymore is it really that important to have an example about the direction? This is more a concern for Slide demos. direction isn't even an apparent prop.

Change Transition:
[...] Demos Grow, which is the default transition.

I would keep that there (maybe add a "this is default" hint) for easier comparison.

@oliviertassinari
Copy link
Member Author

I would keep that there (maybe add a "this is default" hint) for easier comparison.

I'm on it 👍

If the default transition is not Slide anymore is it really that important to have an example about the direction?

I'm wondering too, but I believe it's something common.

@mbrookes
Copy link
Member

mbrookes commented Apr 2, 2019

I would keep that there (maybe add a "this is default" hint) for easier comparison.

Except that it isn't actually just showing the default, it's "replacing" the default transition (Grow) with Grow. As a code example it's... odd.

@eps1lon
Copy link
Member

eps1lon commented Apr 2, 2019

I would keep that there (maybe add a "this is default" hint) for easier comparison.

Except that it isn't actually just showing the default, it's "replacing" the default transition (Grow) with Grow. As a code example it's... odd.

Sure we don't have to explicitly define it. That's rather nitpicky though. I would rather focus on the actual demo: Do you agree that we should include the defeault transition in the demo?

@mbrookes
Copy link
Member

mbrookes commented Apr 2, 2019

I lean towards the simplest demo that shows the particular feature or function, in this case using a custom transition. But if you believe having the side-by-side comparison is helpful, then sure.

@oliviertassinari oliviertassinari force-pushed the update-snackbar-implementation branch from a6cd990 to a8a9898 Compare April 2, 2019 22:08
@oliviertassinari oliviertassinari force-pushed the update-snackbar-implementation branch from a8a9898 to e735fe2 Compare April 2, 2019 22:52
@oliviertassinari oliviertassinari merged commit 25ea3bf into mui:next Apr 3, 2019
@eps1lon eps1lon mentioned this pull request Apr 17, 2019
56 tasks
@shilangyu
Copy link

Sorry for commenting on an old PR, but was this the PR that removed full-width snackbars on mobile?

@oliviertassinari oliviertassinari deleted the update-snackbar-implementation branch August 20, 2019 10:06
@oliviertassinari
Copy link
Member Author

Yes

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

Successfully merging this pull request may close these issues.

6 participants