#46367 closed enhancement (fixed)
Introduce a cancel button to the create new menu screen when 1 or more menus exist
Reported by: | garrett-eclipse | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Menus | Keywords: | has-patch has-screenshots commit early |
Focuses: | ui, administration | Cc: |
Description
Hello,
On the create new menu screen it would be nice to introduce a Cancel link in the same location as the 'Delete Menu' link appears when editing a menu.
This would only make sense when there are one or more menus in existence, when there aren't any menus there's nothing to cancel. When there is a single menu and you go to create a new menu there's no indication on screen that a menu exists and you need to reload to be able to edit the existing menu. When there is more than one menu the select menu dropdown appears so at least you can switch menus to cancel.
The use case this helps the most is when there's only one menu and you click 'create a new menu'. In this case the cancel allows you to go back to the single existing menu.
Hope that was clear,
Thank you
Attachments (10)
Change History (23)
@
6 years ago
When there's more than one menu on the create a new menu screen you at least get the select a menu as a way to cancel the create action.
#1
@
5 years ago
- Owner set to audrasjb
- Status changed from new to reviewing
Hi @garrett-eclipse and thanks for the ticket :-)
I'm wondering what would be the best action triggered by the cancel button. Simply reload the current page?
@
5 years ago
Minor adjustment to original, moving the cancel-action conditional prior to the delete-action we can cleanup the if/elseif removing the ! $add_new_screen
as we confirm that in the first condition
@
5 years ago
Screen illustrating applied patch w/ 'Cancel' button. Colours in patch use same as 'Delete Menu'
#2
@
5 years ago
- Keywords has-patch has-screenshots needs-testing added
Hi @audrasjb thanks for the ping.
Reviewing the setup WP has, the create menu redirects the user to nav-menus.php?action=edit&menu=0
so taking the user back to nav-menus.php
seems like the most appropriate course here.
I setup an initial patch for this in 46367.diff (and minor tweak in 46367.2.diff to cleanup the conditional), which introduces the menu-cancel action link. To give it the same red as the menu-delete action I've added the selector to the common.css menu where menu-cancel is setup. I'm not sure if we want to give it an alternate colour but felt it made sense and should never appear alongside the menu-delete action.
Give it a shot and let me know if you have any issues.
All the best
#3
@
5 years ago
- Milestone changed from Awaiting Review to 5.4
Hi @audrasjb retesting the patch applies cleanly still on trunk and resolves the issue enabling users to cancel out of the create menu screen gracefully. I've moved this to 5.4 to get some testing and hopefully move this forward. Cheers
#4
@
5 years ago
- Keywords commit added; needs-testing removed
- Status changed from reviewing to accepted
Hi @garrett-eclipse
I refreshed the patch. I tested it (see screenshot above) and it works fine.
I think the patch is definitely good to go. Adding commit
keyword.
Thanks,
Jb
#5
follow-up:
↓ 7
@
5 years ago
- Milestone changed from 5.4 to 5.5
46367.3.diff looks good, but it appears to display the Cancel link even when no menus are created yet, which just leads to the same screen. To make sure the logic is correct, let's move to early 5.5.
@
5 years ago
Update to remove the changes introduced in src/wp-includes/assets/script-loader-packages.php
which were unintentionally included in my previous patch.
#7
in reply to:
↑ 5
@
5 years ago
Replying to SergeyBiryukov:
46367.3.diff looks good, but it appears to display the Cancel link even when no menus are created yet, which just leads to the same screen. To make sure the logic is correct, let's move to early 5.5.
Thanks @SergeyBiryukov good catch. I've corrected this in 46367.5.diff to suppress the Cancel link when no menus are present.
*Note: Please ignore 46367.4.diff there was some unintended changes to the src/wp-includes/assets/script-loader-packages.php
file.
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
4 years ago
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
4 years ago
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
4 years ago
#11
follow-up:
↓ 13
@
4 years ago
46367.5.diff looks good.
I would suggest not using the red color for the Cancel link though, as it's generally used for destructive actions: Delete, Trash, Spam, etc. An empty menu has no data yet, so the Cancel link is not really destructive.
#13
in reply to:
↑ 11
@
4 years ago
Replying to SergeyBiryukov:
I would suggest not using the red color for the Cancel link though, as it's generally used for destructive actions: Delete, Trash, Spam, etc. An empty menu has no data yet, so the Cancel link is not really destructive.
Thanks @SergeyBiryukov good point, I appreciate that you omitted the css in the commit.
This screen shows the create menu screen when there's one existing menu. Nothing indicates a menu exists and there's no way to cancel or navigate back except with a reload.