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

Site Editor: can't access the Patterns editor in mobile layout #67460

Closed
2 of 6 tasks
t-hamano opened this issue Dec 2, 2024 · 10 comments · Fixed by #67467
Closed
2 of 6 tasks

Site Editor: can't access the Patterns editor in mobile layout #67460

t-hamano opened this issue Dec 2, 2024 · 10 comments · Fixed by #67467
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Dec 2, 2024

Description

According to git bisect, this issue was introduced in #67199

When you access the Patterns page in the site editor in the mobile layout, you can see the Template Parts and Patterns categories, but when you click on these categories, an error is logged in the browser console and nothing happens:

Uncaught TypeError: navigate is not a function at handleClick (index.js:48:4)
router.tsx:132 Uncaught (in promise) SyntaxError: Failed to execute 'add' on 'DOMTokenList': The token provided must not be empty. at router.tsx:132:40
Actual Expected
Image Image

cc @youknowriad @tyxla @jsnajdr

Step-by-step reproduction instructions

N/A

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@t-hamano t-hamano added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Regression Related to a regression in the latest release labels Dec 2, 2024
@t-hamano t-hamano changed the title Site Editor: cant't acces the Patterns editor in mobile layout Site Editor: cant't access the Patterns editor in mobile layout Dec 2, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Dec 2, 2024
@ramonjd ramonjd changed the title Site Editor: cant't access the Patterns editor in mobile layout Site Editor: can't access the Patterns editor in mobile layout Dec 3, 2024
@ramonjd
Copy link
Member

ramonjd commented Dec 3, 2024

For the navigate function, it's not in the context because areas.mobile isn't rendered inside <SidebarContent />, which renders the SidebarNavigationContext.Provider.

But for edit mode, areas.mobile would still need to be rendered outside I think.

@ramonjd
Copy link
Member

ramonjd commented Dec 3, 2024

I'm not sure if what I've done here is right: #67505

But here's the result:

Kapture.2024-12-03.at.12.05.56.mp4

@t-hamano
Copy link
Contributor Author

t-hamano commented Dec 3, 2024

@ramonjd Thanks for working on this issue!

Thanks for working on this issue!

It seems that a simpler solution has been submitted, #67467. That PR correctly restores the previous behavior and shows the all pattern list when accessing the Patterns screen in the Design screen.

However, I realized that this approach might not be ideal for mobile layouts because template parts are not accessible. It seems that this issue has been there for a while.

The correct behavior would probably be to show template parts and pattern categories instead of all patterns when accessing the Patterns screen in the Design screen, as attempted in #67505.

With that in mind, I'm thinking it might be better to merge #67467 first and then move on to #67505. What do you think?

@ramonjd
Copy link
Member

ramonjd commented Dec 3, 2024

It seems that a simpler solution has been submitted, #67467. That PR correctly restores the previous behavior and shows the all pattern list when accessing the Patterns screen in the Design screen.

I know I should look before I start working, but I never remember 😆

With that in mind, I'm thinking it might be better to merge #67467 first

Sounds good! Thank you 🙇🏻

@ramonjd
Copy link
Member

ramonjd commented Dec 4, 2024

Templates have the same issue:

PR here: #67547

I just followed the approach in #67467 for now.

@ramonjd
Copy link
Member

ramonjd commented Dec 4, 2024

The correct behavior would probably be to show template parts and pattern categories instead of all patterns when accessing the Patterns screen in the Design screen

I'll clean up #67505 for consideration. The templates route bug fix has a separate PR #67547 since it's a bug not an enhancement.

Thank you!

@ramonjd
Copy link
Member

ramonjd commented Dec 4, 2024

However, I realized that this approach might not be ideal for mobile layouts because template parts are not accessible. It seems that this issue has been there for a while.

Actually, am I missing something? I can see the template parts in "All patterns" in mobile.

Kapture.2024-12-04.at.11.45.25.mp4

It takes a bit of typing and/or clicking though 😄

@t-hamano
Copy link
Contributor Author

t-hamano commented Dec 4, 2024

@ramonjd In TT5, each pattern and template part has a header and footer 😅 On the "All patterns" page, you can search for headers/footers as patterns.

@ramonjd
Copy link
Member

ramonjd commented Dec 4, 2024

In TT5, each pattern and template part has a header and footer 😅 On the "All patterns" page, you can search for headers/footers as patterns.

That'd be it 😄

@ramonjd
Copy link
Member

ramonjd commented Dec 4, 2024

While I was there I noticed some weird stuff with the styles panel in mobile view and edit mode. Proposed fix here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants