Skip to content

Alt Text Generation: Integrate with Decorative Image settings - #1031

Merged
dkotter merged 10 commits into
WordPress:developfrom
yogeshbhutkar:gh-1030/integrate-alt-generation-with-decorative-images
Sep 18, 2026
Merged

dkotter merged 10 commits into
WordPress:developfrom
yogeshbhutkar:gh-1030/integrate-alt-generation-with-decorative-images

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What, Why, and How?

Closes #1030

This PR integrates Alt Text Generation with the Image block’s decorative setting. It disables generation for images marked as decorative and prevents applying an existing suggestion after the image is marked decorative. When AI identifies an image as decorative, it presents a suggestion with a “Mark as decorative” action, keeping the decision with the user.

The action mirrors core by clearing alt text and setting caption and link attributes to undefined. If supported, it also sets isDecorative, leaving core to render role="none" on the front-end. On editors without support, it clears the same attributes but omits the flag (isDecorative).

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-6 Astra
Used for: Multiple rounds of code-reviews to stress test the changes, and to generate the PR description.

Testing Instructions

  1. Enable Alt Text Generation and configure an AI provider.
  2. Add an Image block with alt text, a caption, and a link.
  3. Mark it decorative and verify generation is disabled.
  4. Unmark it and verify generation is enabled.
  5. Trigger a decorative AI response and verify the suggestion appears.
  6. Accept the suggestion and verify alt text, caption, and link are cleared.
  7. Save and reload. Verify the decorative setting persists and core renders role="none".
  8. On an unsupported editor, verify the same fields clear without setting isDecorative.

Screencast

alt-text-screencast.mp4

Changelog Entry

Changed - Integrates Alt Text Generation with the Image block’s decorative setting.

Open WordPress Playground Preview

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.72%. Comparing base (b71f930) to head (b69779d).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #1031   +/-   ##
==========================================
  Coverage      80.72%   80.72%           
  Complexity      2998     2998           
==========================================
  Files            124      124           
  Lines          11978    11978           
==========================================
  Hits            9669     9669           
  Misses          2309     2309           
Flag Coverage Δ
unit 80.72% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@yogeshbhutkar
yogeshbhutkar force-pushed the gh-1030/integrate-alt-generation-with-decorative-images branch from bae65a4 to 165492f Compare September 15, 2026 08:00
@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review September 15, 2026 08:40
@yogeshbhutkar
yogeshbhutkar requested a review from a team September 15, 2026 08:40
@github-actions

github-actions Bot commented Sep 15, 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: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments to discuss.

May be nice also to add E2E tests specific to these decorative paths to ensure they work. And documentation could also be updated to mention this.

Comment thread src/experiments/alt-text-generation/components/AltTextControls.tsx Outdated
Comment thread src/experiments/alt-text-generation/components/AltTextControls.tsx
@yogeshbhutkar
yogeshbhutkar force-pushed the gh-1030/integrate-alt-generation-with-decorative-images branch from 374e17d to e5997b4 Compare September 18, 2026 07:58
@dkotter dkotter added this to the 1.4.0 milestone Sep 18, 2026
@dkotter
dkotter merged commit 12417cb into WordPress:develop Sep 18, 2026
33 checks passed
@yogeshbhutkar
yogeshbhutkar deleted the gh-1030/integrate-alt-generation-with-decorative-images branch September 18, 2026 17:50
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.

Integrate Alt Text Generation with WP 7.1 decorative image support

2 participants