feat: #3547306 Add interactive refinement capability to Field Widget Actions
Adds opt-in interactive refinement to Field Widget Actions, allowing users to iteratively improve AI-generated content before accepting it into a field.
Changes
FieldWidgetActionBase: addsenable_refinementandrefinement_modal_titleconfig options; extendsreturnSuggestions()with an$optionsarray supporting refinable modeHook/FieldWidgetAction: registersfield_widget_actions_refinable_suggestionstheme hook- New
RefinementAwareInterface: contract for plugins that support refinement (extracts content from field items, checks if refinement is enabled) - New CSS/JS/Twig: refinable suggestions modal with Accept, Refine, and Cancel controls; iterative refinement via AJAX
How to test
- Enable a field widget action on a text field
- In the action config, check "Enable interactive refinement"
- On a content edit form, click the action button
- Verify the modal shows Accept/Refine/Cancel instead of the standard suggestions list
- Enter a refinement prompt and click Refine — modal should update with new content
- Click Accept — content should populate the field
Notes
Plugin implementations (wiring up specific automators to RefinementAwareInterface)
are handled in a companion MR against the AI module.
Closes #3547306