Replace global Enable AI toggle with tri-state section master toggles#617
Replace global Enable AI toggle with tri-state section master toggles#617itzmekhokan wants to merge 2 commits into
Conversation
Implements issue WordPress#600 Option B by removing the misleading page-header toggle and adding tri-state section controls that reflect aggregate feature state, while syncing wpai_features_enabled from feature edits.
Add JSDoc param tags and apply prettier formatting required by wp-scripts.
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @manueldiaz2006t-blip. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #617 +/- ##
==========================================
Coverage 73.18% 73.18%
Complexity 1731 1731
==========================================
Files 85 85
Lines 7473 7473
==========================================
Hits 5469 5469
Misses 2004 2004
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:
|

Fixes #600 by implementing Option B from the issue: remove the global Enable AI header toggle and add a tri-state section master toggle to each experiment group.
The header toggle was misleading because it reflected only
wpai_features_enabled, not the aggregate state of sub-features. Section-level controls scale better as more experiment groups are added and align with existing Enable all / Disable all actions.Changes also:
wpai_features_enabledautomatically when feature toggles change (enabled when any feature is on, disabled when none are)Test plan
npm run test:e2e -- tests/e2e/specs/admin/settings.spec.jsnpm run test:php