Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#62431 closed defect (bug) (reported-upstream)

Inconsistant behavior of the pattern block hamburger modal popup in site editor

Reported by: rickers's profile rickers Owned by:
Milestone: Priority: normal
Severity: normal Version: trunk
Component: Editor Keywords: needs-patch
Focuses: Cc:

Description

Demonstration steps:

  1. "appearance"->"editor"->"patterns"->"all patterns", pick an unlocked pattern's hamburger icon (to get more options in popup to demonstrate the inconsistancy)
  2. behavior A:
    1. select popup action "export as json" and observe the modal has been closed in the background.
    2. click "cancel" in file select modal and observe hamburger popup remains closed.
  3. behavior B:
    1. select hamburger action "rename" and observe the modal is still open in the background
    2. click "cancel" on rename modal and observe the hambeurger popup remains visible

It is my expectation that the "hamburger popup" would be dismissed when it is clicked (as it is doing "copy to json", regardless of whether or not the user cancelled the resulting action.
I can understand that some might think it better to leave the hamburger popup open after an in-action "cancel", but the current behavior is inconsistent.

In my opinion this is a bug and the correct action is to dismiss the hamburger modal when it is clicked. Thoughts?

Change History (5)

#1 @sainathpoojary
2 months ago

  • Keywords needs-patch added

Reproduction Report

Description

This report validates that issue regarding inconsistent behavior of the hamburger popup in the Patterns screen can be reproduced. Specifically, the popup closes after selecting “Export as JSON” but remains open after selecting “Rename.”

Environment

  • WordPress: 6.8-alpha-59403
  • PHP: 8.1.29
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.29)
  • Browser: Chrome 130.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Four 1.3
  • MU Plugins: None activated
  • Plugins: Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Additional Notes

Steps to Reproduce

  1. Go to Appearance > Editor > Patterns > All Patterns.
  2. Click Add New Pattern to create a test pattern.
  3. After saving the new pattern, click the hamburger icon on the new pattern to open the options popup.
  4. Behavior A:
    • Select “Export as JSON” from the popup.
    • Observe that the hamburger popup closes immediately.
  5. Behavior B:
    • Click the hamburger icon again on the same pattern, and select “Rename” from the popup.
    • Observe that the hamburger popup remains open.
    • In the rename modal, click “Cancel.”
    • Observe that the hamburger popup remains visible.

Supplemental Artifacts

Video: https://utfs.io/f/PL8E4NiPUWyOfWkSeN4ctlDHSkwfNGujMUIyo2W4P7rqvbXB

#2 @yogeshbhutkar
2 months ago

Thank you, @rickers, for raising the ticket.

From my perspective, this behavior appears to be intentional and consistent with the functionality of Duplicate, Rename, and Delete operations.

I’ll await further discussions on this topic to explore potential possibilities.

#3 @rickers
2 months ago

Thank you @yogeshbhutkar for your comments and @sainathpoojary for your additional information.

I make the case that the block-pattern's hamburger is a block-pattern nav-menu or action-menu. A nav-menu closes when you pick an item (think window menu bar). Additionally, in the case of a locked pattern, the only choice is duplicate, and if you cancel the "duplicate action" it's unlikely you will want to do it again, yet the nav-menu remains. If you do duplicate the block the menu remains, as if you might want to duplicate it again.

If I rename the block, the nav-menu remains so I can rename it again, I suppose, without re-selecting the hamburger. I don't call that convenience - rather annoyance. Only the "export as json" closes the hamburger nav-menu as it should IMHO.

This ticket was mentioned in Slack in #core by desrosj. View the logs.


2 months ago

#5 @cbravobernal
2 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

It seems to be an editor ticket. I'll move it to Gutenberg, so it can be fixed there.

https://github.com/WordPress/gutenberg/issues/67043

Thanks for your contributions!

Note: See TracTickets for help on using tickets.