Site editor: Welcome Guide apparition
Description
In trunk and the site editor I'm seeing a brief flash of the template editing Welcome Guide anytime I’ve reloaded the site and go from view mode to edit a page. It doesn’t happen on subsequent switches between the modes.
It works as expected if I create a new user and login. So it probably works right for fresh installs too.
Step-by-step reproduction instructions
- Start from the WP admin Dashboard.
- Visit the site editor.
- Go to "Pages" view
- Use the "Edit" button (pencil icon) to edit the page directly (without first having selected the page)
- Watch for the flash of the Welcome Guide
Screenshots, screen recording, code snippet
https://github.com/WordPress/gutenberg/assets/9000376/12d92c22-6f75-45d9-aafe-6033f5c94061
Environment info
- Trunk
- Chrome
- macOS
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
I tried replicating with 6.6-beta2-58426 using WordPress nightly on Playground and couldn't. Going to add it to the 6.6 board to be safe but curious if others can replicate.
Thanks for testing and putting it on the board. I’m not sure it will be reproducible on Playground as I tested and did’t see any Welcome Guide ever. I thought that was supposed to act like a fresh install so that’s puzzling to me. If no Welcome Guides are shown perhaps we can’t expect the apparition either.
I’m still seeing it on trunk though I've realized there’s another requirement to reproduce. When clicking the "edit" button of a page, the preview has to be showing the initial "home" page. I.e. the page you are about to edit shouldn’t be highlighted/selected. This quite obscure so probably not much of a priority.
I attempted to recreate this bug against 7201eec7ff861b3972b5aa59cdc724f10d4b5325 and with WP 6.6 beta 3 (WP Beta Tester plugin), but I'm not certain I'm following the reproducible steps?
I tested in Chrome 126 with cache disabled and Network throttling for Slow 3G and Fast 3G while clicking through various site editor screens and I was not able to reproduce it.
I’m still seeing it on trunk though I've realized there’s another requirement to reproduce. When clicking the "edit" button of a page, the preview has to be showing the initial "home" page. I.e. the page you are about to edit shouldn’t be highlighted/selected. This quite obscure so probably not much of a priority.
Do you mind providing updated testing steps to recreate the issue please? I'm also wondering if this is impacted by define( 'SCRIPT_DEBUG', true );?
Thanks for testing.
Do you mind providing updated testing steps to recreate the issue please?
I don’t mind but I’m not able to see any missing step. I revised them a bit to hopefully make it more clear. If it helps here’s another repro video (this one from 5738e9b0529eae4678539e28d83747258824df5d):
https://github.com/WordPress/gutenberg/assets/9000376/2cfaf88a-f4df-4903-9bcb-d4371157f6ce
I'm also wondering if this is impacted by
define( 'SCRIPT_DEBUG', true );?
Good query. I checked again and can reproduce either way.
I also tried, but can't reproduce this 🤔
Back here to report that I was able to reproduce this while testing in Playground. I had to visit in a private window to have any Welcome Guides showing up and had to visit the editor once to dismiss the expected ones. After that, exiting to the dashboard and following the reproduction steps worked. Though, I do think sometimes it’s not visible probably due to painting performance variations in the browser.
https://github.com/user-attachments/assets/8e47a59f-f87b-4eba-a196-42c22d2b21d3
Also the reason I tested Playground again was I happened to notice elsewhere @annezazu had reproduced this on Playground https://github.com/WordPress/gutenberg/pull/61489#issuecomment-2108980792, it can be see in that video 11 seconds into it.
Hi, This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.
Just saying this still happens.
I can reproduce - I think it's important that there are no user preferences stored in the browser (the preference key is welcomeGuideTemplate), hence the private window test scenario mentioned above.
I had to screenshot a frame of my screencast as the optimized video reduced the frame rate 😄
As far as I can tell, the template welcome guide will show when the store subscription callback thinks that the current page is a page type and the current post type is a template, among other conditions:
https://github.com/WordPress/gutenberg/blob/8c4be5842025e3e4a707194323258adbdcddeaa4/packages/edit-site/src/components/welcome-guide/template.js#L29-L34
Here's what I'm logging from the selector when I follow the test instructions:
{isTemplateActive: true, isEditorActive: false, isPage: false, currentPostType: 'wp_template'}
{isTemplateActive: true, isEditorActive: false, isPage: true, currentPostType: 'wp_template'} // Flash here - it satisfies the conditions
{isTemplateActive: true, isEditorActive: false, isPage: true, currentPostType: 'page'}
Ramon, thanks for testing and inspecting this. I looked into this further and it appears that the flash of the template welcome guide is only half the issue. The other half is that it never presents as originally implemented in #52014. From what I see there, it should appear when one has chosen to edit a template starting from editing a page. I can’t get that to happen on trunk or testing WP 6.6 on Playground. The latter surprised me because #52014 was apparently backported to 6.6 and should have been working.
I’ve spun up #64789 aimed to resolve this.