-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add global inserter to Nav editor screen #34619
Conversation
Size Change: +880 B (0%) Total Size: 1.06 MB
ℹ️ View Unchanged
|
This comment has been minimized.
This comment has been minimized.
What I found jarring is that unlike any other block the navigation links automatically open that LinkUI which is totally unexpected when adding from the inserter (cc @javierarce) Also I noticed that if nothing is focused then the inserter is empty. I definitely remember we fixed this for widgets as well since it's a problem with having no post as final parent or something. |
packages/edit-navigation/src/hooks/use-navigation-editor-insertion-point.js
Outdated
Show resolved
Hide resolved
Good spot. I assume you mean in terms of having x2 icons? I think @javierarce is going to create a dedicate text-based UI for "Create". TBH I think we need to use text in that case because it's not part of the standard Gutenberg UI so we can't rely on icons. |
@getdave I noticed that PR also contains changes for two |
Agreed 😄 |
packages/edit-navigation/src/components/secondary-sidebar/inserter-sidebar.js
Outdated
Show resolved
Hide resolved
Yes, here's the updated the design: #31241 (comment) |
fa41922
to
4a35407
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great so far, nice work!
Something I noticed is that when I registered an extra CPT to increase the inserter items to 7, the quick inserter was missing the 'Browse all' button that usually appears at the bottom.
Here the code snippet I used for the CPT (for some reason it results in two Post Link variations, but that's a separate issue):
function myplugin_register_book_post_type() {
$args = array(
'public' => true,
'label' => 'Books',
'show_in_rest' => true,
);
register_post_type( 'book', $args );
}
add_action( 'init', 'myplugin_register_book_post_type' );
Would be great to look into getting the Browse all button working.
packages/edit-navigation/src/components/secondary-sidebar/inserter-sidebar.js
Outdated
Show resolved
Hide resolved
packages/edit-navigation/src/components/secondary-sidebar/inserter-sidebar.js
Outdated
Show resolved
Hide resolved
20f983d
to
35e4b85
Compare
Required refactor of initial file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@getdave, I think this looks good to merge.
We can address screen jumpiness after menu insertion in follow-up PRs.
f41330c
to
09edddc
Compare
I'm going to raise a follow up here for e2e tests |
Description
Adds the global inserter to the Navigation block so as to achieve parity with other editors and also to provide users with an alternative means of adding new items.
Question: do we want/need e2e tests?
Addresses part of #34268
Closes #34438
How has this been tested?
Note that this problem is not a facet of this PR. Rather it's a general problem for the Nav Editor. It should be solved in another PR.
To test:
Start blank
.Browse All
below.Browser All
.Screenshots
Screen.Capture.on.2021-09-09.at.13-21-29.mov
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
*.native.js
files for terms that need renaming or removal).