There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-11395da2-d02a-471d-bb34-5258481c7cfa XWIKI-23042 Open

Macro parameters shouldn't have their order changing when they have a value

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-83449bd6-8406-4c24-994b-c645bb73b18e Marius Dumitru Florea on 27/Mar/25 09:38
 

I think we need to agree on these related topics first:

  1. What's the expected order between the macro parameters?
    • Either rely only on the order in which the macro parameters are listed / defined in the macro descriptor (assuming that the macro descriptor respects the order in which the macro developer has defined the macro parameters in their code)
    • Or group macro parameters by importance / priority (e.g. mandatory, optional, advanced, deprecated, etc.). Inside each group the macro descriptor order would be used.
      • Should the macro priority change (within its group) when its value is set?
  2. Should we display all the macro parameters all the time?
    • Yes: then we use whatever order we get from the macro descriptor; problem fixed
    • No: Some macros have lots of parameters, most of them optional, some advanced, some deprecated, etc. we display only a limited number of parameters first, with a More button / link
  3. Is it important for the user to see right away which macro parameters have a value set?
    • No: then we keep hidden macro parameters with a value set hidden; problem solved
    • Yes: Then we need to:
      • either show those parameters with a value set that are hidden initially under More => the order between the macro parameters changes
        • we could restore the macro descriptor order once the More button / link is clicked, i.e. when all parameters are shown
      • or indicate somehow to the user that there are some hidden parameters with a value set

The current state is:

  • Group macro parameters by importance (so from the start, the order from the macro descriptor is only partially respected).
  • Not all parameters are shown by default (when there are many parameters, not all mandatory).
  • Show macro parameters with a value set (that otherwise would have been hidden under More) => this further changes the order compared to the macro descriptor

Note that the order currently changes only for the macro parameters that are hidden initially under More. This means:

  • mandatory parameters are not affected (they are always displayed at the top, using the order from the macro descriptor)
  • macros with a few parameters are not affected because all their parameters are shown from the start, so there's no order change (beyond the grouping by importance)