Problem/Motivation
Since generated media are saved into the site's own Image and SVG Image media types, the "Generate image with AI" tab is an extra tab right after Image. When a media field allows only one media type, such as the Featured image field on Varbase and Drupal CMS pages, core's Media Library renders no tab menu at all, so the AI tab never shows and the library opens straight on the upload form.
Steps to reproduce
- Install AI Media 1.0.x with the image generator mapped to the Image media type.
- Edit a page whose Featured image field allows only Image.
- Open the field's Media Library: there are no tabs, only the upload form.
Proposed resolution
When the allowed types include a type with a mapped, shown AI tab, build the menu even for a single allowed type, so it reads "Image | Generate image with AI".
Remaining tasks
- ✅ File an issue
- ✅ Addition/Change/Update/Fix
- ✅ Testing to ensure no regression
- ✅ Automated unit/functional testing coverage
- ➖ Developer Documentation support
- ➖ User Guide Documentation support
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Reviewed by a human
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ❌ Update Release Notes
- ❌ Release
User interface changes
- A single-type media field shows the type's tab and its "Generate … with AI" tab.
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Show the AI tab when a field allows only one media type.
AI-Generated: Yes
Issue fork ai_media-3633061
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
rajab natshah✅ Released ai_media-1.0.0-alpha2