There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-f68a53e1-5a4b-4f06-be99-f69993859a3b XWIKI-24373 In Progress

Integrate BlockNote with the realtime editing toolbar

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-f43edc8f-02eb-4a25-8a02-ffcbb30db873 Marius Dumitru Florea on 17/Oct/26 21:39
 

Implemented in 3 commits, applied on stable-18.9.x and cherry-picked on master (reviewed in https://github.com/xwiki/xwiki-platform/pull/6938, https://github.com/xwiki/xwiki-platform/pull/6952 and https://github.com/xwiki/xwiki-platform/pull/6962):

What changed for users

  • While editing with BlockNote in realtime, in both the standalone and the in-place edit modes, the standard edit toolbar is replaced by the realtime toolbar: connection status, coeditors, save status, version history, Done and Summarize & Done. Leaving the collaboration and selecting a coeditor are not available with BlockNote yet.
  • The realtime CKEditor and wiki editors use the same toolbar, rewritten as a Vue component, with no visible change.
  • Fixes found while testing:
    • The list of coeditors was always empty with BlockNote (and Cristal).
    • The first save of a new document wasn't reported to the other coeditors.
    • Done could leave the edit mode before the other coeditors learned about the saved version, so their next save hit a merge conflict (CKEditor and the wiki editor too). Done in the in-place edit mode no longer reloads the page.
    • A coeditor who left the page stayed listed for up to 30 seconds, and a coeditor who joined didn't see the others until their next update.

What changed for developers (all the new APIs are @beta, since 18.9.0RC1)

  • New @xwiki/platform-collaboration-toolbar package, loaded through the import map so that a single copy is shared by all the editors, and wrapped by the new xwiki-platform-realtime-toolbar-webjar. The toolbar no longer depends on the realtime configuration: the version summary and minor edit options come from the edit form, the icons from the icon theme, the date format from the new data-xwiki-date-format page meta attribute (xwiki-meta dateFormat). Its translations moved from the Netflux API to the toolbar WebJar.
  • joinFormCollaboration() (@xwiki/platform-collaboration-xwiki) joins the collaboration session of a document edited with an edit form, starts the auto-save and creates the toolbar, shared by the editors of the session; createYjsToolbar() keeps a toolbar in sync with a Yjs session.
  • Auto-save: the Saver status is reported through listeners; XWikiFormSaveContext now holds what the save does (XWikiFormSaveAction: saveAndView, saveAndContinue, autoSave) instead of the clicked button, and XWikiFormSaveTarget#getSaveButton() is no longer public (both were @beta in 18.8.0); new SaveTarget#getAutoSaveContext().
  • New generic await! RequireJS plugin, for modules whose value is a promise.

Tests

  • Unit tests for each change; the BlockNote functional tests now save through the realtime toolbar, with new collaboration scenarios ported from the realtime CKEditor tests (edit alone, edit with self, prevent empty revisions, no merge conflict on Done, mandatory version summary).
  • Docker functional tests on stable-18.9.x with the 3 commits, with Firefox and Chrome: realtime wiki, realtime WYSIWYG and BlockNote all passing (two Chrome failures, RealtimeWikiEditorIT.toggleRealtimeWithSelf and ImageIT.editImage, passed when re-run).

Left to do

  • A Weblate component for the translations of the new toolbar WebJar.