Skip to content

Fix: The List View sidebar needs a message#69648

Open
Rishit30G wants to merge 4 commits intoWordPress:trunkfrom
Rishit30G:fix/no-block-message-block-editor
Open

Fix: The List View sidebar needs a message#69648
Rishit30G wants to merge 4 commits intoWordPress:trunkfrom
Rishit30G:fix/no-block-message-block-editor

Conversation

@Rishit30G
Copy link
Contributor

@Rishit30G Rishit30G commented Mar 21, 2025

What?

Closes #69647

Why?

This PR is necessary to add the 'No blocks added yet, open the block inserter to add one or start typing!' text when no block is selected in the block editor.

How?

This PR adds the necessary text and styling required to display the above text.

Testing Instructions

  1. Create a new post
  2. Click on Document Overview
  3. Notice that the 'List View' Tab has 'No block selected.' text when no block is selected.

Screenshots or screencast

Before After
Screenshot 2025-03-21 at 11 30 44 AM Screenshot 2025-03-26 at 9 05 37 AM

@Rishit30G Rishit30G requested a review from ellatrix as a code owner March 21, 2025 06:30
@github-actions
Copy link

github-actions bot commented Mar 21, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Rishit30G <rishit30g@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org>
Co-authored-by: luminuu <luminuu@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Infinite-Null
Copy link
Contributor

Hi @Rishit30G,
This PR looks great 👍.
Note that accessibility concerns have been raised regarding centering text. See #67730.

I think it would be great to not center the text vertically like done in this PR #67731

image

@Mamaduka
Copy link
Member

The current behavior is correct, IMO. I left a more general comment on the issue: #69647 (comment).

@Rishit30G
Copy link
Contributor Author

Thanks @Infinite-Null for the insights! 🚀

@Rishit30G Rishit30G changed the title Fix: The List View sidebar needs a “No block selected” message Fix: The List View sidebar needs a “No block exists.” message Mar 23, 2025
@Rishit30G Rishit30G changed the title Fix: The List View sidebar needs a “No block exists.” message Fix: The List View sidebar needs a message Mar 24, 2025
@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. [Feature] List View Menu item in the top toolbar to select blocks from a list of links. labels Mar 26, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

We should be able to inject a message without using CSS. Example:

if ( ! clientIdsTree.length && ! showAppender ) {
	return (
		<Spacer padding={ 4 }>
			<Text>
				{ __(
					'No blocks added yet, open the block inserter to add one or start typing!'
				) }
			</Text>
		</Spacer>
	);
}

I'd love to hear other people's feedback on the text, but it seems a bit active to me 😄

@Rishit30G
Copy link
Contributor Author

Rishit30G commented Mar 26, 2025

Thanks @t-hamano! 👍🏻
I have updated the PR

Edit: Sure, we can tag the relevant people to look into the text, that should expedite the process!

@Rishit30G
Copy link
Contributor Author

I just wanted to check if everything looks good or if there are any improvements we should consider. 🙇🏻

@t-hamano t-hamano requested a review from a team April 29, 2025 12:58
@t-hamano
Copy link
Contributor

Sorry for the late reply. Everything seems OK from a code perspective.

@WordPress/gutenberg-design I'd love to hear your feedback about the copy text!

image

@Rishit30G
Copy link
Contributor Author

No worries @t-hamano, thanks for the update! 😄

@annezazu annezazu added [Type] Copy Issues or PRs that need copy editing assistance Needs Copy Review Needs review of user-facing copy (language, phrasing) labels Nov 8, 2025
@github-actions
Copy link

github-actions bot commented Nov 8, 2025

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Type] Enhancement, Needs Design Feedback, [Type] Copy, Needs Copy Review, [Feature] List View.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@jasmussen
Copy link
Contributor

Perhaps frustrating, but I find myself agreeing with motivations both for and against the message here:

  • When the list view is entirely empty, its purpose might be unclear
  • When there's something inside the list view that is not blocks, it dilutes the list view itself

In that light, both opinions are valid, yet I'm finding myself softly leaning towards not adding a message here, at least yet. There are a few motivations, one of them already expressed by @Mamaduka elsewhere: it's a list of blocks. Separately, it's an interface not shown by default, to an extent intended for advanced users, so it's unclear how impactful #69647 is. Finally, I believe there are other ways to address the issue, which can perhaps be reduced to the following. Shown here, a fresh post:

2025-11-10 08 25 18 localhost 7d7f0ef0e4e5

And here, the "Type / to choose a block" has been clicked, a paragraph has actually been inserted.

Both of these images are arguably the same, and the actual difference between the two is difficult to explain: the former has only a placeholder paragraph, but no actual content. The latter actually does have a paragraph—a dirty document—that's just empty.

If there's an issue—which is not clear—that would arguably be the one to fix: when the document is empty, it doesn't appear as empty. And my main concern with moving this PR forward is that it's going to make that state worse: suggesting there are no blocks when there clearly appears to be an empty paragraph, I worry, doesn't fix the issue at hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] List View Menu item in the top toolbar to select blocks from a list of links. Needs Copy Review Needs review of user-facing copy (language, phrasing) Needs Design Feedback Needs general design feedback. [Type] Copy Issues or PRs that need copy editing assistance [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The List View sidebar needs a “No block selected.” message.

6 participants