Skip to content

Return decorative flag for generated alt text#659

Merged
dkotter merged 3 commits into
WordPress:developfrom
yusufhay:fix/alt-text-decorative-flag
Jun 4, 2026
Merged

Return decorative flag for generated alt text#659
dkotter merged 3 commits into
WordPress:developfrom
yusufhay:fix/alt-text-decorative-flag

Conversation

@yusufhay

@yusufhay yusufhay commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What?

Returns is_decorative: false for non-decorative alt text generation results.

Why?

The alt text ability output schema includes is_decorative as a boolean. The decorative-image path already returns is_decorative: true, but the normal generated-alt-text path omitted the field. Returning false makes the runtime response shape consistent with the schema and easier for consumers to handle.

How?

Adds is_decorative => false to the non-decorative return value from the alt text generation ability. Adds an integration test with a test-only subclass that stubs image lookup and AI generation, then verifies the non-decorative response includes is_decorative: false.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex / ChatGPT
Model(s): GPT-5
Used for: Comparing the output schema with runtime return values, drafting the minimal response-shape fix, and adding focused test coverage. I reviewed the change and PR description before submitting.

Testing Instructions

  1. Install and activate this PR build of the AI plugin.
  2. Enable Alt Text Generation and connect a provider that supports vision/text generation.
  3. Generate alt text for a normal non-decorative image.
  4. Confirm the generated alt text still appears as before.
  5. Inspect the ability response and confirm it includes is_decorative: false.
  6. Generate or mock a decorative-image response and confirm the existing is_decorative: true behavior is unchanged.

Screenshots or screencast

Not applicable. This PR does not change the UI.

Changelog Entry

Fixed - Return a consistent decorative flag from alt text generation results.

Open WordPress Playground Preview

@github-actions

github-actions Bot commented Jun 3, 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: yusufhay <yusufmudagal@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 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

@yusufhay Thanks for the PR. I see you've opened a number of recent PRs and it seems that none of them utilize our PR template. Can you update all of these to provide the information we request, see https://raw.githubusercontent.com/WordPress/ai/refs/heads/develop/.github/PULL_REQUEST_TEMPLATE.md.

In particular, extremely useful to have the Use of AI Tools section, proper Testing Instructions (this should not be code scanning commands as those run automatically on each PR but should be manual test steps) and a proper Changelog Entry (all other sections are also nice to have)

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.68%. Comparing base (64e8032) to head (677125e).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #659      +/-   ##
=============================================
+ Coverage      74.57%   74.68%   +0.10%     
  Complexity      1754     1754              
=============================================
  Files             85       85              
  Lines           7548     7549       +1     
=============================================
+ Hits            5629     5638       +9     
+ Misses          1919     1911       -8     
Flag Coverage Δ
unit 74.68% <100.00%> (+0.10%) ⬆️

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.1.0 milestone Jun 4, 2026
@dkotter dkotter merged commit 1e81450 into WordPress:develop Jun 4, 2026
23 of 24 checks passed
jorgefilipecosta pushed a commit that referenced this pull request Jun 15, 2026
Changed - Return a consistent decorative flag from alt text generation results

Co-authored-by: yusufhay <yusufmudagal@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