Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25523

Allow macros to provide a dedicated representation in the WYSIWYG editor

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.14, 18.8.0
    • CKEditor, Rendering
    • None
    • Unknown

    Description

      Many macros build their output with JavaScript: charts, players, trees, menus, slide-shows, typeset formulas. The WYSIWYG editor does not run that JavaScript, so in the editor these macros show a blank area, a loading message that never ends, the generic placeholder with the macro ID, or the raw HTML fallback of the output, like an expanded bulleted list in place of a menu or raw LaTeX in place of a formula. The user cannot see in the editor what the macro shows, nor sometimes that it is there at all.

      A macro can already detect that it is rendered for the WYSIWYG editor and output something else, but each macro does it on its own: the tree macro checks the current action and editor to show "This tree can't be displayed in edit mode.", and most macros do nothing.

      The main problems:

      • There is no supported way, for Java macros and wiki macros alike, to know that the output is rendered for the WYSIWYG editor.
      • There is no shared edit-mode representation that a macro can reuse, for example its icon, its name and a short summary of what it shows, built from its parameters, like "Pie chart of the table above" or "Video: intro.mp4".

      The improvement is to provide both, so that each macro listed below only has to describe itself in edit mode instead of relying on its JavaScript. Each macro still needs its own change to use it, so this issue partly covers the KOs below.

      Related issues: XWIKI-22046 covers macros with a blank output that get no placeholder, and XWIKI-23036 the attachment gallery picker in edit mode.

      KOs partly covered

      Macro Criterion Problem
      chartjs E1 wysiwyg The canvas of the chart stays blank in the editor, with no placeholder and no text, while view mode draws the chart.
      tableToChartJS E1 wysiwyg The editor shows the table and a blank area in place of the chart, while view mode draws it.
      jwplayer E1 wysiwyg The editor only shows "Loading the video player..." and never changes, while view mode shows the player.
      attachmentGalleryPicker E1 wysiwyg The editor shows only the generic "macro:attachmentGalleryPicker" placeholder, while view mode shows the search field, the buttons and the grid of attachments.
      children E1 wysiwyg The editor shows only the generic "macro:children" placeholder, even when the page has child pages, while view mode shows them as a tree.
      documentTree E1 wysiwyg The editor shows only the generic "macro:documentTree" placeholder, while view mode shows the tree of the wiki pages.
      gallery E1 wysiwyg The editor shows the images stacked one under the other, while view mode shows a slide-show with one image at a time.
      menu E1 wysiwyg The editor shows a nested bulleted list with every sub-menu expanded and low-contrast links, while view mode shows a menu bar whose sub-menus open on hover.
      tree E1 wysiwyg The editor shows a nested bulleted list with every level expanded, while view mode shows a collapsed tree with icons.
      dashboard E1 wysiwyg The editor shows the gadget titles but not their content built by JavaScript, like the page tree and the activity stream, and its dedicated edit representation is only in the inline form editor.
      mathjax E1 wysiwyg The editor shows the formulas as raw LaTeX, while view mode shows them typeset.

      Impact found on macro fluidity

      These 11 KOs come from the WYSIWYG usability audit of the macros, under the criterion E1 wysiwyg of its usability criteria, which accepts a dedicated edit representation that keeps the meaning of the macro. The page of each macro, linked in the table, has the full notes and the steps to reproduce. This issue gives the macros the means to provide that representation; each macro then needs its own change.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Lucas C Charpentier Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: