-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Tart up Gutenberg experiments page #73947
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
Conversation
…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.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
- 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.
|
Flaky tests detected in 2c67fb9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20155123339
|
|
@fabiankaegy was also working on a similar PR: #70711.
Need to try this 😄 |
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. |
talldan
left a comment
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.
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; |
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.
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' ); ?> |
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.
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(); |
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.
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' ), |
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.
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.
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.
|
Also just to mentioned that where I'm from the phrase "Fluff up" can mean "Make a mistake" 😄 |
I think maybe we have too many experiments! Thanks for taking it for a test drive! |
|
Closing in favour of #70711 |

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.
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: