AI Ckeditor integration and modal

Created on 8 December 2024, 14 days ago

Problem/Motivation

The AI ckeditor integration does not work with modal windows.
For example, when a node content is edited in a modal window, and the ckeditor AI integration is used for example summarization or
translations, the modal logic does not work properly and it is impossible to save the content or do anything with the AI assistant.
The main reason is that when the AI integration opens a modal it does not understand to actually open a modal over another modal if the node itself was already in a modal. (everyting works when the node editing page is not in a modal)

Steps to reproduce

1. install AI ckeditor integration and enable summarization for a content type
2. Install for example ng lightbox module and set it up to use "core modal" and open a node edit on a modal window.
(or use any other way to open the node editing page in a modal window)
3. Use the ckeditor "Ai assistant" "Summarize" a text which is marked in the node body field (this is now in modal window)
4. AI assistant opens a modal, now click summarize and wait you get the summarized text in the textbox below the original text. Then click "save changes to editor"
5. That button closes the modal, but also the original modal so the node editing page is gone. So there is not anymore anything to edit and you have to click the node editing modal again and start over.

-- Another issue
When you do not mark any text and select summarize from the ckeditor5 "ai assistant" dropdown. There comes a error message in a modal "you have to select something to summarize". The problem here is that when you close this modal, also the original node editing modal is closed.

Proposed resolution

Make the AI Assistant support also a situation when the node editing page itself is a modal.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

AI CKEditor

Created by

🇫🇮Finland anaconda777

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @anaconda777
  • 🇬🇧United Kingdom scott_euser

    I think this is the core issue for it https://www.drupal.org/project/drupal/issues/2741877 🐛 Nested modals don't work: opening a modal from a modal closes the original Needs work and yeah i expect this is going to have to wait until core resolves it as we just use their modal.

    You could check the ckeditor 5 embedded content module and see if they found a workaround for it in their v2. I remember they used to have a warning about that on their homepage but the warning is no longer there but from what I can tell at a glance it hasn't significantly changed it's code (ie, another example of modal from modal in cke5 context).

    So probably nothing we can do here until it's sorted in Core. For modal view modes you could use an alternative text format that only has toolbar icons that are supported. That's what I do in the Footnotes module text format for example (also modal within modal is possible).

Production build 0.71.5 2024