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

Template Part: Better handling of "missing" parts #49331

Open
jameskoster opened this issue Mar 24, 2023 · 8 comments
Open

Template Part: Better handling of "missing" parts #49331

jameskoster opened this issue Mar 24, 2023 · 8 comments
Labels
[Block] Template Part Affects the Template Parts Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Needs design efforts. [Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

What problem does this address?

When a template part block references a part that is missing, you see the following error on the canvas:

Screenshot 2023-03-24 at 09 40 45

It's okay for theme developers, but when an end-user encounters this it's not super helpful. It's not something folks are likely to encounter now, but as we enrich the template creation flow, and the pattern directory expands to include template-specific patterns, it might start to crop up more often.

It might be nice to explore some actionable items we could add to the message, and in some circumstances avoid showing the message at all.

What is your proposed solution?

A couple of ideas off the top of my head

  1. Update the view above to include a "Choose" button which opens a modal containing options (local and from the pattern / theme directory)
  2. When creating a template (either by manually pasting in the blocks, or via the built-in flows) if a missing part is referenced, automatically swap it out for a local equivalent of the same semantic area, and display a confirmational Snackbar.
@jameskoster jameskoster added Needs Design Needs design efforts. [Block] Template Part Affects the Template Parts Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Mar 24, 2023
@mrfoxtalbot mrfoxtalbot added the [Type] Enhancement A suggestion for improvement. label Mar 27, 2023
@richtabor
Copy link
Member

Update the view above to include a "Choose" button

Something along this is what I'm thinking as well. Currently you have to delete the block entirely and add it again to get to the placeholder state.

Maybe something like this:

CleanShot 2023-04-12 at 12 19 20

I don't love "Choose" as the action; not super clear.

@jameskoster
Copy link
Contributor Author

has been deleted

Perhaps "could not be found" instead? That would be more universal, thinking about situations where you paste a template from one site into another.

Should there be a 'Start blank' or 'Create new' option, to cover situations in which there are no pre-existing template parts or relevant patterns?

@richtabor
Copy link
Member

Perhaps "could not be found" instead? That would be more universal, thinking about situations where you paste a template from one site into another.

True, good point.

Should there be a 'Start blank' or 'Create new' option, to cover situations in which there are no pre-existing template parts or relevant patterns?

I don't feel that would be a likely course of action—more likely to remove probably—though I'm fine either way.

@jameskoster
Copy link
Contributor Author

Perhaps 'Start blank' is only an option when no existing template parts / relevant patterns can be found? Otherwise the whole thing feels a bit pointless with only a 'Remove' action.

It might be good to list the different scenarios to ensure we have a design / actions that works for all? Off the top of my head we need to consider:

Specified template part not found, and:

  • There are existing template parts of the same type from which the user can choose
  • There are existing template parts of the same type from which the user can choose, and there are relevant patterns as well
  • There are relevant patterns, but no existing template parts of the same type
  • There are no existing template parts of the same type, or any relevant patterns

In the last two cases, the 'Choose another template part...' sentence in the design above wouldn't make sense, so that might need to be dynamic.

@richtabor
Copy link
Member

Perhaps 'Start blank' is only an option when no existing template parts / relevant patterns can be found? Otherwise the whole thing feels a bit pointless with only a 'Remove' action.

We'd still have "Choose" though, right? I think the two routes are "Yes, I deleted that template part, why is this still here" or "yikes, I don't know what happened to that template part, let me pick another one."

@jameskoster
Copy link
Contributor Author

We'd still have "Choose" though, right?

I guess this is an edge case now that core bundles header / footer patterns, but what would happen when you click "Choose" if there are no template parts or patterns?

@richtabor
Copy link
Member

If there are none, then yea "Choose" shouldn't be an option.

@jameskoster
Copy link
Contributor Author

Right, and in that case don't you think it's reasonable to offer a shortcut to create a new template part?

I don't have a strong feeling btw, just thinking: if there's intent to insert a template part, and that template part cannot be found, then it's fairly likely folks would want to create a new one in its place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Needs design efforts. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants