You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hide empty paragraph block placeholder when it’s the only block when zoomed-out #65474
After some discussion the new requirement here seems to be:
Don't show paragraph block placeholder if
it's the only block on the page
we're on an empty Page/Post
we're Zoomed Out.
Description
When zoom out mode is active in the editor / site editor, empty paragraph blocks continue to display their Type / to choose a block placeholder state, even though they cannot be selected.
Should this be hidden in zoom out mode?
Step-by-step reproduction instructions
In a template, somewhere in the middle of the template, add an empty paragraph block
Click the Zoom out button at the top right of the site editor
Notice that the paragraph placeholder is still visible even though you can't click on it
Screenshots, screen recording, code snippet
In the following screenshot, the empty paragraph block there cannot be selected, but its placeholder is still visible. Should it be hidden?
@getdave@andrewserong since we're eventually going to bring edit mode into zoom out view - see #65702 - then this would not be a problem since the content in placeholder mode is simply editable?
@richtabor I don't understand 😄 how is the roughness related to this issue. This issue is "should the placeholder still be visible if the paragraph is empty" with the implication arond other placeholders ... The poor UI in the recording is something else, am I wrong?
When zoom out mode is active in the editor / site editor, empty paragraph blocks continue to display their Type / to choose a block placeholder state, even though they cannot be selected.
Issues I noticed above in @richtabor's testing video:
Accidental selection of core/post-content block. This is the "section root" and we've deliberately set this to be enabled but in contentOnly mode. What affordances do we want around this element or do we just want to hide it (including when it's a <main> tag in other scenarios?
Anything else I missed? Can we close this one out or do we want to change the way the placeholder behaves?
I don’t think leaving the placeholder is a good idea if it’s the only block on the page (an empty page/post) while zoomed out. Otherwise, it’s easy to get into that odd experience I shared above. Does that empty paragraph stay in place when a pattern is inserted from this view?
Code-wise - placeholders are hard coded into the various blocks. Example:
placeholder={ placeholder ||__('Heading')}
You can set the placeholder as an attribute to an empty string (I think) but that would cause a block modification and we'd have to restore the attribute when leaving Zoom Out.
Anyone else got a suggestion for how we could go about implementing this?
Anyone else got a suggestion for how we could go about implementing this?
Could one option be to use CSS to hide the placeholders, if that's all we need to do (rather than changing the wording)? There's already one case where we set opacity to 0 in some circumstances, so perhaps there's a precedent:
I guess the challenge would be if we have the right selectors available for a CSS condition that matches the situation where we want the placeholder to be hidden?
But will we also remove the block (the empty paragraph) or will the empty paragraph show up when we exit zoom out? I can see it as a source of frustration already.
I am really suspicious of these just in time tweaks that hide stuff. It seems there is an underlying UX issue to solve and we're obscuring it here.
changed the title [-]Zoom out view: Empty paragraph placeholder (type / to choose a block) is visible even when it cannot be selected[/-][+]Hide empty paragraph block placeholder when it’s the only block when zoomed-out[/+]on Nov 8, 2024
Activity
getdave commentedon Sep 20, 2024
The question at hand seems to be: if a block is in it's placeholder state / empty should it be displayed when
contentOnlyisdisabled?andrewserong commentedon Sep 22, 2024
Good point, it's probably the same for a bunch of other blocks, too, e.g. the empty Tag line block that also nudges folks to start typing 🤔
draganescu commentedon Sep 30, 2024
@getdave @andrewserong since we're eventually going to bring edit mode into zoom out view - see #65702 - then this would not be a problem since the content in placeholder mode is simply editable?
richtabor commentedon Sep 30, 2024
I'm testing #65702 here; it's still a rough case:
CleanShot.2024-09-30.at.10.17.17.mp4
draganescu commentedon Oct 1, 2024
@richtabor I don't understand 😄 how is the roughness related to this issue. This issue is "should the placeholder still be visible if the paragraph is empty" with the implication arond other placeholders ... The poor UI in the recording is something else, am I wrong?
getdave commentedon Oct 1, 2024
The original issue was:
I re-tested this and found
Testing videos
Screen.Capture.on.2024-10-01.at.11-16-06.1.mp4
Screen.Capture.on.2024-10-01.at.11-16-44.mp4
Issues I noticed above in @richtabor's testing video:
core/post-contentblock. This is the "section root" and we've deliberately set this to be enabled but incontentOnlymode. What affordances do we want around this element or do we just want to hide it (including when it's a<main>tag in other scenarios?Anything else I missed? Can we close this one out or do we want to change the way the placeholder behaves?
richtabor commentedon Oct 2, 2024
I don’t think leaving the placeholder is a good idea if it’s the only block on the page (an empty page/post) while zoomed out. Otherwise, it’s easy to get into that odd experience I shared above. Does that empty paragraph stay in place when a pattern is inserted from this view?
getdave commentedon Oct 3, 2024
Based on that I'd say this is the new requirement.
Don't show paragraph block placeholder if
LMK if that is not correct. Thanks 🙇
richtabor commentedon Oct 3, 2024
Yup!
getdave commentedon Oct 3, 2024
Code-wise - placeholders are hard coded into the various blocks. Example:
You can set the
placeholderas an attribute to an empty string (I think) but that would cause a block modification and we'd have to restore the attribute when leaving Zoom Out.Anyone else got a suggestion for how we could go about implementing this?
andrewserong commentedon Oct 3, 2024
Could one option be to use CSS to hide the placeholders, if that's all we need to do (rather than changing the wording)? There's already one case where we set opacity to
0in some circumstances, so perhaps there's a precedent:gutenberg/packages/block-library/src/paragraph/editor.scss
Lines 13 to 19 in 1a29c02
I guess the challenge would be if we have the right selectors available for a CSS condition that matches the situation where we want the placeholder to be hidden?
draganescu commentedon Oct 7, 2024
But will we also remove the block (the empty paragraph) or will the empty paragraph show up when we exit zoom out? I can see it as a source of frustration already.
I am really suspicious of these just in time tweaks that hide stuff. It seems there is an underlying UX issue to solve and we're obscuring it here.
4 remaining items
colorful-tones commentedon Oct 14, 2024
I'm adding this to the WP 6.7 project board. Although, it sounds like it'll just get the Punt to 6.8 status.
getdave commentedon Oct 15, 2024
I would vote to punt this to 6.8 👍
ndiego commentedon Oct 15, 2024
Sounds good, thanks @getdave
[-]Zoom out view: Empty paragraph placeholder (type / to choose a block) is visible even when it cannot be selected[/-][+]Hide empty paragraph block placeholder when it’s the only block when zoomed-out[/+]getdave commentedon Dec 16, 2024
I looked into this. Before we can action we need to fix #67564 otherwise you cannot insert any Patterns at all.
Related is also #68026