-
Notifications
You must be signed in to change notification settings - Fork 40
Improve AI Experiments page UI with header, accordion, and entry points #153
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
base: develop
Are you sure you want to change the base?
Improve AI Experiments page UI with header, accordion, and entry points #153
Conversation
…oints - Add full-width admin header with AI icon, title, and action buttons - Docs and Contribute links in header for easy access - White background page styling - Update experiment list to grid layout with border separators - Cleaner visual hierarchy with borderless items - Entry point links next to experiment title (Dashboard, Try, etc.) - Settings toggle button with accordion drawer - Add Abstract_Experiment methods for UI extensibility - get_entry_points(): Define contextual links for experiments - has_settings(): Indicate if experiment has custom settings - Add get_ai_icon_svg() helper for inline SVG icons - New _common.scss with shared admin page styles - Header component styles - White page background utilities - Reusable across other admin pages
|
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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #153 +/- ##
=============================================
+ Coverage 46.89% 49.30% +2.41%
- Complexity 208 221 +13
=============================================
Files 19 20 +1
Lines 1271 1298 +27
=============================================
+ Hits 596 640 +44
+ Misses 675 658 -17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add get_entry_points(), has_settings(), render_settings_fields() to Experiment interface - Add false check for file_get_contents() in get_ai_icon_data_uri()
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.
Pull request overview
This PR modernizes the AI Experiments settings page with a polished admin UI, introducing a full-width header section, cleaner experiment grid layout, contextual entry point links, and an accordion-style settings drawer for experiments with custom configurations.
Key Changes:
- Added
get_entry_points()andhas_settings()methods to the Experiment interface and Abstract_Experiment class for UI extensibility - Introduced full-width admin header with AI icon and action buttons (Docs, Contribute)
- Replaced card-per-experiment layout with a unified grid using border separators
- Implemented collapsible settings drawers with toggle buttons and animations
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
includes/Settings/Settings_Page.php |
Added header structure, entry point rendering, and accordion drawer implementation with inline JavaScript |
includes/helpers.php |
Added get_ai_icon_svg() and get_ai_icon_data_uri() helper functions for icon rendering |
includes/Contracts/Experiment.php |
Added interface methods for get_entry_points(), has_settings(), and render_settings_fields() |
includes/Abstracts/Abstract_Experiment.php |
Provided default implementations for new experiment extensibility methods |
src/admin/_common.scss |
New shared admin styles for headers, icons, and white page backgrounds |
src/admin/settings/index.scss |
Updated experiment list to grid layout, added styles for entry points, settings toggle button, and drawer animation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note that we'll likely need another iteration on this as the admin reskin in WP 7.0 continues onward as we'll want to closely align to those updated UI components to ensure AIE presents as a first party plugin for WPORG. |
|
@Jameswlepage do you think the work here can close both #35 and #103? |
|
@jeffpaul No, this doesn't close either issue, it's more of an incremental improvement to the existing PHP-based settings page. That said, I'm in favor of shipping it as-is while we work towards a fully React dashboard. The React implementation (#103) probably warrants more coordination with the Abilities Explorer or MCP work, and should align with more modern WordPress patterns like the new Fonts UI in recent Gutenberg releases, which has its own rendering system using @youknowriad would love your thoughts on the right direction here as we think about modernizing the admin UI. |
|
One thing you can consider here is indeed switching to I don't really think it's mandatory here, it's an experiments page, but if the page starts requiring more and more interaction and you really want to switch to React rendering like the linked issue suggest, you should definitely try to use |
|
Noting that @JasonTheAdams is taking an updated look at the work here in line with @youknowriad's comment, whether that pushes directly to this PR/branch or in a new PR. |
|
I've updated this per @youknowriad's suggestions. This now uses:
Experiments can now register DataForm field format. Documentation has been included on how to do this.
|
|
@dkotter I think it would be a good idea for you to review this as it may impact your other experiment PRs if they contain settings. |
|
Would also prefer to utilize the colored icon from https://github.com/WordPress/ai/tree/develop/.wordpress-org instead of a different "science beaker" one. |
| "wp-phpunit/wp-phpunit": "^6.5", | ||
| "yoast/phpunit-polyfills": "^4.0" | ||
| "yoast/phpunit-polyfills": "^4.0", | ||
| "php-stubs/wordpress-stubs": "^6.9.0" |
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.
Curious why this was needed? We don't include php-stubs/wordpress-stubs directly but it does look like this is already included in our dependency chain
| "plugin-zip": "wp-scripts plugin-zip", | ||
| "build": "wp-scripts build", | ||
| "start": "wp-scripts start", | ||
| "build": "wp-build", |
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.
So unless I'm missing something, changing this build script (and removing the webpack file) breaks all of our experiments, as the JS files they rely on aren't built properly anymore



Summary
This PR enhances the AI Experiments settings page with improved UI and extensibility:
_common.scssfor reuse across AI admin pages (MCP, Request Logs, etc.)Screenshots
The experiments page now has:
Technical Changes
Abstract_Experiment: Addedget_entry_points()andhas_settings()methods for UI extensibilitySettings_Page.php: New header structure, grid layout, entry points display, and accordion drawer with inline JShelpers.php: Addedget_ai_icon_svg()andget_ai_icon_data_uri()helpers for icon rendering_common.scss: New shared styles for admin headers and white page backgroundssettings/index.scss: Updated styles for grid layout, entry point links, settings toggle, and drawer animationDependency Note
The following feature PRs will need to be rebased onto this PR (or updated after merge) as they also modify the experiments page:
These PRs currently include similar header styling changes that would become redundant after this PR merges. They should be updated to:
_common.scssget_entry_points()method to add their entry point linkshas_settings()method if they have custom settingsTest Plan