There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-b0be9f81-4787-469b-822a-5a97bfbfa5b7 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-5ccff107-4ac5-4e24-83fa-8da1bbf83a3a Changes by Charpentier Lucas on 23/Oct/26 16:18
 
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.

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.|

h2. Impact found on macro fluidity
These
6 8 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 and , E5 empty and I2 zero-config 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, and 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.