Add chosen_select widget support to ClassificationOptionsSelect FieldWidgetAction
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3546465. -->
Reported by: [ezeedub](https://www.drupal.org/user/633844)
Related to !1172 !1047
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The <code>ClassificationOptionsSelect</code> FieldWidgetAction currently supports only the <code>options_select</code> widget type for entity reference fields. However, many Drupal sites use the Chosen module's <code>chosen_select</code> widget for taxonomy term selection, which provides enhanced UX with search and filtering capabilities for large vocabularies.</p>
<p>Since both widget types render select elements for the same field type (<code>entity_reference</code>) and target the same form element property (<code>target_id</code>), sites using <code>chosen_select</code> widgets cannot currently benefit from AI-powered classification automators. This limits the usefulness of Field Widget Actions functionality for taxonomy-heavy content workflows.</p>
<p><strong>Use Case</strong>: Many sites extensively use <code>chosen_select</code> widgets for taxonomy classification fields like topics, categories, regions, content types, etc. These fields would benefit significantly from AI classification automation but are currently unsupported.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<p>N/A - This is a feature request.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Extend the <code>ClassificationOptionsSelect</code> FieldWidgetAction to support <code>chosen_select</code> widget type in addition to the existing <code>options_select</code> support.</p>
<p><strong>Current behavior:</strong></p>
<ul>
<li>Widget types: <code>['options_select']</code></li>
<li>Field types: <code>['entity_reference']</code></li>
</ul>
<p><strong>Proposed behavior:</strong></p>
<ul>
<li>Widget types: <code>['options_select', 'chosen_select']</code></li>
<li>Field types: <code>['entity_reference']</code></li>
</ul>
<p>This would be a backward-compatible enhancement that doesn't change existing functionality. Both widget types handle taxonomy entity references identically and target the same form element property, so the existing AJAX callback and form handling logic should work without modification.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>[ ] Update the <code>#[FieldWidgetAction]</code> attribute to include <code>'chosen_select'</code> in the <code>widget_types</code> array</li>
<li>[ ] Test that existing <code>options_select</code> functionality remains unchanged</li>
<li>[ ] Test that <code>chosen_select</code> widgets work correctly with the automator</li>
<li>[ ] Verify proper handling of both single and multi-value taxonomy fields</li>
<li>[ ] Update plugin documentation/labels to reflect broader widget support</li>
<li>[ ] Consider adding conditional availability checking if <code>chosen_field</code> module dependency is desired</li>
</ul>
<h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
<p><strong>API changes</strong>: Minor - only expanding the supported widget types array in the plugin attribute.</p>
<p><strong>User interface changes</strong>: None - the functionality would appear identical to users, just available on more widget types.</p>
<p><strong>Related work</strong>: Similar pattern exists in <code>AutoCompleteTagsTaxonomy</code> which specifically targets <code>entity_reference_autocomplete_tags</code> widgets. This enhancement would provide classification support for select-style taxonomy widgets, completing the taxonomy widget coverage for Field Widget Actions.</p>
issue