Problem/Motivation
At the moment "AI Content Editing Tools" module adds the form elements in the right sidebar with all actions that it can help editors with, including Summary of the text, Analysis of the tone, Suggestion of title and taxonomy terms, etc. But the actions are limited to the values from entity fields, and unfortunately entity reference (revisions)/paragraphs are not supported.
Steps to reproduce
- Create a content type with entity reference revisions fields.
- Enable ai_content module
- Observe that entity reference revision field is not possible to select in any tool from the module
Proposed resolution
For some actions like summary, it would be nice to have a summary of the whole entity, not just one field, for example for "Preview text" of the node. It should be based on the whole entity content, not just one field. The same would be for title and taxonomy suggestions, as well as analysis of the tone of the text. It is hard to support paragraph fields on its own, but a rendered output of the entity in some view mode could be a solution. Like Search API module has a plugin that renders the entity in a selected view mode for using the content in the index, the same was AI module can use this output as a source for content analysis, suggestions, etc.
Another improvement might be, that the actions not necessary should appear in the right sidebar and the output should not be copied and then pasted to the correct field. For example, if the action is to suggest title, then the button "Suggest title" should be near the "Title" field. Maybe it should be open the dialog where the additional settings are, so the user can select based on what the title suggestion should be created, it could be the same form element as it is now, but also include the "Rendered HTML" of the node (entity) option.
The same approach can be added to Summary feature. If there is a field "Preview Text" or "Summary" on the entity, that is used for teaser view mode, for example, then the button for Summary creation should be near it (for example how AI Image Alt text module does, the "Generate" button is near the "Alt text" input field).
Remaining tasks
Decide on the concept how this should be best implemented.
Provide MR
User interface changes
The AI buttons should be rather added to the fields that support the output of the AI, then to the sidebar. There should be an option to populate the target field right away (where possible and reasonable) and do not rely on the user to copy the output to the field.