- Issue created by @marcus_johansson
- π©πͺGermany marcus_johansson
This is very high level for now to discuss and have a common understanding of what and how to solve this.
- π©πͺGermany a.dmitriiev
a.dmitriiev β made their first commit to this issueβs fork.
- π©πͺGermany marcus_johansson
I have tested adding an ugly version of a text automator - I will fix better code when we are getting close to finishing this issue and will only write down architecture problems for now, code, features, UX/UI improvements we can focus on later. In general its very impressive on such short time.
1. I'm not sure about the correct architecture on how to solve this, but right now the system only allows one field widget per plugin. In the automators case, you might have 3 different automators doing some minor differences and want to set them all up. I would suggest that there is an "Add action" button and you can add as many as you want that are derivatives - even from the same plugin. With content suggestion this would also work - since you might have two different base prompts you want to run depending on the content you are writing.
2. In the automators case we might have the plugin, but no setup automator. It would be good to have an isEnabled/isAvailable method that returns true in the abstract, but where a processor can hook in and say that it should not show up in the form display settings.
3. Does it work currently to have one button to generate multiple values on a multi field? Right now the logic for the button is running inside hook_field_widget_single_element_form_alter, so you need to create another field and then click the button to ask for another value. For a text field that means that you can have doublets, since it might generate the same answer, if its not aware of the other values.
- π©πͺGermany a.dmitriiev
I have changed the UI/UX in the way that it is possible to add multiple instances of the same plugin. It is also now possible to remove and sort field widget actions in 3rd party settings form.
I have added `isAvalailable` method to base class, so that each plugin can perform any checks needed, for example user permissions, or whether some module enabled or not, etc.
For the 3 point, I have added the new
multiple
property to plugin definition. In case it is TRUE, the button will be added to each single element of the field widget, if FALSE, only one button for widget will be added. TRUE is by default. - π©πͺGermany marcus_johansson
I have checked the code now, without having to tried it out with the Automator. It looks nice! What I would try to do next week is to make a more complex field like an image generation based on multiple fields and see how weel that work.
- π©πͺGermany marcus_johansson
So, I have merged with 1.2.x and also fixed some minor cspell, phphcs etc. issues. I did remove a hook from content suggestions, that I assume have moved to Field Widget Action.
There are a lot of things in terms of UX/UI implementation we can do better with helper functions, ready made css/js etc, and I could find nitpicks, like the plugin should not show up if all widget isAvailable returns false etc. - but the most important part - the architecture is solid. Really great work!
This means that its better that we merge now and write follow up issues. I also never liked the thing in Drupal where one huge issue like this get 1 credit, and fixing a misspelling gets 1 credit, but that is a dicussion for another day :)
I will merge it, its not a finished product yet - if nothing else we should add a lot of automator widgets to it, but it is working and its good enough to start testing and adding follow up issues for.
-
marcus_johansson β
committed 0b1127ae on 1.2.x authored by
a.dmitriiev β
Resolve #3528684 "Add processor and"
-
marcus_johansson β
committed 0b1127ae on 1.2.x authored by
a.dmitriiev β
- π©πͺGermany a.dmitriiev
Thank you, @marcus_johansson! Now it would be nice if others join and create more plugin implementations in their modules. This will broaden the usage and of course testing. It is worth mentioning that this is not an AI specific feature, any task that can be done with a click of a button fits here :)
By the way, there is already an example plugin in this issue β¨ Add field widget action plugin based on agents Active that does the similar thing like https://www.drupal.org/project/ai_image_alt_text β module with Field Widget Actions and Agent.
- πΊπΈUnited States Kristen Pol Santa Cruz, CA, USA
We are doing some issue management housekeeping and adding/removing components.
We are removing the "Code" component and want people to categorize issues with the best module/submodule component.
Moving this issue to "AI Content Suggestions".
See π Update AI module project components Active for more details.
-
marcus_johansson β
committed 0b1127ae on 2.0.x authored by
a.dmitriiev β
Resolve #3528684 "Add processor and"
-
marcus_johansson β
committed 0b1127ae on 2.0.x authored by
a.dmitriiev β