task: #3631526 Document tags, Safety, AI Prompts, AI Context and the video submodule, with a README screenshot
Issue: #3631526 "Initialize the AI Media module"
Chunk 12 of the UX and integration plan (20 October 2026): docs and screenshots (plan section 8).
Depends on !18 (closed) (3631526-video-submodule), which depends on !17 (closed) to !8 (closed) and !6 (merged). Until those merge, this diff includes them; the change of this MR is its last commit.
What changed
- New docs page How AI Media works with the AI module (
docs/info/ai-integration.md): one table for tags and the parent ID, guardrails and the Safety tab, moderation, AI Prompts, AI Context (AI Media Context submodule), logging and observability, AI Validations and AI Image Alt Text, with links to the detailed sections. Linked from the docs index, MkDocs navigation and the README. - The detailed docs for tags, Safety, AI Prompts, the context consumer and the video submodule landed with their chunks (!8 (closed), !14 (closed), !12 (closed), !13 (closed), !18 (closed)); this MR adds the overview and the README paragraph.
- README: the hero screenshot under the first paragraph, with its caption, and a short paragraph on the Add media page, the "Generate media with AI" button and the integration.
docs/images/ai-media-library-generate-image.webp(44 KB): the only image committed, as the plan says (README: shot 1 only).
Screenshots
Taken on the Varbase 11 site with real providers (OpenAI gpt-image-2 for the image, Anthropic claude-opus-5 for the SVG and the document), Gin, light, English, 1600 x 1000 viewport, device scale 1, resized to at most 1200 px wide. Project page order per the plan: 1, 2, 5, 3, 4, 6, 7. They are attached to the issue by the maintainer, not committed (except shot 1).
| # | Caption |
|---|---|
| 1 | Generate images, SVGs and documents with AI, right in the Media Library, beside Upload. |
| 2 | Describe it, pick a shape and format, and see which AI service it is sent to. |
| 3 | SVGs are cleaned before you see them: no scripts, no remote references. |
| 4 | Documents as PDF, Word, Markdown or text, with a preview before you save. |
| 5 | Or start from Content > Media > Add media. |
| 6 | Choose which generators editors get, their order and formats. |
| 7 | Uses your site's AI guardrails, moderation, prompts and context. |
Notes on the shots:
- The Varbase site runs drupal/ai 1.4.7, below this branch's new
^1.5floor, and its composer files were not to be changed. The only 1.5 API AI Media calls,setRequestMetadataValue(), is used when the Media Library opens from an entity form, so shots 1 to 4 open the Media Library from CKEditor's Insert Media (Blog post body, Full HTML), which sends no entity hint. The site needs drupal/ai 1.5 before this code runs there from a media field. - After the first result core replaces the whole library with the review step, tabs included, so shot 1 shows the review step (the generated image, its name and alternative text, "Open full size in a new tab") and shot 2 shows the tabs with the form. The alt text in the README says what the image shows.
- To show Shape and Format in shot 2, the image editor options were turned on for the shoot and the site's AI Media settings were then restored exactly.
- Shots 3 and 4 are cropped above the dialog's button bar, where the WProofreader badge covered Save.
How it was tested
- Paid provider calls: 3 (one image, one SVG, one document), counted in AI Logging (entries 212 to 214), within the 4 approved. The SVG passed the sanitizer on the first answer.
- Docs: links checked; cspell clean. The full suite and Kernel tests are as in !18 (closed).
Not tested
- The MkDocs build (GitLab Pages) of the new page.
- The images on the drupal.org project page.
AI-Generated: Yes. Written with Claude Code (Claude Opus 5.5) under the Drupal AI policy; tested by the author before submission.
Checkpoints:
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
- Automated unit testing coverage
- Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release