-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide writing prompt from subsequent empty paragraphs #28275
Conversation
@@ -167,6 +167,7 @@ function ParagraphBlock( { | |||
'Empty block; start writing or type forward slash to choose a block' | |||
) | |||
} | |||
data-empty={ content ? false : true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like doing this, but I didn't see a better way to accomplish it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't explored it myself, but you might be able to use some complex data store scan to achieve the same goal, but the approach proposed it's just simpler and more performant 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the sanity check!
Size Change: +155 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
Did you consider just removing it entirely from the paragraph block? we'd still have it in the default canvas appender. |
Yes, but when you have sibling inserter then empty paragraph then sibling inserter then empty paragraph, it's a bit hard to know where to click without the placeholder guide. That could be an indication to bring the hover styles from the site editor here. |
I am able to test out this PR using http://gutenberg.run/ Concept: I thought the flashing on/off would be distracting, but did not find it as distracting as I thought. I am not sure what to say about it. It is interesting that the empty paragraph text disappears, and reappears on hover. Only the first placeholder empty paragraph text is seen by default. As the layout is built by blocks and I find it a little strange that the user can insert empty paragraphs as kind of like ghost blocks. Creating space between various areas of the layout. EDIT: |
5a51713
to
ef9cf15
Compare
This seems much more clear. |
This is a huge improvement and to me this has already a pretty unimous feedback enough to get it in and progress. I'm going to be hugely brave and remove the feedback label as a result because this is a great improvement to just ship. |
This one revisits work from #27995 (comment).
ef9cf15
to
904ab5b
Compare
I've rebased this one, and tweaked it so there's no hover style: I believe this works well, does not add visual noise. It can further benefit from #29611. Let me know what you think. |
YESSSSS! Thank you! ⭐ |
Why not remove it entirely? The prompt seems only valuable if you have the focus in the paragraph and are ready to type "/". The only way to see the prompt is to select another block, and then select the paragraph again to do it. Maybe we should try to prompt another way, like a tooltip? |
I'd need some help making that happen, but would love to pair with you on that. I also have #29611 separately for a shorter prompt. |
@jasmussen Happy to try it. You think a tooltip is nice or do you envision something else? |
I think it might be worth it to not show anything at all. The first version of this PR had hover effects, but that got noisy fast. |
Maybe this is a place where we can show a one time tooltip? I believe we had some prior work on this with NUX? |
What would the tooltip say? |
The same as the placeholder now I guess. Leave a tip that you can insert blocks with the slash inserter. Just to be clear, I'd also rather remove it entirely, but I assume there was a reason to have it there and since you're keeping it in this PR we don't want to get rid of the message. :) |
Oh you mean remove it from all paragraphs? I was just thinking removing the text from subsequent ones. I think it's necessary for the first paragraph to have the placeholder text. It also provides a visual indication of where you can click to edit. |
This one revisits work from #27995 (comment).
It fixes #13599, mitigates #17366.
It has been edited and refactored.
What it does is, if you have 5 empty paragraphs in succession, only the first one shows a tip: