This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-fdfb9832-186b-4e08-8bf8-798d9162c4e2 XWIKI-25180 Open

Allow macro parameters to declare that they depend on another parameter

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-3df2ad77-68f2-46c1-af79-fb79eb8a1b0b Charpentier Lucas created this issue on 06/Oct/26 10:23
 
Summary: Allow macro parameters to declare that they depend on another parameter
Issue Type: cid:jira-generated-image-avatar-fdfb9832-186b-4e08-8bf8-798d9162c4e2 Improvement
Assignee: Unassigned
Components: CKEditor, Rendering
Created: 06/Oct/26 10:23
Priority: cid:jira-generated-image-static-major-d895c0b0-0b25-49c8-8752-553201da0677 Major
Reporter: Charpentier Lucas
Description:

Some macro parameters are only relevant, or only valid, once another parameter has a given value. The macro descriptor cannot express this, so the Edit Macro dialog always shows every parameter as independent. The user has to guess which fields matter, and can fill a field that is then silently ignored.

@PropertyFeature and @PropertyGroup already cover mutually exclusive alternatives, but not a "parameter B depends on parameter A" relation.

Example: a parameter that only makes sense when a boolean option is enabled, or a parameter whose allowed values depend on the value chosen in another one.

Expected

A parameter that depends on another one is hidden or disabled until the parameter it depends on is filled with a value that makes it relevant.

Actual

All parameters are always shown and enabled.

Proposal

  • Add a way for Java and wiki macros to declare a dependency between parameters in the macro descriptor, for example a new annotation and its wiki macro parameter equivalent.
  • Expose it through the macro descriptor used by the editor.
  • Make the Edit Macro dialog hide or disable dependent parameters until their condition is met.

Once the descriptor supports it, existing macros can be updated one by one, and new macros can use it from the start.

Raised in https://forum.xwiki.org/t/brainstorming-usability-criteria-for-auditing-macros-in-the-wysiwyg-editor/18907/19