We tried the approach of making the source view read-only when realtime is enabled, but we discovered it was difficult and hackish to implement in practise. The iframed WYSIWYG editor, which is still assumed to be widely used, for instance when creating new pages, destroys the document to which the patches are applied when switching to source mode. To work around this we would have to keep a fake document in memory and temporarily apply the patches to that fake document while in source mode.
Dorian Ouakli on 22/Jul/24 07:28
Given these difficulties, we also thought of using a modal, or a ckeditor source dialog, see https://ckeditor.com/cke4/addon/sourcedialog The benefits of a source dialog is that it would be clear that it is simply a view of the realtime session rather than the realtime session itself, but also that it would not destroy the iframe and prevent the realtime extension from receiving patches from other users.
To keep things simple because of our running late on the schedule, we decided to bring the Source button back by temporarily leaving the realtime session. If no unsaved changes were made or if the user is alone in the realtime session, switching back to the wysiwyg brings the user back in the realtime session. If the user has unsaved changes and is not alone in the realtime session when switching back to wysiwyg, the editor permanently leaves the realtime session, until the user decides to manually join the session.
With this last solution, the source button would have the same behavior in a realtime session alone, as outside of a realtime session.
Dorian Ouakli on 22/Jul/24 07:28
I will open a PR this morning.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.