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

[AMP Stories] Fix default Inserter in the Toolbar #1966

Closed
miina opened this Issue Mar 14, 2019 · 9 comments

Comments

4 participants
@miina
Copy link
Collaborator

commented Mar 14, 2019

Currently, the Inserter in the upper Toolbar doesn't seem to work as expected. It seems to allow adding a Page within a Page and not allow the allowed child blocks.
Steps to reproduce:

  • Add a Page and a block (or some blocks);
  • Select a block within the Page;
  • Click on the default Inserter in the toolbar.
@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Mar 18, 2019

There was a recent bug fix in Gutenberg for the global inserter in the toolbar: WordPress/gutenberg#14020. It will be included in 5.3.

Let's test this with the current development version to see if anything changed for us. After all we do some on-the-fly filtering there.

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Mar 19, 2019

I just installed 5.3 RC 1 and it seems to work fine now!

  1. Add page
  2. Select block within page
  3. Click on global inserter in the toolbar
  4. See the full list of allowed child blocks (no pages or anything.

When a page or no block at all is selected, then the global inserter only allows you to insert pages.

@swissspidy swissspidy closed this Mar 19, 2019

@swissspidy swissspidy moved this from Backlog to Ready for QA in AMP Stories 1.0.0-beta Mar 20, 2019

@swissspidy swissspidy moved this from Ready for QA to Ready for Merging in AMP Stories 1.0.0-beta Mar 20, 2019

@swissspidy swissspidy reopened this Apr 2, 2019

@swissspidy swissspidy moved this from Ready for Merging to To Do in AMP Stories 1.0.0-beta Apr 2, 2019

@amedina

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

The flow when editing a page and I want to insert components to it does not work as expected.

For example: I am on a blank page, click on the inserter on the top left corner, and only the page block is available. The expected scenario is for the user to see all the blocks that can be inserted, and also the possibility of adding a new page.

@miina

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 2, 2019

@amedina That's the default behavior of the Inserter of Gutenberg -- it always shows what you can insert after the currently selected block. For example, if a Page is selected then you can insert only another Page after it and that's why only a Page shows, since the other blocks can't be inserter after the Page, they could only be inserter inside the Page.

On a blank page by default no block is selected, that's why the inserter shows only the Page -- this would insert a new Page. If it would show other blocks there, too, then it wouldn't be clear where they could be inserter. By default to the root element, but these are not allowed there.

Perhaps ideally if a Page is selected then other blocks would also be displayed and if a non-Page block would be inserted, it would be inserted as the last block of the selected Page.
However, not sure how easy it would be to change the default behavior. Thoughts, @swissspidy?

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Apr 2, 2019

Perhaps ideally if a Page is selected then other blocks would also be displayed and if a non-Page block would be inserted, it would be inserted as the last block of the selected Page.

Agreed. We turn Gutenberg a bit on its head with the way stories are edited, so changing the behavior here makes sense.

However, not sure how easy it would be to change the default behavior.

Neither am I. There are some issues surrounding the inserter, e.g. WordPress/gutenberg#14515, so we'd have to take a deeper look.

@amedina

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

We need to devise a solution because the flow is broken. One approach would be to have always a page selected, either explicitly by the user or by default following some heuristic (e.g. the leftmost page, the most recent, etc).

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Apr 3, 2019

For clarification, we already have a page that is always the "current" page. It's the one in the center of the screen. Having this block always selected (i.e. block toolbar and drag handles are always shown) sounds a bit odd, and as Miina said, wouldn't solve the issue anyway:

If a Page is selected then you can insert only another Page after it and that's why only a Page shows

@swissspidy swissspidy moved this from To Do to In progress in AMP Stories 1.0.0-beta Apr 10, 2019

@swissspidy swissspidy moved this from In progress to Ready for Review in AMP Stories 1.0.0-beta Apr 10, 2019

@swissspidy swissspidy moved this from Ready for Review to Ready for QA in AMP Stories 1.0.0-beta Apr 11, 2019

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Apr 11, 2019

QA: Access the inserter via the top left "+" (plus) icon button:

Screenshot 2019-04-11 at 14 22 21

Verify that, no matter what block is currently selected in the editor, you are able to insert all blocks using that inserter. Call-to-Action blocks should not be shown when editing the first page.

@swissspidy swissspidy closed this Apr 11, 2019

@csossi

This comment has been minimized.

Copy link
Collaborator

commented Apr 11, 2019

Verified in QA

@csossi csossi moved this from Ready for QA to Ready for Merging in AMP Stories 1.0.0-beta Apr 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.