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

Add Code View to Pattern Creator #429

Open
StevenDufresne opened this issue Mar 10, 2022 · 4 comments
Open

Add Code View to Pattern Creator #429

StevenDufresne opened this issue Mar 10, 2022 · 4 comments
Labels
[Component] Pattern Creator Anything related to the pattern front end editor or preview

Comments

@StevenDufresne
Copy link
Collaborator

Describe the feature
There have been a number of occasions when building a pattern, that I wanted to copy in pattern code or modify it directly.
It would be nice if we could switch the creator into Code Editor mode and back. For me, it's part of my Gutenberg experience. I frequently work in both views.

Expect to see

Scope
At this moment in time, the <ModeSwitcher> is not an exported component. Gutenberg's edit-site package appears to just have duplicated the code. We could also duplicate or maybe submit a Gutenberg PR to export the component.

https://github.com/WordPress/gutenberg/blob/b7f0444f93572d02ec4106c16561c73f1ff5c494/packages/edit-post/src/components/header/more-menu/index.js#L16

@StevenDufresne StevenDufresne added [Type] Enhancement New feature or request [Component] Pattern Creator Anything related to the pattern front end editor or preview labels Mar 10, 2022
@ryelle
Copy link
Contributor

ryelle commented Mar 10, 2022

The code view was not added on purpose, as a guardrail to prevent broken patterns, so I'm hesitant to add it back. What are you trying to do that you need the code view? is something in GB not working the way you expect?

@StevenDufresne
Copy link
Collaborator Author

StevenDufresne commented Mar 11, 2022

It came up in 2 different scenarios, which is why I decided to get an issue up:

Collaborating

  1. I wanted to paste in a block from the block museum and see how it was made.
  2. I wanted to paste in a copied block that someone else made on wordpress.org and modify it.

Editing

  1. Playing with multiple nested blocks.... it became a bit tedious to keep track of all the layouts and positioning in the editor, I wanted to see the code to see the state of things. This is a Gutenberg thing but I'm still used to working this way, regardless.

I'm not dying for this feature, should more people want it we can consider adding it.

@ryelle
Copy link
Contributor

ryelle commented Mar 11, 2022

For pasting block code, did pasting directly into the editor not work? It should work in the default editor, but maybe something's not working in the creator.

@StevenDufresne
Copy link
Collaborator Author

For pasting block code, did pasting directly into the editor not work? It should work in the default editor, but maybe something's not working in the creator.

Oh weird, I totally didn't know you can do that. 🤯

@ryelle ryelle removed the [Type] Enhancement New feature or request label Dec 11, 2024
@ryelle ryelle moved this to ⚠ On Hold/Blocked in WordPress.org Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Pattern Creator Anything related to the pattern front end editor or preview
Projects
Status: On Hold/Blocked
Development

No branches or pull requests

2 participants