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

The Media inserter tab isn't synchronized with the Media Library #46145

Open
javierarce opened this issue Nov 29, 2022 · 3 comments
Open

The Media inserter tab isn't synchronized with the Media Library #46145

javierarce opened this issue Nov 29, 2022 · 3 comments
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended

Comments

@javierarce
Copy link
Contributor

javierarce commented Nov 29, 2022

The Media Library and the recently released Inserter Media tab aren't in sync. This means that if a user uploads a file through the Media Library, it won't appear in the sidebar immediately. And even worse, if the user removes the file from the Media Library, the file will still show up in the sidebar (in this case, the user will be able to add the image to the canvas, and it will be rendered in the preview until the post is saved).

Step-by-step reproduction instructions

  1. Create a post and add a file using the Media Library
  2. Open the Media tab in the Inserter

The file doesn't appear in the sidebar.

  1. Remove a file from the Media Library
  2. Open the Media tab in the Inserter

The file still shows up in the sidebar.

@javierarce javierarce added [Type] Bug An existing feature does not function as intended [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Media Anything that impacts the experience of managing media labels Nov 29, 2022
@youknowriad
Copy link
Contributor

cc @ntsekouras as you worked on this, it could be an easy fix (some core-data cache or something).

@ntsekouras
Copy link
Contributor

Actually it's not because the API doesn't use hooks but an async fetch function.

Do you think we should also add support for fetching items by providing a hook? I guess it should be a new prop because both would be functions and they would be mutually exclusive.

@youknowriad
Copy link
Contributor

I see, so far I didn't find that we've been successful in having "hooks" as settings/config. We have for command loaders, and we tried it for bindings but reverted it. It seems we don't have a good answer when it comes to providing "reactive settings". Maybe we could consider observers at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants