WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.49k stars 4.19k forks source link

Modals: patterns selector appears over welcome guide modal #65104

Open ramonjd opened 2 months ago

ramonjd commented 2 months ago

Description

The pattern selector modal activates itself with few or no environmental checks when creating a new page.

For new users, the pattern selector will appear over the welcome guide.

The welcome guide is, I assume, a more fundamental introduction to the editor than the pattern selector and therefore should take precedence.

I would expect, rather, the welcome guide to show first. After dismissing the welcome guide only would the patterns selector show.

I'm not quite sure yet, but it might be worthwhile to register open modals through the interface store.

For this specific instance, something like:

// WelcomeGuide component
const { openModal, closeModal } = useDispatch( interfaceStore );
openModal( 'editor/welcome-guide' );
<WelcomeGuide onClose={ onClose } />
// Elsewhere
const welcomeGuideActive = select( interfaceStore ).isModalActive(
    'editor/welcome-guide'
);

Or relocate or remove the intrusive pattern selector modal.

Related

Step-by-step reproduction instructions

  1. Create a new users or better, a fresh WP install with GB trunk active
  2. Delete any preferences in localStorage
  3. Create a new page in the post or site editor
  4. Witness how the the modal compete for you attention

Screenshots, screen recording, code snippet

Site Editor

https://github.com/user-attachments/assets/e19e7fff-f69e-42f8-b40a-b30f275d7935

Post Editor

https://github.com/user-attachments/assets/bbbd4e4c-f46b-42f1-8e3d-6d2ed427d3fd

Environment info

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

annezazu commented 1 month ago

Somewhat related (or would be nice to improve alongside this): https://github.com/WordPress/gutenberg/issues/63947