There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-0f441eed-2fcb-4a68-a3d7-bee4ac7af227 XWIKI-25567 Open

Edit the content of the cache, container and context macros in place

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-97f2c28f-965b-42a6-a470-328655927d13 Changes by Charpentier Lucas on 23/Oct/26 17:20
 
Description: The content of the cache, container and context macros is rich text, but the WYSIWYG editor never edits it in place, not even right after the insertion: the editor shows the rendered content as a read-only widget, and changing it needs the Edit Macro dialog, where it is a plain text area in the syntax of the page. The async macro, the sibling of cache, has its content edited in place right after the insertion, and the box macro, like container a layout macro, always has. An empty macro is worse: it shows only the "macro:cache", "macro:container" or "macro:context" placeholder, which one click selects but never puts the cursor in, so the content can only be typed in the Edit Macro dialog.

The macros to change, with the file where most of the fix is done:
* cache: [CacheMacro.java|https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-cache/src/main/java/org/xwiki/rendering/internal/macro/cache/CacheMacro.java].
* container: [AbstractContainerMacro.java|https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-container/src/main/java/org/xwiki/rendering/macro/container/AbstractContainerMacro.java]. The macro does not mark its parsed content as non-generated content, unlike box.
* context: [ContextMacro.java|https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-context/src/main/java/org/xwiki/rendering/internal/macro/context/ContextMacro.java].

The fix is to mark the output of the content as editable in place, as the macros whose content is edited in place do, so that the editor can edit it, also after the page is saved and reopened. An empty content must stay a visible area that one click puts the cursor in, also right after the insertion from Quick Actions.

Once the content is edited in place, it must also be when the macro is in a box, and, with XWIKI-19954 and XWIKI-23309, in a list item or a table cell.

h2. KOs covered
||Macro||Criterion||Problem||
|[cache|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/cache/]|E6 inplace|The content is never edited in place, not even right after the insertion: the editor shows the rendered content, and changing it needs the Edit Macro dialog, where it is a plain text area in the syntax of the page.|
|[container|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/container/]|E6 inplace|The content is never edited in place, even {{{{container}}Some text{{/container}}}} with no layout: the whole macro is a read-only widget and the content can only be edited in the wiki syntax text area of the Edit Macro dialog.|
|[context|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/context/]|E6 inplace|The content is never edited in place: the editor shows the rendered result, and changing it needs the Edit Macro dialog, where it is a plain text area with no editing aid, also for an existing macro.|
|[cache|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/cache/]|E5 empty|Minor. An empty macro, {{{{cache id="x"}}{{/cache}}}}, shows a "macro:cache" placeholder that one click selects but that never receives the cursor.|
|[container|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/container/]|E5 empty|The container inserted from Quick Actions has no content area: it is a "macro:container" placeholder that never receives the cursor, and the content of an existing container cannot be emptied in the editor either.|
|[context|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/context/]|E5 empty|An empty macro stays visible as the "macro:context" placeholder, but clicking it only selects the widget: the cursor never enters it and typed text is not inserted.|
|[container|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/container/]|I2 zero-config|{{{{container/}}}}, inserted from Quick Actions, and {{{{container}}{{/container}}}}, inserted by the Edit Macro dialog with the default values, show a "macro:container" placeholder in the editor and an empty div in view mode: the user sees nothing. Partly covered, see below.|
|[context|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/context/]|I2 zero-config|Minor. {{{{context/}}}} from Quick Actions, or {{{{context}}{{/context}}}} from the Edit Macro dialog with the default values, shows only the generic "macro:context" placeholder in the editor, and nothing at all in view mode, with no error.|
|[cache|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/cache/]|E3 nesting|The macro renders in a list item, a table cell and a box, but its content is never edited in place there, only through the Edit Macro dialog. Partly covered, see below.|
|[container|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/container/]|E3 nesting|In a box, the macro renders, but its content, like a list, a table or a box inside it, is never edited in place. In a list item and a table cell, it fails as a standalone macro, which XWIKI-23501 covers. Partly covered, see below.|

h2. Impact found on macro fluidity
These
8 10 KOs come from the [WYSIWYG usability audit of the macros|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/], under the criteria E6 inplace, E5 empty and , I2 zero-config and E3 nesting of its [usability criteria|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/], which ask that the content is edited in place, with an editing experience suited to its data, not in a text area of the Edit Macro dialog, that an empty content stays visible and editable, with no area that cannot receive the cursor, and that inserting a macro with only default values gives a sensible result. The page of each macro, linked in the table, has the full notes and the steps to reproduce. It is also needed by XWIKI-25563, so that the Quick Action can insert the cache macro without the Edit Macro dialog, and by the issues that put the cursor in the content after the insertion.

The I2 zero-config KO of container is only partly covered here, for the empty content. The same KO also reports that no layout is applied with the default values, covered by XWIKI-25482.


The E3 nesting KOs of cache and container are only partly covered here, for the content edited in place. The same KOs also report problems covered by XWIKI-19954 and XWIKI-23309 for the inline macros and the table cells, and by XWIKI-23501 for container used in a list or a table.