Skip to content

Conversation

@ramonjd
Copy link
Member

@ramonjd ramonjd commented Dec 12, 2025

Note

This is a bit of a YOLO PR. Take it or leave it. I like it. I also like avocado on toast with vegemite.

What?

This PR to brush up the Gutenberg experiments page is itself an experiment.

  • Introduced a structured way to register experiments with categories and dependencies.
  • Enhanced the UI for the experiments page, including search functionality and improved layout.
  • Added detailed descriptions and dependency warnings for experiments.
  • Implemented dynamic filtering of experiments based on user input and enabled status.
  • Improved overall user experience with better visual feedback and organization of experiments.

Question: do we need any more documentation about how to create and enable experiments? I just added some inline PHP comments.

Why?

Make thing look nice.

Why not use dataviews?

I thought about it. And decided not to.

Too many new REST routes, to much faffing about with fields and stuff. It'd be nice to use WordPress components, but this is about experiments. It's meant to be a time bomb.

How?

Mostly Claude.

Testing Instructions

Enable experiments and make sure they work!

Screenshots or screencast

Watch me click around aimlessly!

Kapture.2025-12-12.at.13.56.42.mp4

A before snapshot:

Screenshot 2025-12-12 at 2 01 03 pm

…nd UI improvements

- Introduced a structured way to register experiments with categories and dependencies.
- Enhanced the UI for the experiments page, including search functionality and improved layout.
- Added detailed descriptions and dependency warnings for experiments.
- Implemented dynamic filtering of experiments based on user input and enabled status.
- Improved overall user experience with better visual feedback and organization of experiments.
@ramonjd ramonjd self-assigned this Dec 12, 2025
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

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: ramonjd <[email protected]>
Co-authored-by: talldan <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

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

@ramonjd ramonjd added the [Type] Experimental Experimental feature or API. label Dec 12, 2025
- Added important notes on accessing experiment status from the block editor.
- Improved code formatting for better readability and consistency.
- Updated comments to clarify the purpose of various functions and parameters.
- Updated comments to clarify the process of adding new experiments.
- Enhanced function documentation for better understanding of experiment definitions.
- Added notes on configuration and custom filters for improved usability.
@github-actions
Copy link

Flaky tests detected in 2c67fb9.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20155123339
📝 Reported issues:

@Mamaduka
Copy link
Member

@fabiankaegy was also working on a similar PR: #70711.

I also like avocado on toast with vegemite.

Need to try this 😄

@ramonjd
Copy link
Member Author

ramonjd commented Dec 12, 2025

@fabiankaegy was also working on a similar PR: #70711.

Oh dang, I can close this then. I did think of dataviews, but was too lazy.

@Mamaduka
Copy link
Member

Oh dang, I can close this then. I did think of dataviews, but was too lazy.

I think each PR has its own pros and cons. I would say let's keep it open for feedback.

Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a really nice improvement, way better than it was, but this is quite a lot of code for something that should maybe be kept simple 🤔

// Count active_templates separately
if ( gutenberg_is_experiment_enabled( 'active_templates' ) ) {
++$enabled_count;
++$total_count;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

total_count shouldn't increment only when the experiment is active.

When I tested the total increases from 15 to 16 on activating this experiment.

<div class="experiments-controls">
<div class="experiments-search">
<label for="experiments-search-input" class="screen-reader-text">
<?php echo esc_html__( 'Search experiments', 'gutenberg' ); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search feels a bit like overkill, I think there probably shouldn't be that many experiments 😄

$options = get_option( 'gutenberg-experiments', array() );

// Group experiments by category
$experiments_by_category = array();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could alternatively structure the config so that it's by category, I think that simplifies things a bit.

edit: although I saw something about some experiments being dynamically added, so perhaps that's not possible.

<?php
printf(
/* translators: %s: Name of required experiment */
esc_html__( 'This experiment requires "%s" to be enabled.', 'gutenberg' ),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text blends in to the description a bit too much for me, I think it'd be nice if it were separate and maybe in italics.

Image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I wonder if the dependencies could only appear when the parent experiment is selected, but you don't have to go too nuts. I expect these kind of dependent experiments won't be common.

@talldan
Copy link
Contributor

talldan commented Dec 12, 2025

Fluff up Gutenberg experiments page

Also just to mentioned that where I'm from the phrase "Fluff up" can mean "Make a mistake" 😄

@ramonjd
Copy link
Member Author

ramonjd commented Dec 12, 2025

is quite a lot of code for something that should maybe be kept simple

I think maybe we have too many experiments! Thanks for taking it for a test drive!

@ramonjd ramonjd changed the title Fluff up Gutenberg experiments page Tart up Gutenberg experiments page Dec 12, 2025
@ramonjd
Copy link
Member Author

ramonjd commented Dec 12, 2025

Closing in favour of #70711

@ramonjd ramonjd closed this Dec 12, 2025
@ramonjd ramonjd deleted the try/doll-up-experiments-page branch December 12, 2025 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants