-
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
Show Link UI in Nav Offcanvas for submenus inserted via block options ("3 dots") menu #46582
Show Link UI in Nav Offcanvas for submenus inserted via block options ("3 dots") menu #46582
Conversation
Size Change: +46 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
While super awesome, I think this to be pretty undiscoverable to land. I mean, let's fix |
This does make an incremental improvement which is to allow the Link UI to show when yuo already have a submenu. Therefore I think it has merit. Moreover, it improves the code via better SRP and tests for things that currently are not tested. I take your point but I think it's worth landing and then following up to enhance it. To delay it only to do it the other way around seems 🤷♂️ 😄 |
Yes but why not just fix the bug you've uncovered? 🤷♂️ |
If that's relatively simple then sure, I just didn't want to hold up the other fixes in the PR if it was going to be involved. |
UpdateI now no longer think What I suspect might be happening is some kind of race condition whereby the This results in the check failing when we test whether the blockName is in the allowed blocks for the Link UI to show. |
Next StepsI'll be away until after New Year now. So leaving notes for myself or whoever picks this up.
Then we can rebase and update this PR. Following that we can try and discern what's going on with the race condition as described here. |
c132846
to
fa5fec1
Compare
To solve the issue with the position of the Link UI, I think we need to do this: #46744 |
Looking at this again now |
I've been looking into this again. With the refactor in #46744 we can remove much of the code in this PR and instead rely on the Everything should "just work". However...
The issue with the
The desired UX is
So far I have tried to work around this by calling Going to circle back to this tomorrow as I'm sure I'm missing something obvious in the flow. |
I now have an alternative proposal in #46857 which I think we should consider. This PR has fallen behind progress elsewhere and will be time consuming to refactor for little benefit. I suggest we close it out. |
Closing in favour of #46857 |
What?
Displays the Link UI for submenus inserted via the block options ("3 dots") menu in the Nav Offcanvas experiment.
replaceBlock
which (unlikeinsertBlock
) does not currently have an argument to disable the select of the "replaced" block in the canvas 🤦gutenberg/packages/block-editor/src/components/off-canvas-editor/block.js
Lines 384 to 397 in aa9b1d6
Why?
Because when a new link is inserted the Link UI should be displayed to afford the ability to configure the link in the same way in which the UI is displayed when adding a link via the block appender
+
.How?
This PR:
onInsertBlock
callback down to appender and individual block componentsonInsertBlock
anytime a block is inserted to trigger the Link UITesting Instructions
trunk
for normal link insertion via appenderAdd submenu item
.What
above which we will address in a follow up to target the missing APIs onreplaceBlock
.Add submenu item
.Also run the unit tests for the custom hook:
Testing Instructions for Keyboard
Screenshots or screencast
Screen.Capture.on.2022-12-15.at.13-41-32.mp4