-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Conditionally render page status views #63685
Comments
cc @jameskoster for design feedback. 🙏 |
This seems a bit related to #57072 in that it helps you quickly identify when a view is empty. Hiding empty views should probably be a component-level change. In that respect would you also expect empty pattern categories to be hidden? What if there are no posts at all, should the "All posts" view be hidden? That one feels like an exception. How about if you filter a view so that it becomes empty, does it disappear from the sidebar? 🤔 We should also consider custom views. If they're hidden when empty, users might mistakenly think the view they created has been deleted. Similarly if you create a view that returns no results, there would be no way to access the view to edit it's properties. I like how this would tidy up the UI, but there are a few tricky nuances to consider. |
Yes, I would. I think they are hidden, at least in the Inserter.
Yes, this is the exception. Here's WP Admin > Posts, with no posts:
Perhaps we're too liberal with allowing removal of filters when a view is configured—at least on core-supplied views. Otherwise, if I remove the "Scheduled" filter, when I'm viewing scheduled posts, I'm not viewing scheduled posts anymore, even though the UI indicates that I am.
I'd probably treat custom views like "All" — always there. If you manipulate a filter there and save it, it's yours. You can rename the view too, so you don't get stuck in the scenario above. |
Absolutely. That will be fixed by #60472 and #60468. However, what if you filter the Scheduled view by an author with no scheduled pages? The count will be zero, but the view still visible.
Agreed. TLDR I suppose the logic goes: For views except "All pages" and any custom/customised views, hide the menu item when count = 0, unless the count = 0 due to customised filters. What do you think? |
Yes, that'll work. |
I'm pulling from how WP Admin > Pages view works, where the link to the"Pending Review" filtered view is rendered only if there are posts that are set to pending review.
I think we should map that same functionality to each of the statuses in the Site Editor > Pages view.
I.e. if a view renders no results, it should not be available.
Visuals
The text was updated successfully, but these errors were encountered: