xwikisas / xwiki-pro-macros

XWiki rendering macros useful when migrating content from Confluence
GNU Lesser General Public License v2.1
3 stars 12 forks source link

Edit mode display of the view-file macro looks unbalanced, aesthetically unpleasing #310

Open lucaa opened 1 month ago

lucaa commented 1 month ago

How to reproduce:

Actual result:

image

  1. there is some asymetric whitespace under the name of the file in edit mode
  2. the whitespace between the attachment box and the following element is completely missing. This is not the same for other macros, as in the screenshot with info and warning, but this also reproduces with html macros or paragraphs.
  3. the filename passes on the next line, but not clear why as there seems to be a ton of space available - note that this doesn't seem to happen on Firefox, only on Chrome.

Expected result:

  1. symmetric whitespace
  2. proper spacing from surrounding elements - this is also an issue for the view mode, the spacing is too small compared to a spacing between paragraphs
  3. cleaner display of the filename - either surround the file with a box so that it's clear why the filename is cut, or display it entire.
lucaa commented 1 month ago

proper spacing from surrounding elements - this is also an issue for the view mode, the spacing is too small compared to a spacing between paragraphs

For this, note that there is a logic in the XWiki skin / content for spacing elements (we are adding margin bottom to all elements, so that the next element is spaced properly). Ideally, this macro (and all macros) should follow that spacing. Also ideally, we shouldn't hardcode the rule of the spacing in the macro code.

Now, I don't know whether there is any "standard" element that could be re-used to obtain the effect with the standard CSS - apparently divs don't have it by default, which is normal. To compare this with other macros that generate divs, to see what is the rule that they use..

lucaa commented 1 month ago

tested with Pro macros 1.19.9 on XWiki 16.4.1