Skip to content

Conversation

@sidharthpandita1
Copy link
Contributor

@sidharthpandita1 sidharthpandita1 commented Oct 23, 2025

What?

Closes #72620

Adds snackbar notices to provide immediate feedback when users create a new page from the Navigation block.

Why?

User testing with 20 participants revealed that users are uncertain whether page creation was successful when using the Navigation block's page creator. Without visual confirmation, users don't know if:

  • The action completed successfully
  • They need to wait longer
  • They should try again

This lack of feedback creates confusion and a poor user experience, especially for less technical users who may not realize the page was created.

How?

This PR adds snackbar notices to the LinkUIPageCreator component in page-creator.js:

  • Success notice: Displays "Page created successfully." when the page is created
  • Error notice: Displays "Failed to create page. Please try again." when creation fails
  • Uses the existing @wordpress/notices store for consistency with other Gutenberg notifications
  • Snackbar-style notices are non-intrusive and auto-dismiss after a few seconds

The implementation adds:

  1. Import of noticesStore from @wordpress/notices
  2. useDispatch hook to access createSuccessNotice and createErrorNotice
  3. Success notice triggered after successful page creation
  4. Error notice triggered in the catch block when creation fails

Testing Instructions

  1. Open a post or page in the editor
  2. Insert a Navigation block
  3. Click on the Navigation block to open the block settings
  4. Click the "+" button to add a new page link
  5. In the dropdown, click "Create page"
  6. Enter a page title (e.g., "Test Page")
  7. Click "Create page" button
  8. Expected: A green snackbar notice appears at the bottom saying "Page created successfully."
  9. The notice should auto-dismiss after a few seconds
  10. Try creating another page to verify the notice appears consistently

Test error scenario:

  1. use browser dev tools to simulate network failure
  2. Follow steps 1-7 above

Testing Instructions for Keyboard


Screenshots or screencast

Screenshot 2025-10-23 at 3 44 34 PM
Before After
No visual feedback after clicking "Create page" - users uncertain if action completed snackbar appears at bottom: "Page created successfully." providing immediate confirmation
Before: No feedback shown After: Success snackbar visible

Note: This change addresses UX feedback from unmoderated user testing where participants expressed confusion about whether the page creation action had completed successfully.

@github-actions
Copy link

github-actions bot commented Oct 23, 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: sidharthpandita1 <sidharthpandita@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>

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

@sidharthpandita1
Copy link
Contributor Author

@t-hamano

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Navigation Link Affects the Navigation Link Block labels Oct 23, 2025
@t-hamano t-hamano requested review from getdave and scruffian October 23, 2025 11:49
Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Thank you for the PR.

Checking out your branch it looks like you may need to bring in some upstream changes to your fork because I'm missing the Create page option in the Nav block.

If you could update and then rebase your PR that would be great.

@sidharthpandita1 sidharthpandita1 force-pushed the add/navigation-page-creation-notices branch from f090719 to 7259f3d Compare October 23, 2025 14:13
@sidharthpandita1
Copy link
Contributor Author

Thanks — I’ve rebased on upstream/trunk and updated the branch. @getdave

Copy link
Contributor

@scruffian scruffian 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 working on this, looks good!

@scruffian scruffian merged commit 80d4dab into WordPress:trunk Oct 26, 2025
33 checks passed
@github-actions github-actions bot added this to the Gutenberg 22.0 milestone Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Navigation Link Affects the Navigation Link Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide confirmation notice when new Page is created from Navigation block

4 participants