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

Automatic switch media button in toolbar when using the MediaPlaceholder Component #19336

Closed
fabiankaegy opened this issue Dec 26, 2019 · 4 comments
Assignees
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Feature] Media Anything that impacts the experience of managing media [Type] Enhancement A suggestion for improvement.

Comments

@fabiankaegy
Copy link
Member

Is your feature request related to a problem? Please describe.
Almost every time media items are used in a block you need a way to edit them after you first insert them. This can be done how ever the developer likes though. But wouldn't it make it a better user experience if all of them worked the same way? And also if you only need to change it in one place instead of in every single block that uses it. Like it had to be done here: #16200

Describe the solution you'd like
Automatically adding a replace media interface to the block toolbar when using the MediaPlaceholder component. Either having it turned on by default but being able to disable it or needing to enable it yourself via a prop.

@youknowriad
Copy link
Contributor

Interesting proposal. Did you see this @draganescu could be interesting to see how feasible is that and whether it's a good addition or not.

@youknowriad youknowriad added [Feature] Extensibility The ability to extend blocks or the editing experience [Feature] Media Anything that impacts the experience of managing media [Type] Enhancement A suggestion for improvement. labels Jan 2, 2020
@draganescu draganescu self-assigned this Jan 6, 2020
@draganescu
Copy link
Contributor

Hi @fabiankaegy this sounds very nice, I'll check this out and see how it works as a feature of the MediaPlaceholder component.

@draganescu
Copy link
Contributor

draganescu commented Jan 7, 2020

My initial thoughts are that having MediaReplaceFlow added to a block's toolbar by MediaPlaceholder is going to be complicated by the fact that MediaPlaceholder is unmounted everytime the "edit" state is done, which will remove MediaReplaceFlow as well.

The placeholder is thought (both functionally and visually) as an either/or component, it will not fit well with making it deliver options to the blocks which use it.

One other option to achieve a similar result (which I've explored with MediaReplaceFlow initially) is to possibly have a HoC MediaContainer that offers both MediaReplaceFlow and MediaPlaceholder. We need a HoC because any component ofering both has to render both in the scope of BlockControls for the replace flow and outside that, in the scope of the implementing block's container, for the placeholder.

@youknowriad
Copy link
Contributor

Good thoughts, based on this, I feel like having to include the two components is probably a simpler way to go, so let's close this issue for now. Thanks for looking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Feature] Media Anything that impacts the experience of managing media [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants