close
Skip to content

Fix Alt-Text generation on decorative images resulting in false error message in Media Lib#559

Merged
dkotter merged 1 commit into
WordPress:developfrom
Intenzi:fix/decorative-img-alt-text-generation-in-media-lib
May 15, 2026
Merged

Fix Alt-Text generation on decorative images resulting in false error message in Media Lib#559
dkotter merged 1 commit into
WordPress:developfrom
Intenzi:fix/decorative-img-alt-text-generation-in-media-lib

Conversation

@Intenzi
Copy link
Copy Markdown
Contributor

@Intenzi Intenzi commented May 15, 2026

What?

Closes #557

This PR resolves the false image alt-text generation error observed when an image is decorative.

Why?

It improves the UX flow and ensures the ambiguous error is fixed.

How?

  • Utilises generateAltText() method in media.ts and bulk.ts of alt-text-generation experiment.
  • Adds 'Image identified as decorative. Alt text cleared.' text in media library to enhance UX and properly resolve the earlier ambiguous error.

Use of AI Tools

Testing Instructions

  1. Configure an AI Connector and enable the Alt Text Generation experiment.
  2. Upload an image the model is likely to mark decorative (e.g. a thin divider line, a solid color block, a purely ornamental flourish).
  3. Single image: open the attachment in the Media Library, click Generate in the alt text panel.
  • Observe: "Image identified as decorative. Alt text cleared" success result.

Screenshots or screencast

image

Changelog Entry

Fixed - False error for Alt-Text generation on decorative images in media library

Open WordPress Playground Preview

- Add image identified as decorative text for better UX in media lib.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.21%. Comparing base (7888332) to head (6fcb228).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #559   +/-   ##
==========================================
  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.

@Intenzi Intenzi marked this pull request as ready for review May 15, 2026 12:59
@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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @antoniomilev.

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

Co-authored-by: Intenzi <intenzi@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.0.0 milestone May 15, 2026
@dkotter dkotter merged commit 6a0e48b into WordPress:develop May 15, 2026
31 of 32 checks passed
simison pushed a commit to simison/ai that referenced this pull request May 25, 2026
…WordPress#559)

Fixed - False error for alt text generation on decorative images in media library.

Unlinked contributors: antoniomilev.

Co-authored-by: Intenzi <intenzi@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.

Alt text generation fails on decorative (or empty) image results in Media Library (single + bulk)

2 participants