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

Site Editor: Snackbar notifications reappear which switching between view and edit mode #50624

Closed
glendaviesnz opened this issue May 15, 2023 · 3 comments
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended

Comments

@glendaviesnz
Copy link
Contributor

Description

The likes of 'Template reverted' snackbar notifications appear to be dismissed in the site editor view mode, but then reappear when going into edit mode.

We should dismiss all snackbars when moving between modes.

Step-by-step reproduction instructions

  • Edit a template part
  • Go to manage all template parts screen
  • Revert the template changes
  • Go back to the main Design browse page and notice that snackbar has gone
  • Go into the site editor and notice the snackbar is back

Screenshots, screen recording, code snippet

snack-is-back.mp4

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@glendaviesnz glendaviesnz added [Type] Bug An existing feature does not function as intended [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels May 15, 2023
@glendaviesnz glendaviesnz added the [Type] Enhancement A suggestion for improvement. label May 15, 2023
@glendaviesnz glendaviesnz self-assigned this May 15, 2023
@jameskoster
Copy link
Contributor

We should dismiss all snackbars when moving between modes.

I don't know that this is necessarily the correct solution. If you move between modes quickly after performing an action then you'd lose the Snackbar, potentially before you had time to read it.

Looking at the video, the problem seems to be that the Snackbar is visually hidden when you move up a level in the drilldown, but is still present in the DOM and so re-appears if you enter edit view before it has timed out. It would be good to fix that for sure. My instinct is that there should only be 3 ways a Snackbar is dismissed:

  1. The user clicks to close, or clicks the supplementary action if there is one (e.g. Undo).
  2. It times out naturally.
  3. A threshold is reached where it's not economical to display all the Snackbars at once (IE only display max 4-5, or something).

Possibly a separate issue, but it's also not ideal how the Snackbar is repositioned during the animation between modes. Preferably they exist on a layer above the rest of the UI, and are always fixed in position regardless of mode, kind of like dialogs.

@talldan
Copy link
Contributor

talldan commented Jun 30, 2023

I've noticed there's also a bug where the timeout for snackbars resets when navigating between different parts of the editor. It seems to happen as there are a few different implementations of snackbars across the site editor and each instance resets the countdown.

As James mentions, it might best to have one snackbar implementation at a higher level if it can be made to look good in all the different views.

@priethor priethor removed the [Type] Enhancement A suggestion for improvement. label Jun 30, 2023
@youknowriad
Copy link
Contributor

I think we now have a consistent place for snackbars, so this is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants