This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-cf54bd32-0063-49ef-a68d-51fd0f2985d4 XWIKI-25572 Open

Insert the code macro from Quick Actions without the Edit Macro dialog

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-b9870c98-0231-425c-b653-0e4cc79618e9 Charpentier Lucas created this issue on 23/Oct/26 15:55
 
Summary: Insert the code macro from Quick Actions without the Edit Macro dialog
Issue Type: cid:jira-generated-image-avatar-cf54bd32-0063-49ef-a68d-51fd0f2985d4 Improvement
Affects Versions: 17.10.14, 18.8.0
Assignee: Unassigned
Components: CKEditor, Rendering - Code Macro
Created: 23/Oct/26 15:55
Priority: cid:jira-generated-image-static-major-42362519-0ca8-48f4-bfd3-363aeda1b3ad Major
Reporter: Charpentier Lucas
Description:

The "Code Snippet" Quick Action opens the Edit Macro dialog with an empty Content text area, and the code macro is only inserted after the code is typed there and the dialog submitted. The Quick Actions of the other wrapper macros, like warning, insert the macro right away with its content area, and XWIKI-25563 extends this to the macros whose content is their only mandatory field. The code macro has no mandatory field, but its Quick Action is declared to always open the dialog.

The fix is done in the Quick Actions plugin of the editor, plugin.js, in the macro-code action, which runs the xwiki-macro command that opens the dialog: insert the macro directly instead, with an empty code area and the cursor in it, as soon as the code can be edited in place, see XWIKI-19978. The language can then be chosen from the macro, or from the Edit Macro dialog.

Depends on

  • XWIKI-19978, which makes the code of the code macro editable in place.

KOs covered

Macro Criterion Problem Depends on
code I1 pattern The reference wrapper, warning, is inserted by its Quick Action without a dialog; the "Code Snippet" Quick Action opens the Edit Macro dialog. XWIKI-19978
code I3 instant "/code" then Enter, entry "Code Snippet", opens the Edit Macro dialog with an empty Content text area; the macro is only inserted after submitting it. XWIKI-19978

Impact found on macro fluidity

These 2 KOs come from the WYSIWYG usability audit of the macros, under the criteria I1 pattern and I3 instant of its usability criteria, which check that a macro is inserted the same common way as the reference macro of its type, here warning, and that the Quick Action inserts it right away, without the Edit Macro dialog. The page of the macro, linked in the table, has the full notes and the steps to reproduce.