Skip to content

Templates DataView: Fix status filter options and chip label - #78739

Closed
himanshupathak95 wants to merge 1 commit into
WordPress:trunkfrom
himanshupathak95:fix/73133-templates-dataview-status-filter-elements
Closed

himanshupathak95 wants to merge 1 commit into
WordPress:trunkfrom
himanshupathak95:fix/73133-templates-dataview-status-filter-elements

Conversation

@himanshupathak95

Copy link
Copy Markdown
Contributor

What?

Closes #73133

Fixes the broken Status filter in the Templates DataView when the Template Activation experiment is enabled.

Why?

activeField (the "Status" column) was typed as type: 'boolean' but had no elements array. DataViews requires elements to populate the filter dropdown and format the filter chip. Without them:

  • The filter showed no selectable options
  • The chip displayed "Status is: Status" (the raw boolean formatter's output)

How?

Added an elements array to activeField:

elements: [
    { value: true,  label: _x( 'Active',   'template status' ) },
    { value: false, label: _x( 'Inactive', 'template status' ) },
],

Testing Instructions

  1. Enable the Template Activation experiment (Gutenberg → Experiments)
  2. Site Editor → Templates → Add filter → Status
  3. Verify: "Active" and "Inactive" appear as options
  4. Select "Active" → chip shows "Status is: Active", all active templates visible
  5. Select "Inactive" → chip shows "Status is: Inactive", "No results"

Screenshots or screencast

Before

Screen.Recording.2026-05-27.at.20.10.55.mov

After

Screen.Recording.2026-05-27.at.20.10.28.mov

@github-actions github-actions Bot added the [Package] Edit Site /packages/edit-site label May 27, 2026
@himanshupathak95
himanshupathak95 marked this pull request as ready for review May 27, 2026 14:44
@github-actions

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: himanshupathak95 <abcd95@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>

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

@github-actions

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: [Package] Edit Site.

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.

@youknowriad

Copy link
Copy Markdown
Contributor

Thanks for your contribution. That experiment has been removed for now #82241 so I'm closing the PR.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Templates Dataview: Status filter is broken

2 participants