-
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
[Block Library - Navigation]: Update example with no mobile view #47508
[Block Library - Navigation]: Update example with no mobile view #47508
Conversation
Size Change: +6 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Thanks for the PR. I'm not sure we should do this. Mostly in principle since the preview should just be real behavior, even if scaled down. In this case it also comes with a couple of other tradeoffs. Two examples, firstly, the dropdown menus don't show, and the capitalization isn't matching: This may actually be a separate issue, but it's nevertheless an incorrect preview. Secondly, when it's collapsed always in the canvas, it's weird that it isn't collapsed in the preview: I think solutions to this issue could be to make sure the inline preview is an anchor link to the navigation block as shown inside the style book. Not urgent, but a more generic and generalized solution. |
There are some nuances with block examples that are used in previews and I don't have strong opinion on this one, but some of the comments are also true for the current example used(show mobile always due to the preview width).
If any block is styled specifically(ex capitalization) the preview in GS blocks section will not match the selected block and that's fine I think. The preview is about the global styles and what is generally applied to all blocks, but specific styles override those values.
That's also true for the opposite scenario right now. |
I struggle to see a short-term solution here that doesn't involve a toggle on the preview itself. At some point it might be nice to load the selected block into a focus canvas (like template parts, with drag handles for previewing desktop/mobile), but obviously that's a bigger change that needs more thought. Worth noting this wouldn't fix the issue on mobile, and we'd likely still need the toggle-able preview there regardless. |
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.
Whilst I understand the concerns that the preview should show the default behaviour, I can't help but think this is a good fix for the problem at hand.
What major downsides are there to forcing the example to show the full preview? After all it is an example, so we can configure it however is best to be viewed.
I'd be in favour of merging:
- it solves a UX issue
- it does little damage/harm (it's an example)
- there is no alternative solution in sight or likely to be worked on
As always, happy to be told I'm wrong...
Tagged in some other regular Nav block contributors for additional opinions. |
I agree with @getdave 's assessment. The bug is that setting style options is invisible in the preview and this solves that. Other problems about better previews should be tackled elsewhere, I think. |
743afa2
to
4deb020
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.
I'm going to approve this and if anyone feels strongly they can raise a blocking review 🙏
I'll merge this and we can create a different issue to discuss if we should change what BlockPreview shows - like reflecting the selected block. Thanks for the feedback all! |
What?
Resolves: #47130
Testing Instructions
Navigation
block preview is not showing the mobile viewThis will be effective for any preview of the block, but you can test for example in:
blocks
sectionBefore
After