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] Display stacked Snackbars #31991

Open
wants to merge 144 commits into
base: master
Choose a base branch
from

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Mar 26, 2022

Resolves #1824
Resolves #18098

This is an opt-in feature.

This work is a replacement of notistack.

Demo preview: https://deploy-preview-31991--material-ui.netlify.app/material-ui/react-snackbar/#experimental-api

Initial implementation and idea could be reviewed.

Should I move it to MUI lab? If yes, how to reuse the Snackbar component styles into SnackbarsProvider styles without duplicating code by exporting from mui/material to mui/lab but not providing it to user in mui/material?

TODO


Edit: Ready for review!

@mui-bot
Copy link

mui-bot commented Mar 26, 2022

Netlify deploy preview

@material-ui/lab: parsed: +3.73% , gzip: +3.23%

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against 67e94e0

@danilo-leal danilo-leal added component: snackbar This is the name of the generic UI component, not the React module! new feature New feature or request labels Mar 26, 2022
@ZeeshanTamboli ZeeshanTamboli changed the title [Snackbar] Display several Snackbars [Snackbar] Display multiple Snackbars Mar 31, 2022
@ZeeshanTamboli ZeeshanTamboli requested a review from a team March 31, 2022 07:38
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 4, 2022
@Nic-S
Copy link

Nic-S commented Sep 2, 2022

I read with pleasure about this new feature, if I may I would have a consideration. The main advantage of react-tostify is the fact that you can use it outside the lifecycle of a react component, two practical examples of this use might be:

  • invoke the snackbar within an action if the application uses redux-toolkit or other state management (in this case perhaps you can mitigate by passing the result of the useSnackbars hook but would need to find a way not to pass it every time you invoke an action that requires a snackbar)
  • invoke the snackbar inside an interceptor, for example an axios interceptor that handles some generic errors.
    @ZeeshanTamboli Is there a way to expose the show() and close() api for the above examples?

@ZeeshanTamboli
Copy link
Member Author

I read with pleasure about this new feature, if I may I would have a consideration. The main advantage of react-tostify is the fact that you can use it outside the lifecycle of a react component, two practical examples of this use might be:

  • invoke the snackbar within an action if the application uses redux-toolkit or other state management (in this case perhaps you can mitigate by passing the result of the useSnackbars hook but would need to find a way not to pass it every time you invoke an action that requires a snackbar)
  • invoke the snackbar inside an interceptor, for example an axios interceptor that handles some generic errors.

Thanks @Nic-S for taking a look!

@ZeeshanTamboli Is there a way to expose the show() and close() api for the above examples?

I am not quite understanding your examples without a code example. Anyway, we want to first release this useSnackbars hook and then we can iterate more on it and add new features.

@FaabLondon
Copy link

Hello,
thanks for this https://deploy-preview-31991--material-ui.netlify.app/material-ui/react-stacked-snackbars/#api
in which version of mui/lab is it available? It does not seem to be available in 5.0.0-alpha.112
thanks

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 31, 2023
@ZeeshanTamboli ZeeshanTamboli removed the on hold There is a blocker, we need to wait label Jan 31, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 8, 2023
@jpsala
Copy link

jpsala commented Feb 9, 2023

Hello, thanks for this https://deploy-preview-31991--material-ui.netlify.app/material-ui/react-stacked-snackbars/#api in which version of mui/lab is it available? It does not seem to be available in 5.0.0-alpha.112 thanks

It's not there yet it seems :(

@jpsala
Copy link

jpsala commented Feb 9, 2023

Hi, there is a release date for this feature?

@ZeeshanTamboli
Copy link
Member Author

Hi, there is a release date for this feature?

There is no release date. We are planning to build unstyled stacked snackbars first. And then we will rebuild this on top of that unstyled version.

@jpsala
Copy link

jpsala commented Feb 17, 2023

Hi, there is a release date for this feature?

There is no release date. We are planning to build unstyled stacked snackbars first. And then we will rebuild this on top of that unstyled version.

Thank you!

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

@mui/core I moved the docs from Lab to Material UI Snackbar page.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 27, 2023
@gnowland
Copy link
Contributor

Hi, there is a release date for this feature?

There is no release date. We are planning to build unstyled stacked snackbars first. And then we will rebuild this on top of that unstyled version.

Current progress: #31991 (comment)

(Since the "progress" comment is now hidden under "Load more..." (thanks, github 🙄 -- upvote the "pinned comment" feature request: https://github.com/orgs/community/discussions/47912))

@gnowland
Copy link
Contributor

gnowland commented Aug 24, 2023

Hi, there is a release date for this feature?

There is no release date. We are planning to build unstyled stacked snackbars first. And then we will rebuild this on top of that unstyled version.

@ZeeshanTamboli do we have to wait until all unstyled components (mui/base-ui#10) are completed, or now that the unstyled snackbar component is complete is work on

2. [ ] Merge this UnstyledSnackbar component in this PR and use it here for stacked snackbars in the lab implementation. Build it with Material design.

(from #31991 (comment)) able to proceed and this component be available independently of all unstyled components being completed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: snackbar This is the name of the generic UI component, not the React module! new feature New feature or request package: lab Specific to @mui/lab PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Snackbar] Add imperative methods to display them directly [Snackbar] Add stacking support/display several