close
Skip to content

Fix bulk alt text no-provider notice#561

Merged
dkotter merged 1 commit into
WordPress:developfrom
ekamran:shifteq/fix-alt-text-bulk-no-provider-notice
May 18, 2026
Merged

Fix bulk alt text no-provider notice#561
dkotter merged 1 commit into
WordPress:developfrom
ekamran:shifteq/fix-alt-text-bulk-no-provider-notice

Conversation

@ekamran
Copy link
Copy Markdown
Contributor

@ekamran ekamran commented May 17, 2026

What?

Updates the bulk Alt Text Generation no-provider message to use an error admin notice.

Why?

When running the Media Library bulk Generate Alt Text action without a configured AI Connector, generation cannot proceed.

The existing message explained the problem, but it used a neutral info notice even though the action failed. Using an error notice makes the state clearer and better matches the severity of the issue.

How?

  • Allows the bulk alt text notice helper to render either info or error notices.
  • Uses an error notice when no AI provider is configured.
  • Adds E2E coverage for the no-provider bulk action path.

Use of AI Tools

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

Testing Instructions

  1. Use WordPress 7.0 RC4.
  2. Ensure no AI Connector API key is configured.
  3. Enable AI features and the Alt Text Generation experiment.
  4. Open Media Library in list view.
  5. Select one or more images.
  6. Choose Generate Alt Text from the bulk actions dropdown.
  7. Click Apply.
  8. Confirm an error notice appears explaining that an AI Connector is required.

Automated checks run locally:

  • npm run lint:js -- src/experiments/alt-text-generation/bulk.ts tests/e2e/specs/experiments/alt-text-generation.spec.js
  • npm run typecheck
  • npm run build
  • npm run test:e2e -- tests/e2e/specs/experiments/alt-text-generation.spec.js --project=chromium --grep "Bulk action shows an error notice when no provider is configured"

Screenshots or screencast

Before

No provider is configured. The bulk action cannot generate alt text, but the message appears as an info notice.

before

After

No provider is configured. The same message appears as an error notice.

after Open WordPress Playground Preview

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

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>

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.21%. Comparing base (19ae2eb) to head (8d67c57).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #561   +/-   ##
==========================================
  Coverage      71.21%   71.21%           
  Complexity      1151     1151           
==========================================
  Files             67       67           
  Lines           5565     5565           
==========================================
  Hits            3963     3963           
  Misses          1602     1602           
Flag Coverage Δ
unit 71.21% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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 added this to the 1.0.0 milestone May 18, 2026
@dkotter dkotter merged commit 55c4705 into WordPress:develop May 18, 2026
18 checks passed
@ekamran ekamran deleted the shifteq/fix-alt-text-bulk-no-provider-notice branch May 18, 2026 19:06
simison pushed a commit to simison/ai that referenced this pull request May 25, 2026
Changed - When no provider is configured, show an error notice instead of an admin notice for alt text generation

Co-authored-by: ekamran <ekamran@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
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