Skip to content

Media Library: Add Dataviews media library in Site Editor#78972

Open
Vrishabhsk wants to merge 1 commit into
WordPress:trunkfrom
Vrishabhsk:add/media-dataviews
Open

Media Library: Add Dataviews media library in Site Editor#78972
Vrishabhsk wants to merge 1 commit into
WordPress:trunkfrom
Vrishabhsk:add/media-dataviews

Conversation

@Vrishabhsk

Copy link
Copy Markdown
Contributor

What?

Why?

The existing Media Library (upload.php) is a standalone admin screen. This brings media management into the Site Editor using the DataViews component, consistent with how Pages, Templates, and Patterns are already handled.

How?

  • Experiment registration: Added gutenberg-dataviews-media-library experiment flag with PHP bridge to window.__experimentalDataViewsMediaLibrary
  • Route (/media): Registered in the classic Site Editor router (@wordpress/router) with sidebar/content/preview areas, plus v2 extensible site editor menu item and route
  • Left sidebar: All Media, My Files, and File Types filters (Images, Audio, Video, Documents, Spreadsheets, Archives) with count badges, each filtering the DataViews table
  • Data table: Uses <DataViews> with columns for title+thumbnail, author, attached to, comments, and date. Supports table/grid/list layouts, search, sorting, pagination, bulk selection, and download/trash actions
  • Right inspector panel: Shows image preview, description, audit info (uploaded by, dates), and metadata (alt text, caption, file name, format, size, dimensions)
  • Trash fix: fields/src/actions/trash-post.tsx now passes force: true for attachments, which require it to delete

Testing Instructions

  1. Go to wp-admin > Gutenberg > Experiments and enable "Media Library (DataViews)"
  2. Open the Site Editor (Appearance > Design)
  3. The Media nav item appears below Pages in the sidebar
  4. Click Media to see the DataViews-powered media table
  5. Use the left sidebar to filter by My Files or File Types
  6. Click a media item to open the right inspector panel
  7. Use Add New Media button, search, sort, and paginate

Preview

Screenshot 2026-06-05 at 11 41 55 AM

Use of AI Tools

This PR was implemented using the deepseek-v4-flash:cloud model (provided by Ollama) via the opencode agent framework. The PR description was also written by the AI. All code was reviewed and validated before submission.

@Vrishabhsk Vrishabhsk requested a review from spacedmonkey as a code owner June 5, 2026 07:42
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Vrishabhsk <vrishabhsk@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Edit Site /packages/edit-site [Package] Fields /packages/fields

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Media Library: Create a DataViews-powered representation of the media library

1 participant