Per-field ai_content_suggestions UX improvements

Created on 22 June 2025, about 1 month ago

Problem/Motivation

As of https://www.drupal.org/project/ai/issues/3489572#mr549-note498490 Allow summarize, analyze, suggest title and taxonomy terms based on the rendered HTML of the entity Active , ai_content_suggestions now offers the ability for content editors to generate suggestions for content fields by clicking a button alongside an individual field, and receive a list of suggestions to choose from.

There are some parts of the process which are currently a little confusing.

Steps to reproduce

  1. Create a standard Drupal CMS install.
  2. Add a "Teaser" plain long text field to the standard Article content type.
  3. Go to the Form Display configuration and enable AI Suggestions for the Title, Teaser and Body field. Save.
  4. Go to create a new Article
  5. Attempt to click on the "AI Function" icon to the right of the Title field
  6. Try to locate the "AI Function" icon for the Teaser field.

I expect that be able to activate the AI Function immediately by clicking on it.

But instead when I click on the "AI Function" text, it disappears, the field is focussed, and a new AI Icon appears to the right of the field, which I have to click on again to trigger the desired functionality.

Using the keyboard, it is not possible to activate the function: I expect to be able to tab to the "AI Function" button to activate it. But when I tab to field, the "AI Button" disappears. And when I tab again to focus the new button that has appeared, the field loses focus and the intended button disappears.

Additionally, on the Claro admin theme that is default for new Drupal installs, the position of the "AI Suggestions" icon is different across field types.

For single line plain text fields it is flush to the right of the admin area. For multi-text plain fields it appears to be "inside" the field.

Proposed resolution

Have the actual AI Content Suggestions button be visible at all times - not visible only when the field is focussed. Ensure it has an accessible label. Remove the "AI Suggestions" pseudo element which is on the field and disappears when focussed.

Consider placing the AI Content Suggestions button elsewhere (e.g. beneath the field instead of alongside, for more consistent support across different admin themes).

Feature request
Status

Active

Version

1.2

Component

AI Content Suggestions

Created by

🇬🇧United Kingdom Leo Pitt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024