-
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
[Inserter]: Add media tab #44918
[Inserter]: Add media tab #44918
Conversation
Size Change: +3.02 kB (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
// TODO: Even though the `mature` param is `false` by default, we might need to determine where | ||
// and if there is other 'weird' content like in the title. It happened for me to test with `skate` | ||
// and the first result contains a word in the title that might not be suitable for all users. |
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 a difficult problem I can speak to a bit. There are two sources in Openverse that contain user-uploaded content:
- Flickr
- Wikimedia Commons
These are two of the largest sources in Openverse1, but both can contain 'mature' images that aren't correctly labeled as such. This goes beyond curse words, like you've identified in your example, and can potentially include explicit images of a sexual or violent nature.
The fastest fix here I would reccommend, which is unfortunate because it excludes hundreds of millions of works, would be to exclude Flickr with the ?excluded_source=flickr
2 parameter. I think that would be a fine place to start while Openverse develops further methods for removing or hiding behind the mature flag these incorrectly categorized images.
Openverse is a search engine, not a gallery of curated content, so there are still possibilities that a result could be insensitive, in poor taste, or unexpected even after these changes. Or even more simply, low-quality! In light of this it's always possible that it might be useful to show some disclaimer on the page.
Finally, while probably too much for v1, we do have an API endpoint for reporting media that would be wonderful to include, so users could help surface any results which are inappropriate or violate copyright, as examples.
Footnotes
-
See https://wordpress.org/openverse/sources for a full list of sources and their media totals. ↩
-
For more info on this search parameter, see: https://api.openverse.engineering/v1/#operation/image_search ↩
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.
Thanks for the explanation!
Finally, while probably too much for v1, we do have an API endpoint for reporting media that would be wonderful to include, so users could help surface any results which are inappropriate or violate copyright, as examples.
This is a great idea, and even if we don't implement it initially I'll add a TODO item to design a report mechanism and a disclaimer message.
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.
That's great info Zack, thank you!
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.
Left some comments regarding mature/explicit results here.
packages/block-editor/src/components/inserter/media-tab/hooks.js
Outdated
Show resolved
Hide resolved
c7e5b7c
to
cf8aa92
Compare
Nice! This is coming together fast: I see that this is already on the todo list, but wanted to mention the margin around the media library button: I don't know that it has to be in this PR, but we also need to remove the explicit tab for "Reusable", and make it a category under "Blocks" instead: CC: @javierarce as you worked on this also. |
This won't be handled here. This PR is already quite big and will have much more code to implement the missing stuff.. |
@ntsekouras it might be fine to split the openverse into its own branch to ensure it doesn't become blocking. We'd need to ensure it's easy to disable, test thoroughly, etc. |
cf8aa92
to
1d93f10
Compare
In case this went unnoticed: if the library doesn't contain any media, the sidebar appears completely empty, without the Openverse item. I wonder if in this case, we should show a message indicating that the library is empty, as to make sure users understand that once they add assets they'll appear there. |
I'm actually working on this right now and have moved the check if media exist on an 'upper' level, so it won't be shown. Also as suggested by @mtias, I'll remove the Openverse integration from this PR and will do it in a follow up. |
08dfc1e
to
1ff89b9
Compare
How can we move this forward? The main issue for me now(besides a technical thing with the Media Library modal) is how to handle the search input design wise.
If we want to have a single search input, I'll have to do first a separate PR to handle this. |
packages/block-editor/src/components/inserter/media-tab/media-list.js
Outdated
Show resolved
Hide resolved
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.
Can we add a small e2e test covering this. Just inserting an image basically from the inserter and checking that the results is ok?
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.
Nice work!
Any plans to invalidate the fetched media data? Right now, if I add an image to my library, I can't get it to appear in the new tab without a reload.
packages/editor/src/components/provider/use-block-editor-settings.js
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/inserter/media-tab/hooks.js
Outdated
Show resolved
Hide resolved
I don't think so right now because it would need to subscribe to stores and has more implications. I think it's a small compromise for now and we can explore this in the future. |
Co-authored-by: Miguel Fonseca <[email protected]>
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 looking good to me.
Nice work! |
I've created an issue to keep track of this. |
What?
Resolves: #44496
This PR adds a new
media
tab to the inserter(when applicable) so a user can add media from their library, have a button to open the old library modal.I followed the patterns redesign and a11y improvements from here.
Tasks
caption
enhancement because it gains focus on insertion right now(related: Layout jumps when selecting an image #44359)Notes
margin
, leaving empty space inside the previews. Not sure yet how we'll handle this.Tasks to be moved for the Openverse integration
Current status of the PR (18 October 2022)
Screen.Recording.2022-10-18.at.12.41.35.PM.mov