Skip to content

Remove Enable AI header toggle - #985

Open
wprashed wants to merge 9 commits into
WordPress:developfrom
wprashed:fix/600-remove-enable-ai-header-toggle
Open

Remove Enable AI header toggle#985
wprashed wants to merge 9 commits into
WordPress:developfrom
wprashed:fix/600-remove-enable-ai-header-toggle

Conversation

@wprashed

@wprashed wprashed commented Aug 30, 2026

Copy link
Copy Markdown

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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.55%. Comparing base (a7657e1) to head (41cbb0e).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #985   +/-   ##
==========================================
  Coverage      75.55%   75.55%           
  Complexity      3381     3381           
==========================================
  Files            138      138           
  Lines          13081    13081           
==========================================
  Hits            9883     9883           
  Misses          3198     3198           
Flag Coverage Δ
unit 75.55% <100.00%> (ø)

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