plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
459 stars 624 forks source link

When floating an image I can't control which block should return to full width #4439

Open djay opened 1 year ago

djay commented 1 year ago

Problem

You can float an image but there is no way to specify which paragraph should stop being floated

Proposed Solution

Solutions considered

Row/Grid float settings

We could get rid of the alignment option for images/videos and instead make this an option for the Row Block. So a row in left float mode would take the left cell and merge it into the 2nd left cell so the 2nd left cell flowed around the left cell.

Pros: Why this could be a good idea

Cons:

float filler block (better name?)

separator/spacer block

Clear above/full width setting on all blocks

On block menu

on slate editor toolbar

Headings always clear

Simpler solution with less control where certain blocks or headings clear so if you want to stop the wrapping you are forced to use a heading or row or something designed to always be full width below your image

Context

tiberiuichim commented 1 year ago

What about a divider block. In the editing interface you add the divider block and clearly have it delimited and editable, then just render it as hidden in view mode. As a bonus, the divider block could be used to delimit sections, if you implement variations for it.

davisagli commented 1 year ago

@tiberiuichim That's exactly what we've done in client projects. We have a separator block which clears floats. It has an alignment setting with several options (full, center, left) and an option to hide the line entirely.

https://github.com/kitconcept/volto-separator-block

djay commented 1 year ago

@davisagli @tiberiuichim The downside of a separator or divider is if you don't want to add space below the image. Even if it was the case the final rendered version added no space, the editor would have to show some space in order for you to be able to click on that block to select it It might be more intuitive for the user if there was a "filler" block that was placed below the text but floated next to the image and automatically took up the space until the bottom on the image. ie it would sit beside the image not below it. Not how CSS works and not so easy to do technically but at least it has block you can click on that isn't breaking WYSIWYG.

davisagli commented 1 year ago

@djay Feel free to create your own block! It's been working fine for our clients.

djay commented 1 year ago

@davisagli the bug report is not about creating our own block. of course we will. The bug report is that core plone 6 currently allows people to float images without providing any method to control this making for a shit UX and thus calling into question the Plone 6 editor has been well thought out and tested on real users. If the answer to every UX bug anyone ever brings up is tell them to go make your own block, or it's fine for some subset of users which might have very different training or technical ability, then I think the investment in switching plone to volto is wasted.

tiberiuichim commented 1 year ago

@djay I've tried to understand your requirements, but I couldn't. Could you make some schematic or some drawing explaining the problem?

I've tried to see what the Plone classic provides for this use case, and I could not find it. If we know the equivalent Plone classic functionality, maybe it's easier to replicate it.

image

In any case, my argument is that once we know what we want, it should be relatively easy to add it as functionality in the slate editor, either as a block setting or as an extra button in its toolbar.

djay commented 1 year ago

@tiberiuichim not really my requirements. I'm not ordering software. it's really up to the non existant Plone UX person to decide on the best solution for users. I've updated the solutions above with screenshots. Whatever the tinymce solution was it was likely crap. We should be aiming higher.

tiberiuichim commented 1 year ago

ok, so if we "parent" the "filler space control" to the image, we can provide the image block a way to control the paragraphs blocks.

Neat. I think we may have something workable here.

As a side note, to me, needing to specify clearings on paragraph blocks is a "smell". The floated image, as a whole concept, is something nasty in itself. If some text is supposed to sit next to an image, maybe a form of hero block would be better. Or maybe just declare in css that all headlines have clear.

djay commented 1 year ago

Not sure what you mean by parent. There is no containment relationship between image, text or filler .

Yes you could say all headings clear but then what if it's a teaser or something else?. What if it's a text block after with normal text that you want to be below the image not next to it..

Yes grids or rows will most likely fit most people's needs. But there is still some layouts where people want text to flow around an image. But getting rid of floats is certainly another solution.

djay commented 1 year ago

@tiberiuichim thinking out loud here and please don't shoot me for thinking of yet another way to solve this. Again I'm requiring anyone impliment anything. I'm mearly trying to work out what would be the optimal way to solve this for the end users to give them the best UX and again this would have to be verified and tested by a proper UX person rather than developers giving their opinions.

But. We could get rid of the alignment option for images/videos and instead make this an option for the Row Block. So a row in left float mode would take the left cell and merge it into the 2nd left cell so the 2nd left cell flowed around the left cell. Why this could be a good idea

tiberiuichim commented 1 year ago

I think having the "some column is floated" is a nice idea and could be implemented in the Row block.

I've been toying at some point with the idea of trying to optimize the editor's workflow: if they want to lay out something on the side, they need to create a row block, move the existing content to the block and so on. My idea was to replace the default text block with something that would allow the editors to click on the left / right side of the block and create new columns / placeholders. It's this thing, as a proof of concept, I don't know how well it would work with current Volto: https://github.com/tiberiuichim/volto-rail-block

djay commented 1 year ago

@tiberiuichim sounds nice but also sounds like it's just getting closer to mosaic and the generalised ability to move a block next to another block to create a row? Something I know that the original designers on volto were keen to avoid. I can't remember why but is true that the way this works in notion is bit of a pain because you find it happen when you don't want it.