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

Consider notice or preventing blocks from going in positions in full site editor where they will not work #35162

Open
karmatosed opened this issue Sep 27, 2021 · 11 comments
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Comments

@karmatosed
Copy link
Member

Certain blocks need to be placed with or within others to work in the full site editor. For example query pagination, doesn't work unless you put it in the query loop. However, you can place this anywhere on the site editor. This could easily lead to confusion. Whilst it does make sense that it works in the loop, it might be presumed knowledge others might not have. By limiting the use or notifying, creates a good experience for everyone and prevents frustration.

There are two options here I can think of, but there might be more:

  • Add a notice when you try and place the block somewhere; it won't work.
  • Don't allow the block to be used outside where it will work.

I understand this mechanism does need design, but I also think it needs discussion, so for now, adding the feedback label first.

@annezazu
Copy link
Contributor

Thanks for opening this! I know there are a few efforts to make blocks more "context aware" (for ex with intrinsic design options). Some of this reminds me of discussions with the Navigation Block (#30159) so, for now, I'm going to cc a few folks into the convo: @ntsekouras (for the query loop context) and @jasmussen (for the navigation block context).

@jasmussen
Copy link
Contributor

I chatted with Tammie and we worked through the various cases to reproduce:

  • The Query block can not be inserted outside of the Query Loop using either inserter.
  • It can't be dragged out of the Query Loop in the canvas.
  • But it can be dragged out of the Query Loop if dragging in the List View.
  • It can also be copy/pasted outside of the Query Loop.

I did a quick similar test with the Navigation block which similarly limits Page Links from being moved outside of the Navigation block, and noted that I can neither drag it outside in the list view, or copy paste it outside.

So it seems like a fix is to investigate why it's possible to move the query pagination outside, and potentially fix that.

@ntsekouras
Copy link
Contributor

👋 - I couldn't reproduce any unexpected behavior with Query Pagination... 🤔

I tried both in post and site editors:

  1. insert the block outside Query Loop
  2. drag Query Pagination or any of its innerBlocks outside (both in editor and List View)
  3. copy/paste Query Pagination or any of its innerBlocks outside

All pagination related blocks have the parent property set properly..

@jameskoster
Copy link
Contributor

This issue spills out of the site editor into the post editor as well. It's currently possible to insert blocks like Post Content and Term Description in a post or page, which makes no sense at all (unless you have a Query in a post 🙈).

Don't allow the block to be used outside where it will work.

I wonder if the simplest solution is to contextually hide the block from the UI (inserter / quick inserter)? IE if I'm editing a post, there should be no way for me to find the Term Description block at all.


FWIW there are a number of circumstances in which this contextual awareness will be beneficial. These issues are related:

@ntsekouras
Copy link
Contributor

This issue spills out of the site editor into the post editor as well. It's currently possible to insert blocks like Post Content and Term Description in a post or page, which makes no sense at all

This is a different issue whether to contextually hide/show some blocks. If the above issue can be reproduced, it's a bug in our block handling logic.

@jameskoster
Copy link
Contributor

Fair enough. I suppose I'm just highlighting that there are various situations in the UX where this contextual awareness would be useful, in case it's something we can build in at a low level and utilise in these different circumstances.

@karmatosed
Copy link
Member Author

I couldn't reproduce any unexpected behavior with Query Pagination...

@ntsekouras were you using Chrome? I just wonder if that could be the problem as I am puzzled because pretty consistently I can copy/paste and do any of the steps @jasmussen outlined.

@carolinan
Copy link
Contributor

carolinan commented Sep 29, 2021

I only tested the query (post template) and query pagination, and I am seeing the same as @ntsekouras, I can not insert, drag or copy/paste the blocks outside the parent query loop. Chrome and Opera on Windows.

In the site editor, when I copy the post template, and then paste it,
I do see the following message being added, and the block type for the message is paragraph:
The Query block can not be inserted outside of the Query Loop using either inserter.

@ntsekouras
Copy link
Contributor

@ntsekouras were you using Chrome?

Yes

@annezazu
Copy link
Contributor

This came up as a piece of feedback during the tenth call for testing for the FSE Outreach program:

It makes sense that ‘Post Categories’ and ‘Post Tags’ blocks can only work within the Query Loop block and when editing a Post and each would display categories and tags associated with that post. However, when someone tries to insert those blocks on the Page outside the Query loop block would just drop the spinning icon. Probably, because as we know Page has no category and outside the Query Loop, it can’t query the category. ‘Categories’ block would however work.

post.categories.mov

@ntsekouras
Copy link
Contributor

However, when someone tries to insert those blocks on the Page outside the Query loop block would just drop the spinning icon.

The spinning issue for Post terms/categories has been fixed here: #35957

@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Feature] Full Site Editing labels Jul 24, 2023
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

7 participants