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

Surface related patterns in the template inspector #44582

Closed
Tracked by #33094
jameskoster opened this issue Sep 29, 2022 · 20 comments · Fixed by #55091
Closed
Tracked by #33094

Surface related patterns in the template inspector #44582

jameskoster opened this issue Sep 29, 2022 · 20 comments · Fixed by #55091
Assignees
Labels
Blessed for major release Can be iterated during a WordPress beta period [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Design Needs design efforts. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

When editing a template or template part, it would be nice to find associated patterns in the Inspector.

For template parts that might look something like:

template

It could work the same for templates too, but we'd need a way for patterns to be associated with specific templates. For example it wouldn't be helpful to be suggested 404 patterns while editing the Archive template.

@jameskoster jameskoster added Needs Design Feedback Needs general design feedback. [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Sep 29, 2022
@carolinan
Copy link
Contributor

love this!

@jasmussen
Copy link
Contributor

Plus one. Love it! Let's make it happen. (Though maybe I'd have a separator between the inspector header and patterns, perhaps even a subheading for the patterns).

@jasmussen jasmussen added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Sep 30, 2022
@annezazu
Copy link
Contributor

annezazu commented Oct 3, 2022

Noting that this matches this prior feedback that came in: #39864 For consistency/to consolidate, I'm going to close mine out but wanted to be sure that the inability to do this has been noted as a pain point in the past.

@oandregal
Copy link
Member

oandregal commented Oct 19, 2022

I'm going to investigate this. I remember having seen a mention or a sketch for having the ability to switch whole sections in the zoom-out view as well (or was it the site editor?), though I can't find it now. I guess both things are related. Would anyone have a link/sketch handy?

@oandregal
Copy link
Member

I am reading through prior art and ran into this use case:

  • We allow patterns to declare which block types they support (blockType). These patterns will be surfaced in the block toolbar as any other transformation.
  • The same works for many selected blocks at once. Though, note the inspector in this case: it's empty.

Captura de ecrã de 2022-10-19 16-18-23

Letting this here as another potential place to surface patterns a set of blocks can be transformed into.

@jameskoster
Copy link
Contributor Author

I remember having seen a mention or a sketch for having the ability to switch whole sections in the zoom-out view as well

This is still a WIP, but yes I would say that both are related.

There's also the shuffle concept for templateLock:contentOnly blocks which is similar. Indeed this could drive the transforms you mention. IE if you select a heading and a paragraph the transform menu could expose patterns that are made up of those content blocks specifically.

@oandregal
Copy link
Member

Raw prototype at #45285 It should be enough to clarify some questions.

@paaljoachim
Copy link
Contributor

I believe the other solution to add a cycle icon in the Pattern Group block toolbar to show various patterns directly in the canvas is an even better way to go:
#44581

Because:
-- It would show the pattern in it's native place.
-- It could create a broader solution between Patterns and Group blocks in which I brain stormed in this comment:
#44581 (comment)
(Basically a Pattern is a special Group block. Just like row, stack or grid.)

@priethor priethor added [Status] In Progress Tracking issues with work in progress and removed Needs Dev Ready for, and needs developer efforts labels Apr 19, 2023
@annezazu
Copy link
Contributor

@oandregal checking in here to ensure this is still on your list to move forward as it's been a few months since active work was completed on the PR.

@oandregal
Copy link
Member

checking in here to ensure this is still on your list to move forward as it's been a few months since active work was completed on the PR.

Oh, thanks for checking. This slip through the cracks, sorry about that. I had #45285 and #47507, but I no longer know whether they are in a good state to be merged or how long they'll require.

I have some upcoming AFK and some threads I'm involved in, so I'd rather free this one up for anyone to take. I may be able to come back at this in a couple of weeks if I manage to wrap up the other work.

@oandregal oandregal removed their assignment May 15, 2023
@oandregal oandregal removed the [Status] In Progress Tracking issues with work in progress label May 15, 2023
@paaljoachim paaljoachim added the Needs Dev Ready for, and needs developer efforts label May 15, 2023
@jameskoster
Copy link
Contributor Author

Like shuffling (#44581), the full scope of where related patterns can be surfaced will be exposed as a part of #27575.

@mtias
Copy link
Member

mtias commented Aug 9, 2023

@jameskoster I'm not sure we are capturing this specific flow in that issue. I think the templates sidebar is an ideal place to get something going. Could be a collapsible panel with patterns of a relevant category to start.

@jameskoster jameskoster reopened this Aug 9, 2023
@jameskoster jameskoster added Needs Design Needs design efforts. and removed Needs Dev Ready for, and needs developer efforts labels Aug 9, 2023
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Aug 30, 2023
@SaxonF
Copy link
Contributor

SaxonF commented Sep 3, 2023

Not sure about using the inspector for this as I could accomplish the same thing via inserter. Could we add a "recommended" or "switch" category at the top of the patterns inserter that will work for all scenarios? e.g. replacing similar patterns

@jameskoster
Copy link
Contributor Author

@SaxonF we could do both. Is there a specific reason you had in mind for not using the Inspector?

@mtias
Copy link
Member

mtias commented Sep 4, 2023

Yeah, this doesn't take away from other flows that might become, in time, more intuitive. But right now the inspector is completely empty and missed opportunity for discovering existing relevant patterns in context.

@MaggieCabrera
Copy link
Contributor

This is very important for TT4. Right now it's easy to swap from the post editor, but that is not good for certain templates like archive.html. This will surface those patterns so much better.

@annezazu
Copy link
Contributor

annezazu commented Oct 3, 2023

Adding this back to 6.4 after seeing the above note about this being important for TT4, which is a blessed task.

@annezazu annezazu added the Blessed for major release Can be iterated during a WordPress beta period label Oct 3, 2023
@richtabor
Copy link
Member

If we're concerned about performance, we could potentially add these to a panel, have it closed initially perhaps as well. At least until #54999 is explored further.

Also, we could set a max number of rendered previews with a “View all” button to open the modal, similar to how the pattern explorer is set within the inserter.

@scruffian
Copy link
Contributor

I've made a start on this: #55091

@annezazu
Copy link
Contributor

annezazu commented Feb 5, 2024

With just over a week until beta 1, punting this out of 6.5 as the associated PR hasn't yet been merged and this wasn't a strong focus for the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blessed for major release Can be iterated during a WordPress beta period [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Design Needs design efforts. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
Status: Done
Status: Done
Status: Done