Skip to content

Clarify global AI toggle as a master switch (#600) - #798

Open
dhrupo wants to merge 1 commit into
WordPress:developfrom
dhrupo:fix/600-honest-ai-master-toggle
Open

Clarify global AI toggle as a master switch (#600)#798
dhrupo wants to merge 1 commit into
WordPress:developfrom
dhrupo:fix/600-honest-ai-master-toggle

Conversation

@dhrupo

@dhrupo dhrupo commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

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_enabled option 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.ts and tests/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

  1. Go to Settings → AI.
  2. Confirm the header control reads "AI features enabled" (not "Enable AI").
  3. Enable AI, then enable only a subset of features; confirm the control still reads as a master switch (hover the info icon to see it governs all features).
  4. Toggle a single feature off and confirm the master control is unaffected.

Screenshots or screencast

Before After
Header control labeled "Enable AI" Header control labeled "AI features enabled"

Changelog Entry

Changed - Settings: the global AI control is now labeled "AI features enabled" to clarify it is a master switch rather than a summary of individual feature states.

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.
@github-actions

Copy link
Copy Markdown

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.

Unlinked Accounts

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

Unlinked contributors: manueldiaz2006t-blip.

Co-authored-by: dhrupo <dhrupo@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>

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

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.48%. Comparing base (ea79289) to head (d70a6d0).

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           
Flag Coverage Δ
unit 76.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dkotter

dkotter commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@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

@jeffpaul jeffpaul added this to the 1.1.0 milestone Jun 29, 2026
@jeffpaul jeffpaul mentioned this pull request Jun 29, 2026
32 tasks
@dkotter dkotter modified the milestones: 1.1.0, 1.2.0 Jun 29, 2026
@dhrupo

dhrupo commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@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 dkotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:

Image

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?

@jeffpaul jeffpaul modified the milestones: 1.2.0, 1.3.0 Jul 13, 2026
@jeffpaul

Copy link
Copy Markdown
Member

Punting out a release to continue discussion on the linked issue from #600 (comment).

@dkotter dkotter modified the milestones: 1.3.0, Future Release Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable AI header toggle doesn't reflect aggregate state of sub-features

3 participants