Open carolinan opened 1 year ago
@WordPress/gutenberg-design for more thoughts. This feels like something to iterate on for 6.3 as well but curious what others think.
I suppose this behavior is consistent with the old reusable block experience, so not really a "new" problem? That makes me wonder how urgent it is to fix. Template parts behave the same way as well.
That's not to say we shouldn't polish if there are good ideas. A couple of questions to ponder:
Perhaps the closest existing pattern we have is that you can draft a page from the navigation menu, and then it shows up like this:
As a small fix, should we just set the title of the pattern to "Name of pattern (Draft)"? (Or even "(Trashed)")
That said, there needs to be in combination with this an intuitive central management place to change the status of these to untrash or publish them. The Design > Patterns section feels like an obvious place to link to, since it wouldn't take you out of the singular site editor flow, so manageing trash and status there seems related.
I think @jameskoster brings up an important point about the draft mode, and that is probably a decision that needs to be made as soon as possible, it might be more difficult to change, the longer we wait? I am not sure how removing the draft option would impact existing reusable blocks.
Other than that I don't think UI changes for showing the state needs to be prioritised for 6.3.
For me it seems mostly a technical question, can the draft status even be removed? If yes, I'd agree that there doesn't seem to be a compelling use case for draft RBs.
The most basic fix could likely be to treat draft and private statuses same as "deleted". Right now if a post includes a deleted reusable block, you get this message:
Just landed on this issue while researching existing issues about the "Draft" status for Patterns. I talked to a user who got used to accessing the deprecated WP Admin screen for patterns (they bookmarked the URL) and they made use of status in Patterns heavily to distinguish between patterns they were using on the site and patterns that were no longer in use but they still wanted to keep on the site in case they ever need it again.
While not the most common use case, I see some benefit in having a way to hide patterns from the inserter by switching their status, but keeping them archived on the site for safekeeping.
Another possible use case is builders/agencies wanting to hide patterns from clients while they are not ready to be used.
As patterns mature, it does seem reasonable that a designer might want to work on a pattern without necessarily making it available for insertion. Utilising the existing draft
/ published
statuses seems fairly natural in terms of UX, with draft
patterns not appearing in the inserter.
It gets a bit trickier with synced patterns though. What happens to instances of a synced pattern if the status changes to draft
? One option could be to leave it visible on the canvas when editing the page (with some hint relating to status), but hide it on the frontend.
What happens to instances of a synced pattern if the status changes to draft?
To be responsible with existing sites, a good question to ask first is, what happens if you do this today? If the pattern remains even if the source turns to draft, backwards compatibility might simply spell out some rules for us. But if the pattern becomes invisible also on the frontend, when the status changes, then that suggests your idea could work.
I may be wrong, but I don't think there's a UI for making patterns into drafts, so I'm not sure how to test this.
Slightly different, but if you delete a synced pattern then edit a document containing an instance, the canvas shows an error and the pattern isn't visible on the frontend.
I feel the suggestion above is a reasonable middle-ground. Draft patterns are:
It is the "classic" pattern screen that has the draft and move to trash options. wp-admin/edit.php?post_type=wp_block This page can still be accessed even in 6.6, regardless of the type of theme that is active. There are also the patterns that were created before 6.6, using a classic theme.
Edit: If you are testing this with a pattern created on 6.6, you can for example trash and then restore a pattern.
Thanks.
I still see two parts to this, probably to be handled separately:
I don't mind the draft status showing in the toolbar, but I can understand if there are objections to it being that prominent.
Okay so the action items would be;
Want to update the OP with the designs?
What problem does this address?
Synced patterns that have been published and placed in content, but then set to draft or trashed, display in the editor but not on the front. It is not possible to see the pattern's status in the editor.
The only visual difference between a published pattern and the draft/trashed is that the pattern-specific name is not used in the list view: