feat: #3631526 Order the settings tabs by task and keep older sites' settings whole

Issue: #3631526 "Initialize the AI Media module"

Chunk 9 of the UX and integration plan (20 October 2026): the settings page order (plan section 7) and the missing settings of older sites.

Depends on !15 (closed) (3631526-form-polish), which depends on !14 (closed), !13 (closed), !12 (closed), !11 (closed), !10 (closed), !9 (closed), !8 (closed) and !6 (merged). Until those merge, this diff includes them; the change of this MR is its last commit.

What changed

  • Tabs in the order of the tasks an administrator comes to do: Generators, Providers, Editor options, Name, title and alternative text, Safety, Site context, Description, Advanced. The page opens on Generators.
  • "Media Library tabs" (offer the tabs, where they go, the New badge) is folded into Generators as its first part, with "Offer the AI tabs" first, so what editors see is decided in one place.
  • Advanced holds the rarely changed settings: the Files settings (unsaved lifetime, maximum size, folder) and "Remove HTML tags from the description before it becomes a name, title or alternative text" (moved from the naming tab).
  • Providers links to AI request logs (AI Logging) and AI observability when those modules are on, noting that AI Media requests carry the ai_media tag.
  • No update hook (the module is still being initialized). For "existing sites keep their values", a config override (AiMediaSettingsDefaults) fills only the keys a site's stored ai_media.settings lacks with the shipped defaults; every stored value wins and nothing is written. The settings form shows the same defaults for missing keys, so saving it stores them rather than empty values. This also covers the four-key config of a site that installed an early commit (plan Q6).
  • The settings doc follows the new order; the e2e suite checks the tab order.

How it was tested

  • Kernel SettingsDefaultsTest: with description_examples and cost_notice removed and description_max_length changed in stored config, the runtime config has the shipped examples and cost settings and keeps 200; the stored config is unchanged; the form's fill shows the defaults. All 28 Kernel tests pass.
  • Plain Drupal 11.4 (aimplan1): with description_examples cleared in stored config, generation still shows the shipped examples; restored afterwards.
  • axe-core 4.10.2: 0 violations on the Generators, Providers and Advanced tabs in Claro, Gin and Default Admin at 1440 and 1920.
  • Varbase E2E, Firefox: 01-01-01-install (tab order) and 06-01-01-settings (Advanced tab) pass, 16 scenarios.
  • phpcs (Drupal, DrupalPractice), phpstan level 1, cspell, eslint, stylelint: clean.

Not tested

  • A real site upgraded from the oldest commit with its own edited values (simulated in the Kernel test).
  • Mobile widths (out of scope).

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

Merge request reports

Loading
Loading