Skip to content

Hide visual card developer settings when AI is disabled#737

Merged
dkotter merged 3 commits into
WordPress:developfrom
ekamran:shifteq/hide-disabled-visual-card-developer-settings
Jun 17, 2026
Merged

Hide visual card developer settings when AI is disabled#737
dkotter merged 3 commits into
WordPress:developfrom
ekamran:shifteq/hide-disabled-visual-card-developer-settings

Conversation

@ekamran

@ekamran ekamran commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What?

Hide the developer Provider/Model controls for the Image Generation and Editing visual card when the global “Enable AI” setting is turned off.

Why?

When global AI was disabled, the Image Generation and Editing card was shown as disabled, but its developer settings could still appear and be changed.

That made the UI inconsistent: the feature looked disabled, but the Provider/Model controls were still active and could save values.

Other feature settings already hide their developer controls when AI is globally disabled, so this brings the visual card behavior in line with the rest of the settings page.

How?

The visual card now only renders developer settings when:

  • global AI is enabled
  • the visual feature card is enabled
  • Developer Tools / Model selection is enabled

Saved Provider/Model values are not deleted. They are only hidden while global AI is disabled and appear again when AI is enabled.

Testing Instructions

Automated checks run locally:

npm run build
npm run lint:js -- routes/ai-home/stage.tsx tests/e2e/specs/admin/settings.spec.js
npm run typecheck
env WP_BASE_URL=http://localhost:8888 npx playwright test --config tests/e2e/playwright.config.ts tests/e2e/specs/admin/settings.spec.js --project=chromium --grep "Developer mode settings are hidden for disabled visual feature cards" --reporter=line --global-timeout=60000

Manual testing:

  1. Go to Settings > AI.
  2. Enable AI.
  3. Enable Image Generation and Editing.
  4. Enable Developer Tools > Model selection.
  5. Confirm Provider/Model controls appear.
  6. Turn global Enable AI off.
  7. Confirm Image Generation and Editing is checked but disabled.
  8. Confirm Provider/Model controls are hidden.
  9. Turn global Enable AI back on.
  10. Confirm saved Provider/Model values are still preserved when available.

Screenshots / Screencast

Before:

BEFORE

After:

After

Use of AI Tools

AI assistance: Yes
Tool(s): ChatGPT / Codex
Used for: Repository review, reproduction planning, implementation guidance, test updates, and local verification. I reviewed the changes, tested the behavior locally, and take responsibility for the final submission.

Open WordPress Playground Preview

@github-actions

github-actions Bot commented Jun 16, 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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ekamran <ekamran@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

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

@dkotter dkotter added this to the 1.1.0 milestone Jun 17, 2026
dkotter added 2 commits June 17, 2026 15:22
…l settings are turned on first and then AI is disabled. Also cleanup after the tests are done to avoid leaking into other tests
@dkotter dkotter merged commit 172e29d into WordPress:develop Jun 17, 2026
22 checks passed
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.

2 participants