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

Nested blocks should limit the depth of nesting within them #5961

Closed
2 tasks
greatislander opened this issue Apr 3, 2018 · 3 comments
Closed
2 tasks

Nested blocks should limit the depth of nesting within them #5961

greatislander opened this issue Apr 3, 2018 · 3 comments
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Enhancement A suggestion for improvement.

Comments

@greatislander
Copy link
Contributor

Issue Overview

Currently, it's possible to add a Columns (Experimental) block within a Columns (Experimental) block many times over, and this makes for some weird inception-like behaviour.

Steps to Reproduce (for bugs)

  1. Add a Columns (Experimental) block.
  2. Within the first column, add another Columns (Experimental) block.
  3. Rinse, repeat.

Expected Behavior

  • Nested blocks should not allow other nested blocks to be inserted within them, except in specifically determined situations.
  • Nested blocks should limit the depth of nesting.

Current Behavior

There are no restrictions in recursive nesting.

Possible Solution

  • Nested blocks should not allow other nested blocks to be inserted within them, except in specifically determined situations.
  • Nested blocks should limit the depth of nesting.

Screenshots / Video

Columns

Related Issues and/or PRs

Possibly related to #5448.

Todos

  • Tests
  • Documentation
@ZebulanStanphill
Copy link
Member

It should be noted that there are cases where several levels of nesting would be very useful, such as a layout like the following:

  • section
    • columns (comprised of 2 columns: 1/4 + 3/4)
      • heading (in column 1)
      • columns (in column 1 - comprised of 2 columns: 1/2 + 1/2)
        • button
        • button
      • paragraph (in column 2)
    • paragraph

I have seen columns nested in columns multiple times, and if the proposed section block gets added, there will definitely be situations where columns containing nested columns are in turn nested into those.

One of the things that has to be considered is how a restriction on nesting depth would be implemented. A global hard limit would probably be a bad idea, in my opinion. As for the parent determining which blocks can be inserted into it and vice-versa (see #5448), that sounds like a good idea. But if columns are going to only restrict nesting depending on how many levels of nesting there already are, then the check for what blocks are allowed as children of a parent block (or vice-versa) becomes considerably more complicated, since you have to check not only direct parents or children, but also the parents of the parents or children of the children, and also accounting for other blocks in between the blocks (e.g. columns -> section -> columns) as well.

It should also be noted that #5658 has been merged, so the UI for navigating through and adding blocks to levels of nested blocks should be a lot easier now; perhaps a nesting limit may not even be necessary?

@greatislander
Copy link
Contributor Author

My ticket was badly named. I think the point I was trying to make was that the experience of nesting more than one level deep is not very user-friendly at present.

@danielbachhuber danielbachhuber added [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P Feedback [Type] Enhancement A suggestion for improvement. labels Apr 10, 2018
@danielbachhuber
Copy link
Member

Closing in favor of #6593 which is similar and more recent / relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants