Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix: Don't show stacked icon on parent blocks if all of its children are hidden from the inserter #9337
Until now even if all the children of a block were hidden from the inserter we showed the stacked icon in the parent.
We also move the logic of getBlockSupport to a selector so other selectors can use it. Some of the other simpler functions available in the block registration API are also promoted to selectors so we can add the new selector needed that uses them.
How has this been tested?
I used the following test block https://gist.github.com/jorgefilipecosta/7dbcf8ce79c57acc6eb2c64f0088f480 and checked that the parent block does not contain a stacked icon.
changed the title from
Don't show stacked icon on parent blocks if all of its children are hidden from the inserter
Fix: Don't show stacked icon on parent blocks if all of its children are hidden from the inserter
Aug 24, 2018
referenced this pull request
Sep 1, 2018
I guess I'm a bit confused / conflicted on what the stacking icon is meant to convey. To me, I had understood it to mean that there are additional blocks which can be inserted only within the context of this top-level block. That, and/or simply that it supports block nesting. For the Columns block, both are true: It supports nesting, and specifically nesting of blocks only supported within that type (the "Column" block), regardless whether those block types are surfaced via an inserter present.
Hi @aduth, thank you for the review the feedback was applied.
I think the meaning we want for the icon is to indicate to the user that inside that block (item on the inserter) there will be more inserter items available. On the columns case that's not the case, nothing exclusive to columns will appear on the inserter so that's the reason we are thinking about removing the icon from the columns (and similar external blocks).
Hi @aduth this PR does not change the columns it just changes the mechanism so a change to the columns can be applied. It can be tested using this block https://gist.github.com/jorgefilipecosta/7dbcf8ce79c57acc6eb2c64f0088f480.
The PR that applies a very trivial change to the column block (disables the inserter) is this one #9523. Probably I should have not divided the PR's given that it was a very simple change.