Clarify global AI toggle as a master switch (#600) - #798
Conversation
The global header toggle was labeled "Enable AI", an imperative that implied it switched every feature on. Because it binds to a single `wpai_features_enabled` option and is never derived from sub-feature state, it always rendered solid-on even when only some features were enabled, misrepresenting the configuration. Relabel it to "AI features enabled" so the control reads as a master on/off state rather than an aggregate of the individual feature toggles. The existing InfoTip already documents the master-switch behavior. Update the e2e label locators and add a regression test asserting the toggle stays on when a single feature is turned off.
|
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 #798 +/- ##
==========================================
Coverage 76.48% 76.48%
Complexity 1869 1869
==========================================
Files 89 89
Lines 7990 7990
==========================================
Hits 6111 6111
Misses 1879 1879
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@dhrupo Thanks for the PR. Can you ensure the PR description follows our template? Looks like multiple sections are missing or are incomplete right now: https://github.com/WordPress/ai/blob/develop/.github/PULL_REQUEST_TEMPLATE.md |
|
@dkotter thanks for the review! I've updated the description to follow the PR template — all sections are now filled in (What / Why / How / Use of AI Tools / Testing Instructions / Screenshots / Changelog Entry). Let me know if anything still looks incomplete. |
dkotter
left a comment
There was a problem hiding this comment.
If we're going to update this label, I think it needs to be dynamic depending on the state. For example, if I have things globally disabled, the label now says AI features enabled, which is incorrect:
I personally don't think we need to change what we have but if we are going to change the label, I'd suggest we make that dynamic based on the toggle state and have it be either AI enabled or AI disabled
Any thoughts on this @jeffpaul?
|
Punting out a release to continue discussion on the linked issue from #600 (comment). |
What?
Closes #600
Relabels the global header toggle on Settings → AI from "Enable AI" to "AI features enabled", so the control reads as a master on/off state rather than an imperative implying it switches on every feature.
Why?
The toggle binds to a single
wpai_features_enabledoption and is never derived from the individual feature states, so it always renders solid-on even when only some features are enabled — misrepresenting the configuration (the reported problem). The imperative label "Enable AI" reinforced that misreading.On the issue, @gziolo suggested the control should "reflect the state 'AI enabled'" and @dkotter agreed. This implements that with a minimal label change; the existing InfoTip next to the toggle already documents the master-switch behavior. It intentionally avoids the per-section toggles attempted in #617, which were closed as duplicative with the existing Enable all / Disable all buttons.
How?
routes/ai-home/stage.tsx: change the global toggle's label from__( 'Enable AI', 'ai' )to__( 'AI features enabled', 'ai' ).tests/e2e/utils/helpers.tsandtests/e2e/specs/admin/settings.spec.js: update the label locators, and add a regression test asserting the master toggle stays checked when a single feature is turned off (proving it is a master switch, not an aggregate).Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.x
Used for: Implementation, tests, and drafting this PR description — reviewed, tested, and edited by me.
Testing Instructions
Screenshots or screencast
Changelog Entry