Feature : Edit links directly in the Theme Sidebar#76428
Feature : Edit links directly in the Theme Sidebar#76428Vrishabhsk wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
1 similar comment
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
jeryj
left a comment
There was a problem hiding this comment.
Thanks for the PR! I haven't done a code review yet, but here's a few behavioral things to change:
- We shouldn't change the suggestions query work in this PR. That should be done separately and apply to all instances and will be a much larger change. Keep this PR focused just on editing.
- For the editing experience, look at how Content Only navigation list view editing works. That's how the flow should work.
What?
This PR lets you edit navigation links directly from the Site Editor's sidebar navigation list view — no need to click into the canvas anymore.
Why?
Before this change, editing a navigation link in the Site Editor was a bit of a pain. You had to:
That's a lot of back-and-forth. Now you can just click "Edit link" right from the options menu in the sidebar, and a familiar Link UI popover pops up for quick editing.
How?
I leveraged the existing
LinkUIandLinkControlcomponents that were already being used for newly inserted navigation links. TheNavigationLinkUIcomponent now handles two scenarios:Both use the same Link UI popover, so the experience is consistent whether you're adding a new link or editing an old one.
Files changed
packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.jspackages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.jspackages/block-library/src/navigation/edit/navigation-link-ui.jspackages/block-library/src/navigation-link/link-ui/index.jsallowAllContentTypesparameter togetSuggestionsQuery()Testing Instructions
npm run wp-env startPreview
feat.mp4