Skip to content
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

Style Preview: Navigation block only shows mobile view #47130

Closed
annezazu opened this issue Jan 13, 2023 · 2 comments · Fixed by #47508
Closed

Style Preview: Navigation block only shows mobile view #47130

annezazu opened this issue Jan 13, 2023 · 2 comments · Fixed by #47508
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.

Comments

@annezazu
Copy link
Contributor

annezazu commented Jan 13, 2023

This was found as part of the nineteenth call for testing with the FSE Outreach Program:

When editing the styles for the Navigation block, it shows the mobile version on the preview.

Screen Shot 2023-01-12 at 6 37 20 PM

I could replicate with GB 14.9.1 and WordPress 6.1.1 using the TT3 theme. This shows the mobile view regardless of what the navigation block being used is set to. Keep in mind there also could be multiple nav blocks with different options in place too.

cc @madhusudhand as a heads up and @WordPress/gutenberg-design for thoughts on what we should show here. IMO we should show the navigation block more fully rather than the mobile view since the settings available to customize are related to typography and layout (things you need to visually see).

@annezazu annezazu added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jan 13, 2023
@jameskoster
Copy link
Contributor

I think the behaviour is technically correct because the preview appears in a ~240px iframe and the Navigation block automatically condenses down to hamburger-mode at that size. But I agree, it's not very useful in the context of changing the appearance :)

We probably need some technical feedback here. I'm not sure if the iframe is going to prohibitive in terms of what we can do, or whether we need a unique preview implementation for the Navigation block.

@jameskoster jameskoster added the Needs Technical Feedback Needs testing from a developer perspective. label Jan 13, 2023
@jasmussen
Copy link
Contributor

First off, it's worth noting that this preview exists because you might be looking at a block that is not inserted in the canvas at that given moment, yet you still need to be able to style it. In that light, the screenshot above can be a bit misleading, since it isn't meant to be a duplicate preview of what you're already seeing on the left, but rather a fallback.

In that light, I think we need select one or the other. Which, to get technical is: we could potentially widen the content-preview to more than the mobile collapsing width (600?) and then crop it using overflow. That would give the "typography" option more context, at least.

However to do this, we'd have to make an edgecase just for this nav block, because we don't want to also make the paragraph block 600px wide and cropped, it should still look like this:

Screenshot 2023-01-13 at 12 25 26

So I guess the technical question is: can we make a preview customization on a per-block basis?

@annezazu annezazu moved this to ❓ Triage in WordPress 6.2 Editor Tasks Jan 24, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jan 27, 2023
@ndiego ndiego moved this from ❓ Triage to 📥 Todo in WordPress 6.2 Editor Tasks Jan 27, 2023
@talldan talldan moved this from 📥 Todo to 🏗️ In Progress in WordPress 6.2 Editor Tasks Jan 30, 2023
@github-project-automation github-project-automation bot moved this from 🏗️ In Progress to ✅ Done in WordPress 6.2 Editor Tasks Feb 1, 2023
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants