Remove Enable AI header toggle - #985
Conversation
|
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 #985 +/- ##
==========================================
Coverage 81.51% 81.51%
Complexity 2924 2924
==========================================
Files 122 122
Lines 11655 11655
==========================================
Hits 9500 9500
Misses 2155 2155
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:
|
| */ | ||
| final public function is_globally_enabled(): bool { | ||
| return (bool) get_option( Settings_Registration::GLOBAL_OPTION, false ); | ||
| return (bool) get_option( Settings_Registration::GLOBAL_OPTION, true ); |
There was a problem hiding this comment.
So I've not tested things yet so I may be wrong but if someone currently has things set to be globally disabled, it seems like after this update there will be no way for them to actually enable things, since we're removing the UI.
So for new installs and existing installs that were already enabled, those should be fine. But existing installs that purposely disabled things, I think they'll be permanently stuck in that disabled state.
We use the result of this method in the is_enabled method and so that method will always return false in that scenario. And with no UI to enable things, the Settings_Registration::GLOBAL_OPTION value will never be updated.
Honestly not sure on the best approach here. We could change this method to always return true. We could remove this method all together. We could have an upgrade routine to set Settings_Registration::GLOBAL_OPTION to true. And probably other approaches as well I'm not thinking of right now
| <> | ||
| <Stack align="center" gap="xs"> | ||
| <ToggleControl | ||
| label={ __( 'Enable AI', 'ai' ) } |
There was a problem hiding this comment.
So we remove the display of the setting here but we don't actually remove the registration of the setting in includes/Settings/Settings_Registration.php. Should we?
| hasText: 'AI enabled.', | ||
| } ) | ||
| ).toBeVisible(); | ||
| export const enableExperiments = async ( admin?: Admin, page?: Page ) => { |
There was a problem hiding this comment.
Any reason to keep this? Since this does nothing now, thinking it would be better to just get rid of it
What?
Closes #600
Removes the
Enable AIheader toggle from the AI settings page (routes/ai-home/stage.tsx), cleans up remainingglobalEnabledUI disabling logic, and allows individual feature and experiment group toggles to directly control plugin functionality.Why?
The
Enable AIheader 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?
Enable AIheader<ToggleControl>andInfoTipfromroutes/ai-home/stage.tsx.globalToggleDescription,GLOBAL_FIELD_ID,noop, andDisabledTogglecomponent fromstage.tsx.globalEnabledprop and conditions fromSectionActionsandVisualCardToggleinstage.tsx, ensuring individual toggles and bulk action buttons remain interactive..ai-showcase-card--disabledCSS rule fromroutes/ai-home/style.scss.is_globally_enabled()inincludes/Abstracts/Abstract_Feature.phpto default totruewhen option is not explicitly set.tests/e2e/utils/helpers.ts) indisableExperimentsandenableExperimentsto wait for section action buttons to render before counting, correctly capture settings save responses, and toggle showcase cards.tests/e2e/specs/admin/settings.spec.jsto 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
options-general.php?page=ai-wp-admin).Enable AIheader toggle.npm run typecheck,npm run lint:js, andnpm run buildpass without errors.Screenshots or screencast
Changelog Entry