Problem/Motivation

AI Media generates images, SVGs and videos from the Media Library. It moved from a private GitHub repository to drupal.org, and needs what a first public release needs: a canonical repository, CI, a project page and README, styling that follows the admin theme, core HTMX, a settings page, and the docs and tests every Vardot-maintained module ships.

Steps to reproduce

N/A

Proposed resolution

Done (merged into 1.0.x):

  • git.drupalcode.org is the canonical repository, on 1.0.x with the existing history. The 1.0.x-dev release is out.
  • !1 GitLab CI on the drupal/gitlab_templates, and the README.
  • !2 Require enshrined/svg-sanitize ^1.0, since every 0.x release has advisories.
  • !3 Follow the active admin theme: Claro, Gin and Default Admin.
  • !5 Ship less custom CSS and JS (ai-media.admin.css, ai-media.admin.js), and generate with core HTMX instead of Form API AJAX.
  • !6 A settings page at /admin/config/ai/ai-media: Media Library tabs, generators, description, name and alternative text, files and providers.
  • !7 Follow the Vardot module standard: GitLab templates, docs on GitLab Pages, README outline and a Varbase E2E suite.

In progress, in one merge request:

  • !20 Safety, AI Prompts, AI Context, Add media and editorial UX: guardrail stops and AI tags on every call, plain error messages, generating on core's Add media page, a Safety tab that picks one of the site's guardrail sets, AI Prompts for the generator prompts, AI Media as an AI Context consumer type (no submodule), a static or animated SVG generator, and the experimental video generator in AI Media itself, off by default, and a per-generator Media Library tab setting.
  • Documents are not part of AI Media: the document generator was taken out, so AI Media no longer needs dompdf/dompdf or league/commonmark. A generator from another module still plugs in the same way.

!4 is superseded: its changes reached 1.0.x with !5. !8 to !19 are closed in favour of !20.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Push the existing history to a 1.0.x branch on git.drupalcode.org
  • ✅ Make 1.0.x the default branch
  • ✅ Create the 1.0.x-dev release
  • ✅ Replace the placeholder project page
  • ✅ Add GitLab CI using the drupal/gitlab_templates
  • ✅ Write the README for the first public release
  • ✅ Follow the active admin theme (Claro, Gin, Default Admin)
  • ✅ Ship less custom CSS and JS
  • ✅ Generate with core HTMX
  • ✅ Settings page
  • ✅ Follow the Vardot module standard (templates, docs, E2E suite)
  • ❌ Safety, AI Prompts, AI Context, Add media and editorial UX (!20)
  • ❌ Take documents out of AI Media (!20)
  • ❌ Make github.com/Vardot/ai_media a mirror
  • ✅ 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

  • The "Generate … with AI" tabs follow the active admin theme, with the theme's own "New" flag where it has one.
  • Generate and Generate again update the form in place with core HTMX. Enter in the Name field no longer starts a new generation.

Screenshots, on Varbase 11 with Gin, real OpenAI and Anthropic results (MR !20):

Review a generated image: name and alternative text prefilled from the description, a preview and a full size link, then save
A generated watercolor of a lighthouse at dawn in the Media Library, with the name and alternative text prefilled and Generate again above

Review a generated SVG, sanitized, made with Anthropic
A generated flat icon of a paper plane in navy and white, with the name and alternative text prefilled

Generate on core's Add media page, with examples, the provider disclosure and the cost line
The Add Generated image with AI page with the description field, two example buttons, the OpenAI disclosure, Options and Generate image

Settings: the Safety tab picks one of the site's own guardrail sets
The AI Media settings page on the Safety tab, with the guardrail set select and links to the AI module's guardrail and moderation settings

API changes

  • Requires Drupal core ^11.3 (core HTMX), drupal/ai ^1.5 and enshrined/svg-sanitize ^1.0.
  • No longer requires dompdf/dompdf or league/commonmark: there is no document generator.
  • Assets renamed to css/ai-media.admin.css and js/ai-media.admin.js.

Data model changes

  • The settings page adds keys to ai_media.settings. No update hooks: missing keys fall back to defaults at runtime.
  • No document media source or document media type.

Release notes snippet

  • First public release of AI Media: generate images, SVGs and videos with AI from the Media Library.

AI-Generated: Yes

Issue fork ai_media-3631526

Command icon 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

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Title: Initial import of AI Media on 1.0.x and open the project » Initialize the module
Issue summary: View changes
rajab natshah’s picture

Pushed the existing history to 1.0.x on git.drupalcode.org as-is: 4 commits, HEAD 8a53edf (Short media names, and a readable line length on wide screens). GitLab set 1.0.x as the default branch.

CI and README follow in an MR on this issue fork.

AI-Generated: Yes

rajab natshah’s picture

Issue summary: View changes
Status: Active » Needs review

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Tested on a fresh Drupal 11.4.10 with PHP 8.4 and AI 1.5.1, with AI Media installed from the merge request branch.

  • ✅ Installs and enables clean, no PHP warnings or console errors
  • ✅ The AI tabs sit right after Image in the Media Library
  • ✅ Without Generate media with AI, no AI tabs
  • ✅ An admin with no provider gets the set-up message with a link to the AI settings
  • ✅ With a chat provider (the AI module's Echo test provider, no key) the document tab makes a PDF, and the SVG tab refuses an answer that is not SVG
  • ✅ The SVG cleaner on svg-sanitize 1.0.0 drops onload, <script> and remote href, and keeps the drawing
  • ❌ ^0.22 || ^1.0 still lets in svg-sanitize 0.22.0, which has three advisories

Opened MR !2 to require ^1.0 only. Pipeline green.

Real image, video and document generation not tested here, as there is no provider key on the test site.

Moving to Needs review for MR !2.

  • rajab natshah committed 89b51034 on 1.0.x
    fix: #3631526 Require svg-sanitize ^1.0, 0.22.0 has advisories
    
rajab natshah’s picture

Title: Initialize the module » Initialize the AI Media module

  • rajab natshah committed be88f7b6 on 1.0.x
    fix: #3631526 Follow the active admin theme: Claro, Gin and Default...

  • rajab natshah committed 6438422f on 1.0.x
    feat: #3631526 Generate with core HTMX instead of Form API AJAX
    
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
StatusFileSize
new89.59 KB
new94.24 KB
new167.75 KB

  • rajab natshah committed 2c33eb7f on 1.0.x
    task: #3631526 Follow the Vardot module standard: docs, templates and...

rajab natshah’s picture

Issue summary: View changes

Updated the issue summary: documents are not part of AI Media anymore, !6 and !7 merged, and the remaining work is in !20.

rajab natshah’s picture

Replaced the screenshots in the issue summary with the current ones from MR !20.

rajab natshah’s picture

Issue summary: View changes

Updated the issue summary: the Figma submodule is out of AI Media for now (!20).

rajab natshah’s picture

Issue summary: View changes

Updated the issue summary: AI Context needs no submodule any more (!20).

rajab natshah’s picture

Issue summary: View changes

Updated the issue summary: video is part of AI Media again, off by default, and each generator can drop its Media Library tab (!20).

  • rajab natshah committed 6d749eb9 on 1.0.x
    feat: #3631526 Safety, AI Prompts, AI Context, animated SVG, video and...

  • rajab natshah committed 4b5bcae3 on 1.0.x
    feat: #3631526 Put each AI media type right after the type it stands in...

  • rajab natshah committed 80205164 on 1.0.x
    feat: #3631526 Generate into the site's own Image and SVG Image media...

rajab natshah’s picture

Status: Needs review » Fixed
Issue tags: +ai_media-1.0.0-alpha1

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.