- Issue created by @kevinquillen
- π¬π§United Kingdom scott_euser
Just for notes in case someone comes across this and wants to contribute it, from our slack conversation I think its probably going to need some mix of the below:
- CKE plugin: Something like
<streamed-response data-original-selection="something">stream into here</streamed-response>
then on completion of the stream get rid of element wrapper - Within Drupal Form: Request the provider returns markdown which gets converted e.g. with https://github.com/showdownjs/showdown so page doesn't jump around with incomplete html tags
- Within Drupal Form: Custom AjaxCommand to be sent (maybe like I did here ages back)
- CKE Plugin: Listen to the AjaxCommand like I did here maybe, but within the CKE plugin to drop into (1)
- CKE Plugin: Call a controller with the passed details to retrieve a streamed response outside of the form API
- CKE plugin: Something like
- Merge request !32Implement Streamed responses in CKEditor plugins β (Merged) created by kevinquillen
- πΊπΈUnited States kevinquillen
The branch has a WIP for the Completion action that is working, but more work is needed to remove some of the hardcoded values.
- πΊπΈUnited States kevinquillen
The challenge here is now understanding how to stream in a markdown or HTML formatted response and insert it appropriately without breaking text in the editor. I am not sure I can understand CKEditor Writer API enough to facilitate that. Simply streaming in characters (like "##") does not trigger the Markdown formatting in CKEditor as if you had typed it.
Also, while it is responding, the editor should be disabled and not focusable because it affects the Writer position.
- πΊπΈUnited States kevinquillen
The last comment is probably best left for a new issue so it does not hold up this one.
- Status changed to Needs review
8 months ago 5:49pm 2 August 2024 - πΊπΈUnited States kevinquillen
Circling back around on this. I think I am waiting on one last thing that makes this done: π Require providers to define if they support streamed responses or not Active .
But right now in this branch:
- You can click a command in the dropdown list
- The command opens a dialog
- The dialog dimensions can be controlled in the format settings (height, width, etc) because the core method has no way to do that right now β¨ CKEditor 5 overrides dialogSettings objects provided by CKEditor plugins Active
- The response text box is now a WYSIWYG. The format assigned is the same one from the initiating editor
- The responses are streamed (if the provider supports streaming, see related issue)
- The responses are also returned in HTML, with the allowed tags passed from the current editor. This could be toggle-able, but being that its in CKEditor it makes sense right now and makes it more of a writing assistant than a giant paragraph dump
- When streaming in, the editor toggles Source mode and is locked until the response is complete
Example:
The response HTML is using the allowed tags and makes a nicer editing point.
This merge will necessitate an AJAX indicator again to indicate something is happening. That can be handled in a new ticket.
- πΊπΈUnited States kevinquillen
I think we are more or less ready here. Linters pass, plugins are functional, streams are possible with HTML. We can revisit the issue with provider supported streaming but for now I think this feature add is good to go.
- Status changed to RTBC
8 months ago 5:59pm 19 August 2024 - π©πͺGermany marcus_johansson
kevinquillen β credited marcus_johansson β .
-
kevinquillen β
committed 160fe07a on 1.0.x
Issue #3465010 by kevinquillen, scott_euser, marcus_johansson: [META]...
-
kevinquillen β
committed 160fe07a on 1.0.x
- Status changed to Fixed
8 months ago 6:15pm 19 August 2024 -
kevinquillen β
committed 160fe07a on kernel-testing
Issue #3465010 by kevinquillen, scott_euser, marcus_johansson: [META]...
-
kevinquillen β
committed 160fe07a on kernel-testing
-
kevinquillen β
committed 160fe07a on mock-stream-response
Issue #3465010 by kevinquillen, scott_euser, marcus_johansson: [META]...
-
kevinquillen β
committed 160fe07a on mock-stream-response
Automatically closed - issue fixed for 2 weeks with no activity.