Skip to content

Move the Generate Alt Text button to the new Content tab #306

Merged
dkotter merged 2 commits intoWordPress:developfrom
dkotter:fix/alt-text-placement
Mar 17, 2026
Merged

Move the Generate Alt Text button to the new Content tab #306
dkotter merged 2 commits intoWordPress:developfrom
dkotter:fix/alt-text-placement

Conversation

@dkotter
Copy link
Copy Markdown
Collaborator

@dkotter dkotter commented Mar 13, 2026

What?

Closes #252

Moves the Generate Alt Text button and other components to the Content tab instead of the Settings tab

Why?

It appears in WordPress 7.0, block settings are now in three tabs: Content, Settings, Styles. If you don't specify the tab you want, it defaults to Settings.

For our Alt Text Generation Experiment, this meant the process of generating alt text happens in a tab separate from the actual alt text field, which isn't ideal. This PR updates our code to ensure it loads in the Content tab instead.

How?

  • Add group="content" to our InspectorControls component
  • Remove some unneeded extra top spacing
  • Fix tests

Use of AI Tools

Claude Code running Sonnet 4.6 investigated what changed in WP 7.0 and put together the plan. I then executed that plan as it was just a simple one line change.

Testing Instructions

  1. Checkout this branch and run npm i && npm run build
  2. Setup a proper connector with credentials
  3. Turn on the alt text generation experiment
  4. Create a new post and insert an image block, selecting or uploading an image
  5. Once inserted into the editor, find the block settings in the sidebar
  6. Ensure you see a Generate Alt Text button in the same panel as the actual alt text field
  7. If desired, ensure generating alt text still works as expected, though that isn't changed in this PR

Screenshots

Generate alt text button showing in the image block settings content tab Open WordPress Playground Preview

@dkotter dkotter added this to the 0.6.0 milestone Mar 13, 2026
@dkotter dkotter self-assigned this Mar 13, 2026
@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: 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.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.03%. Comparing base (f2b29e6) to head (d368843).
⚠️ Report is 20 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #306   +/-   ##
==========================================
  Coverage      58.03%   58.03%           
  Complexity       576      576           
==========================================
  Files             37       37           
  Lines           2955     2955           
==========================================
  Hits            1715     1715           
  Misses          1240     1240           
Flag Coverage Δ
unit 58.03% <ø> (ø)

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 requested a review from jeffpaul March 13, 2026 19:45
@dkotter dkotter merged commit df06cb5 into WordPress:develop Mar 17, 2026
17 of 19 checks passed
@dkotter dkotter deleted the fix/alt-text-placement branch March 17, 2026 14:23
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.

Update placement of Alt Text generation in Image block

2 participants