[META] Implement Streamed responses in CKEditor AI plugins
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3465010. --> Reported by: [kevinquillen](https://www.drupal.org/user/317279) Related to !32 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai/issues/3464475" title="Status: Closed (fixed)">#3464475: Add new CKEditor plugins to the drop down button in CKEditor toolbar</a></span> is pending a merge.</p> <p>The UX has vastly improved.</p> <p>It would be great to see if streamed responses can be put back as well in the modal in a seamless way (user does not have to take any action, its either supported or not supported).</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>R&amp;D a way to support streaming the response back to the user. This will also require changing the 'response' box from a text area to a formatted text field (possibly) so it can receive answers as markdown and/or HTML.</p> <p>Current WIP:</p> <p><img src="https://www.drupal.org/files/issues/2024-07-31/Screenshot%202024-07-31%20at%2010.14.39%20AM.png" alt=""></p> <p>The current WIP supports receiving answers in HTML and sending back to the main editor instance intact. Without streaming though, not much else is going to be possible, or usable. Streaming HTML into CKEditor doesn't work great, which would require the answer to be Markdown formatted (opening and closing tags are broken to CKEditors model).</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Support requesting an answer from AI and streaming it back to the modal editor. This will likely require a solution that does not go through the form rebuild process of an AJAX callback. However, the form will need to have the form value (the response) on submit.</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>None.</p> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> > Related issue: [Issue #3465020](https://www.drupal.org/node/3465020)
issue