Show the EU icon over AI images on the page

Problem/motivation

The formatter renders the disclosure as a card next to the content. For a deep-fake image the Code of Practice wants the icon on the image, in a place with no intervening overlays such as the top-right corner, recognisable without any action (Measures 1.2.1 and 1.2.2(a)). An interface overlay that appears to be on the content is accepted instead of embedding it (Measure 1.2.1(c)). A label that only appears on hover is not.

Proposed resolution

  • A wrapper around image output: the image and responsive image formatters, media thumbnails, and images inserted in CKEditor (a text filter on img[data-entity-uuid]).
  • The icon sits top-right inside the image box, always visible, sized relative to the image with a minimum size, in the site icon variant.
  • Text alternative from DisclosureIcons::alt(), plus the disclosure sentence for screen readers. The "How was AI used?" text as an optional second layer on click or focus.
  • Shown when the resolved disclosure (#57 (closed)) requires a label. Other AI grades follow the formatter visibility setting (site policy, always, required only).
  • Evidently artistic works (DisclosureModality::Unobtrusive): the icon outside but adjacent to the image (Commitment 3).
  • A template, so themes can move the icon.

This lives in the main module, since it needs no extra dependency.

Remaining tasks

  • Wrapper, template and CSS
  • CKEditor filter
  • FunctionalJavascript test: visible without hover, absent for grades that do not require it
  • Contrast and screen reader check
  • Docs

User interface changes

An EU icon over AI images on the front end.

API changes

A new theme hook.

Data model changes

None.

Part of #56 (closed).

Edited by Giorgio Alfredo Pagano