Allow adding loading indicator overlay on editor #24025
Labels
General Interface
Parts of the UI which don't fall neatly under other labels.
Needs Decision
Needs a decision to be actionable or relevant
Needs Design Feedback
Needs general design feedback.
[Package] Block editor
/packages/block-editor
[Type] Feature
New feature to highlight in changelogs.
Is your feature request related to a problem? Please describe.
In some cases, it is necessary to run non-trivial logic on pageload in the block editor, which may take let's say 1-2 seconds. For example, I have been working on a plugin which allows to share content directly into Gutenberg via the Web Share Target API, and in order for that to work, Gutenberg has to wait for an incoming share postMessage event and then run the necessary logic: for example, in my case, if an image is being shared, that image should be uploaded to the media library and then a
core/image
block should automatically be inserted.For such cases it would be beneficial to have a general loading indicator to block the user from any interaction until that the "initial" intended editor state is available. Right now, the experience in my plugin is somewhat unexpected, since the user has no idea something will happen, and then after a few seconds suddenly blocks are being inserted.
Describe the solution you'd like
It would be great if Gutenberg offered an easy-to-use loading indicator overlay that would go over the entire editor UI once active. For example, there could be something like
dispatch( 'core/block-editor' ).setLoading( active )
to toggle on and off.Describe alternatives you've considered
This could also be something that I build into my plugin specifically. But I think it's worthy of considering for a built-in component, for a more consistent and integrated experience.
The text was updated successfully, but these errors were encountered: