Convert AI provider settings form to table layout
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3568026. -->
Reported by: [erichomanchuk](https://www.drupal.org/user/299489)
Related to !1113
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>In progress - working code exists, needs cleanup and review<br>
<strong>Short Description: </strong>Reorganize AI provider settings UI to use table layout for improved usability<br>
<strong>Check-in Date: </strong>01/21/2026<br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The current AI provider settings form layout does not scale well as we add more provider information and capabilities. A table layout will provide better organization and prepare the UI for additional metadata columns in a follow-up issue.</p>
<p>This issue is part of the provider metadata improvements discussed in #3560206.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Convert the AI provider settings form to use a table layout structure.</p>
<p>This issue focuses solely on the table layout restructuring and does <strong>not</strong> include the provider info/metadata columns—that work is handled in a follow-up issue.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Clean up existing working code</li>
<li>Review and testing</li>
</ul>
<h3>User interface changes</h3>
<p>Provider settings will display in a table format rather than the current layout.</p>
<h3>Related issues</h3>
<ul>
<li>Parent/roadmap: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai/issues/3560206" title="Status: Closed (fixed)">#3560206: [meta] Reorganize AI Settings into Capability-Based Table Layout</a></span></li>
<li>Follow-up (provider metadata): <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/ai/-/work_items/3568028" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/ai/-/work_items/3568028</a></span></li>
</ul>
<h4 id="summary-steps-test">Steps to test</h4>
<p><strong>Prerequisites:</strong></p>
<ol>
<li>Install a fresh Drupal 11 site. Note: I have been using Drupal CMS and removing the AI recipe and then just including the AI module via composer.</li>
<li>Install the AI module 1.3.x branch</li>
<li>Install at least one AI provider module (e.g., OpenAI, Anthropic, or Ollama)</li>
<li>Note the current appearance of the AI Default Settings form at <code>/admin/config/ai/settings</code></li>
</ol>
<p><strong>Testing the merge request:</strong></p>
<ol>
<li>Apply the merge request to the AI module. (I have used the patch file and included it in Composer)</li>
<li>Clear caches (<code>drush cr</code>)</li>
<li>Navigate to <code>/admin/config/ai/settings</code></li>
<li>Verify the form now displays as a table-based layout instead of fieldsets</li>
<li>Verify all installed capabilities are still visible and grouped correctly</li>
<li>Test selecting different default providers for each capability</li>
<li>Save the form and verify settings persist correctly</li>
<li>Confirm no PHP errors or warnings appear</li>
</ol>
<p><strong>Expected result:</strong><br>
The AI Default Settings form should display capabilities in a clean table format, with no loss of functionality from the previous fieldset-based layout.</p>
<h3 id="summary-before-after">Before/After screenshots</h3>
<p><strong>Before (1.3.x):</strong><br>
<img src="https://www.drupal.org/files/issues/2026-01-21/before.png" width="2860" height="1642" alt="Form as fieldset"></p>
<p><strong>After (with MR applied):</strong><br>
<img src="https://www.drupal.org/files/issues/2026-01-21/after.png" alt="After form with table layout"></p>
issue