-
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
Block list: Add option in editor settings to show open list view as default #40757
Conversation
Size Change: +6.62 kB (+1%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
Add basic e2e test Update snapshots Add example single test run to playwright readme
packages/edit-post/src/components/preferences-modal/test/__snapshots__/index.js.snap
Show resolved
Hide resolved
This tested as advertised for me - even across browsers. Just left a question about the value of the snapshot test, but that doesn't need to be a blocker to getting this merged I don't think. |
…nders using useEffect
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.
This works great for me, I think it'll be a really useful feature for folks who prefer to design their posts and sites via the list view 👍
Separately / in a follow-up as the site editor gets more features added to the preferences modal, we might want to look at the sorting of the feature and where it appears in the list, as the lists aren't quite consistent at the moment (Always open list view
is third in the list in both cases, but the Display button labels
is in a different position and has a different label):
Post editor | Site editor |
---|---|
Keep this feature 3rd in the list in both places makes it easy to find though, so I don't think we need to change anything just yet.
I also added a comment about a not-blocking nit of whether we should explicitly set the default in edit-post
like we've got the default in edit-site
?
But no blockers from me, I think this looks great! 🎉
Thanks for testing this little one @andrewserong !
Excellent point. I think they should be consistent in both copy and order. I'll add a follow up to this PR after merging.
Fixed! 🙇 |
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.
This looks good to me 👍 !
Lately I noticed that List View kept opening. I went to a page List View was open. I closed it. I exited the page and came back to it later on. I noticed again that List View was open. I closed it again. I viewed the page and came back to it. List View was open again. I thought it was a bug. I wrote about this in the core editor channel on Slack. In general the user would not discover the option has been added to Preferences, and will probably do as I was, click to close List View over and over again. There should be a kind of remembrance. When the user closes List View is should be closed until the user decides to reopen it. Or else the program decides for the user giving the user less control over the program. As a user I want to control the program. I want the program to remember when I open and close something. That it does not reopen something I have already closed. As the new option has been added to preferences it should by default be off. It is better for the user to discover the option because they want something to happen than go to preferences because they want to turn something off. Often I do not use List View because I just go to a post/page and make simple adjustments. List View would be nice to use for more complex adjustments. When I visit various web sites I handle there are most of the times just simple adjustments to make where I do not need to use List View. |
Interesting. The intention was, and testing back then demonstrated, that the default was See the site editor and post editor default preferences. I can take a quick look in the morning to see if there's a bug there or something has changed in the meantime. |
Great it is a bug I experienced! |
@paaljoachim Thanks for the info here! Quick question: does the list view persist if you clear local storage? If the list view doesn't show up on refresh, then things are working as intended. I tested this and it looks okay. Another way to test this while developing is to run Refresh the post editor and it should show by default (nothing will appear in local storage until you manually toggle the preferences using the preferences modal). If this is not working for you, then let me know the steps you took to recreate the issue and I'll dig deeper. On a side note I found a small typo in the site editor default preferences, so thanks for bringing this issue to my attention! This would have had no effect on whether the block list displayed by default or not. I threw up a PR: |
Also, @talldan reminded me that preferences are stored in user meta in the database, so you also might need to remove those to test, or, if you're using the wp-env environment, destroy/rebuild. wp.apiFetch( {
path: '/wp/v2/users/me',
method: 'PUT',
data: {
meta: {
persisted_preferences: {},
},
},
} ); |
I double-checked this, as I had recently set up a fresh local WordPress environment. The preference definitely defaulted to switched off for me. @paaljoachim Is there a chance you may have turned it on accidentally? Maybe try testing using something like Local by Flywheel so that you have a completely fresh instance of WordPress. |
Hi Dan and Ramon. I met this List View option through a full site editing local web site that I have. I use it for testing various Gutenberg PR builds, and general exploration. For whatever reason List View began to open up every time I entered a page or post, even with the regular Gutenberg plugin installed. I deactivated and removed and installed the Gutenberg plugin again. Then turned off the preference option. I have tested other local sites that I have and also a few online, and did not see the same thing there. Thank you! Calling this solved. Gremlin removed from the test site...:) |
Resolves #40565
What?
A preference to have the block list view open by default. 🪄
May-03-2022.10-09-14.mp4
Why?
Some folks use the block list view all the time.
Creating an option to have it opened by default will save these folks approximately a couple of seconds every time the editor loads. Over a year this could save up to forty-two minutes.
How?
Adding an extra feature option to the post and site editor preferences modals.
Note: the post editor preferences modal has not yet been migrated over to the preference store, hence the use of
isFeatureActive
in packages/edit-post/src/components/layout/index.jsSee site editor migration over at #39485
Testing Instructions
Always open list view
Run the e2e playwright test for glory!