Skip to content

Remove Enable AI header toggle - #985

Merged
jeffpaul merged 19 commits into
WordPress:developfrom
wprashed:fix/600-remove-enable-ai-header-toggle
Sep 29, 2026
Merged

jeffpaul merged 19 commits into
WordPress:developfrom
wprashed:fix/600-remove-enable-ai-header-toggle

Conversation

@wprashed

@wprashed wprashed commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

What?

Closes #600

Removes the Enable AI header toggle from the AI settings page (routes/ai-home/stage.tsx), cleans up remaining globalEnabled UI disabling logic, and allows individual feature and experiment group toggles to directly control plugin functionality.

Why?

The Enable AI header toggle displayed a binary ON/OFF state that did not accurately reflect individual feature configurations. Per maintainer consensus in #600, this PR removes the global header toggle entirely, allowing individual feature toggles and category group toggles (or deactivating the plugin / using core filters) to manage functionality.

How?

  • Removed the Enable AI header <ToggleControl> and InfoTip from routes/ai-home/stage.tsx.
  • Removed unused globalToggleDescription, GLOBAL_FIELD_ID, noop, and DisabledToggle component from stage.tsx.
  • Removed globalEnabled prop and conditions from SectionActions and VisualCardToggle in stage.tsx, ensuring individual toggles and bulk action buttons remain interactive.
  • Removed .ai-showcase-card--disabled CSS rule from routes/ai-home/style.scss.
  • Updated is_globally_enabled() in includes/Abstracts/Abstract_Feature.php to default to true when option is not explicitly set.
  • Updated Playwright E2E helpers (tests/e2e/utils/helpers.ts) in disableExperiments and enableExperiments to wait for section action buttons to render before counting, correctly capture settings save responses, and toggle showcase cards.
  • Updated tests/e2e/specs/admin/settings.spec.js to assert section button states and removed the obsolete test for disabled global bulk actions.

Use of AI Tools

AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini 2.5 Pro
Used for: Diagnosing E2E test failures, updating settings UI components and E2E test assertions, and structuring the PR according to repository guidelines.

Testing Instructions

  1. Go to the AI settings page (options-general.php?page=ai-wp-admin).
  2. Confirm the header renders cleanly with Docs, Contribute, and options links, without the Enable AI header toggle.
  3. Confirm section group toggles ("Enable all" / "Disable all") and individual feature toggles are enabled and continue to work as expected.
  4. Verify that running npm run typecheck, npm run lint:js, and npm run build pass without errors.

Screenshots or screencast

Before After
Header includes "Enable AI" toggle Header has no "Enable AI" toggle; features are managed via section buttons and toggles

Changelog Entry

Removed - The Enable AI header toggle from the AI settings page.

Open WordPress Playground Preview

@wprashed
wprashed requested a review from a team August 30, 2026 07:08
@github-actions

github-actions Bot commented Aug 30, 2026 •

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: wprashed <wprashed@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
Co-authored-by: andreilupu <euthelup@git.wordpress.org>
Co-authored-by: JasonTheAdams <jason_the_adams@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 Aug 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.53%. Comparing base (747f943) to head (f54fa5f).

Files with missing lines Patch % Lines
includes/Admin/Upgrades/V1_4_0.php 95.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #985      +/-   ##
=============================================
- Coverage      81.57%   81.53%   -0.04%     
+ Complexity      3077     3071       -6     
=============================================
  Files            129      129              
  Lines          12267    12253      -14     
=============================================
- Hits           10007     9991      -16     
- Misses          2260     2262       +2     
Flag Coverage Δ
unit 81.53% <96.87%> (-0.04%) ⬇️

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

E2E tests are failing here.

In addition, please ensure the PR description contains everything from our PR template, as already mentioned here

@jeffpaul jeffpaul added this to the 1.4.0 milestone Sep 3, 2026
Comment thread includes/Abstracts/Abstract_Feature.php Outdated
Comment thread routes/ai-home/stage.tsx
Comment thread tests/e2e/utils/helpers.ts Outdated
@jeffpaul

Copy link
Copy Markdown
Member

@wprashed this ideally gets into the 1.4.0 release, noting that are you able to make updates here from latest code review?

@jeffpaul jeffpaul mentioned this pull request Sep 29, 2026
21 of 24 tasks
@dkotter
dkotter requested a review from jeffpaul as a code owner September 29, 2026 17:46
@dkotter

dkotter commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@jeffpaul I've taken this one over to get it across the finish line. Quite a bit more was left, mostly a bunch of code (especially tests) that could now be removed. Over to you for a quick test to ensure this functions the way you'd expect

@jeffpaul jeffpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works well (or rather no longer stops things from working I guess), thanks!

@jeffpaul
jeffpaul merged commit a880957 into WordPress:develop Sep 29, 2026
34 checks passed
jorgefilipecosta added a commit that referenced this pull request Sep 30, 2026
develop removed the global Enable AI toggle and its `enableExperiments()`
helper (#985), and dropped the call from the sibling ability specs. Do the
same here, so the spec runs against develop.
whyisjake added a commit that referenced this pull request Sep 30, 2026
Resolve the one conflict: develop edited
tests/e2e/specs/experiments/abilities-explorer.spec.js for #985, while
this branch had already split that spec into four files, so it stays
deleted.

#985 also removed the global "Enable AI" toggle and its e2e helpers.
Carry that into this branch's own tests the way #985 did for the other
experiments:

- Drop AI_WorkspaceTest::test_global_toggle_off_prevents_registration and
  the "is unreachable when AI is globally off" e2e test, since there is
  no global switch left to turn off.
- Remove the enableExperiments() and disableExperiments() calls from the
  AI Workspace e2e specs, keeping the per-experiment enable and disable.
- Stop setting the no longer registered wpai_features_enabled option in
  AI_WorkspaceTest, the Abilities Explorer controller test and the
  Explorer's e2e setup.
- Name the enableExperiment() helper in the docs instead of the removed
  enableExperiments().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeffpaul

jeffpaul commented Oct 5, 2026

Copy link
Copy Markdown
Member

@manueldiaz2006t-blip if you can connect your GitHub and WPORG accounts then I can ensure your work is properly credited in this AI plugin release.

jorgefilipecosta added a commit that referenced this pull request Oct 5, 2026
develop removed the global Enable AI toggle and its `enableExperiments()`
helper (#985), and dropped the call from the sibling ability specs. Do the
same here, so the spec runs against develop.
jorgefilipecosta added a commit that referenced this pull request Oct 6, 2026
develop removed the global Enable AI toggle and its `enableExperiments()`
helper (#985), and dropped the call from the sibling ability specs. Do the
same here, so the spec runs against develop.
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.

Remove Enable AI header toggle, allow feature/experiment toggles (and group toggles) to control plugin functionality

3 participants