There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-a7d3f579-4528-485b-bbb7-cfdb25decf5f 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-cf0fa8f4-bfe3-40e9-93c0-b7d81412f197 Changes by Charpentier Lucas on 23/Oct/26 16:08
 
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.|

h2. Impact found on macro fluidity
These
3 6 KOs come from the [WYSIWYG usability audit of the macros|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/], under the criterion criteria E6 inplace and E5 empty of its [usability criteria|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/], which asks 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 . 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.