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

Query Loop: Remove placeholder state #48013

Open
jameskoster opened this issue Feb 13, 2023 · 6 comments
Open

Query Loop: Remove placeholder state #48013

jameskoster opened this issue Feb 13, 2023 · 6 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

jameskoster commented Feb 13, 2023

The current Query Loop placeholder breaks the wysiwyg experience in the zoomed out Site View:

Screenshot 2023-02-13 at 10 48 17

Since the Query Loop block now has a "Replace" action in the toolbar which allows you to choose a pattern, we can probably eliminate the current placeholder altogether. Instead of asking the user to choose the initial pattern themselves, we can simply insert a core query pattern and allow them to replace manually if they want/need to.

Original issueHere's how the Query Loop block appears when empty: Screenshot 2023-02-13 at 10 46 02

It works well when you're zoomed in editing a template, but less well when you're browsing in the Site Editor:

Screenshot 2023-02-13 at 10 48 17

There are two issues here:

  1. The block looks interactive but it isn't until you engage edit mode
  2. It looks nothing like what you see on the frontend which kind of breaks the wysiwyg convention inherent to the frame

To improve things here we can potentially find inspiration in the work we did with Image blocks a little while ago. When the block is not selected you see a more visual preview, and the interactive state is only revealed when the block is selected:

image

If we can do something like this with the Query Loop block, it will work much better in browse view.

cc @WordPress/gutenberg-design

@jameskoster jameskoster added [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. [Block] Query Loop Affects the Query Loop Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Feb 13, 2023
@paaljoachim
Copy link
Contributor

That sounds like a very good idea James!

@jasmussen
Copy link
Contributor

I think it makes a ton of sense. But it seems like we also might want to think through the placeholder strategy a little bit, so we have a system that we can roll out across text and video in addition to images as it is now. The question we have to ask is: does this gray state need more indication of what it's meant to placehold? Or is it fine as is?

Personally I'd lean towards it being okay to try and take this a bit further as-is, and then revisit. But it seems good to just chat through the options, maybe visualize a bit. I think we tried an icon version at one point?

@jameskoster
Copy link
Contributor Author

Yes good points. There are a couple of things we might try here imo.

One would be to have a 'visual' placeholder state for all blocks, similar to what we've already created for images. We can then assemble a composition of these to act as the de facto Query placeholder.

It may be something as simple as changing the font to something like Flow Block:

Screenshot 2023-02-27 at 12 16 05

Blocks like Query Loop could invoke this placeholder state, to create appearances like so upon insertion:

Screenshot 2023-02-27 at 12 14 14

Then the current placeholder would exposed when you select the Query Loop. Just like how the Image block works.


Another option would be to eliminate the Query Loop placeholder altogether and ask the user to select a pattern immediately after inserting the block, similar to what we do when creating a new template:

Screenshot 2023-02-27 at 12 19 10

If they elect to start blank, then the Query Loop would appear that way – an entirely empty container.

@jasmussen
Copy link
Contributor

jasmussen commented Feb 27, 2023

Nice. In general I think the generic text placeholders have worked well where we use them (i.e. post content) but they probably wouldn't work here since nothing is actually output until you choose a pattern. Unlss

In that light, the abstracted placeholder could be interesting. I wonder if there's a way to take that further. But it would probably have to be the right design — something that distinctly looks like a placeholder, even if it looks differently. I do worry about it missing a boundary 🤔

To take it in a different direction, what if the query loop always output an actual query loop. The most basic one you could have, and on-select you'd be prompted to select from a range of patterns. Not sure if that would be better or worse.

@jameskoster
Copy link
Contributor Author

There might be something to that last idea. Especially if we're able to utilise wp:pattern (#48458). That would make it easy to shuffle through different Query patterns.

@jameskoster jameskoster changed the title Query Loop: Add a more visual state to the placeholder UI Query Loop: Remove placeholder state Jun 8, 2023
@jameskoster
Copy link
Contributor Author

Tentatively updated the OP based on the latest discussion in this issue.

@jameskoster jameskoster added Needs Dev Ready for, and needs developer efforts and removed Needs Design Needs design efforts. labels Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
Status: Needs dev
Status: 💻 Needs development
Development

No branches or pull requests

3 participants