-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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]: Fix multiple templates creation while in the process of creating one #44146
Conversation
Size Change: +815 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
97c883d
to
f020d44
Compare
Nice work. I don't think the Snackbar is the correct approach though, for a couple of reasons:
As an alternative could we disable the menu / modal, with an overlay and spinner? If it's easier, a full-screen overlay / spinner applied in both cases could work too. |
@jameskoster I added overlays where needed. If we're in a Modal flow the overlay is also shown in the DropDown as a user could click outside during creation and click other menu items. |
false | ||
); | ||
} finally { | ||
setIsBusy( false ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unrelated small bug I discovered while testing and throwing
error.
</MenuGroup> | ||
</NavigableMenu> | ||
<> | ||
{ isCreatingTemplate && <CreatingTemplateOverlay /> } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only addition here in the DropdownMenu
. The rest is whitespace.
Thanks Nik, I think that's better. There is one issue that I didn't anticipate though (sorry)... On a very slow connection, after clicking to create a new template, you can close the modal + click to edit a different template, all before the template has been created. template.mp4Perhaps a full-screen overlay would be better after all? I'm also wondering if the work being done in #42525 might overlap here? Edit: Do we need to do something similar with deletion as well? On a slow connection you can repeatedly delete the same template before the deletion actually takes place 🙈 |
Thank you so much for splitting this out and getting started on a fix 🙌🏼 +1 to needing the same for deletion. |
I don't think so, since that PR handles the loading state before rendering blocks. --cc @tyxla I just pushed some changes to try the fullscreen overlay for the template creation for now. |
d3c6738
to
e175fc0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me, thanks!
What?
Mentioned by @annezazu here: #43877 (comment)
Currently when we're in the process of creating a template in Site Editor, a user can trigger the creation flow for multiple templates. This PR fixes that by adding an overlay with a spinner during the request to create a template.
Based on the below @jameskoster 's #44146 (comment)
Testing Instructions
Before
template.weirdness.mov
After
I'm not creating the actual templates in the below video to showcase the overlay.
Screen.Recording.2022-09-14.at.5.43.24.PM.mov