-
Notifications
You must be signed in to change notification settings - Fork 384
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
Simple way to remove AMP story pages #3279
Comments
I'd first have some UX feedback here, so I don't think this is an XS task. |
What about using the new right click menu for this? Related: #2532. |
Also related is #3280 & #3221. This issue shows that pages are sometimes mistakenly removed them the delete key is pressed. It we clear to users how to remove blocks and pages, they should be multiple ways of doing it and it should be clear what is going to removed when that button / key is pressed. |
Hmm we should avoid using the term "block" whenever possible. For pages we should use "Duplicate page" and "Remove page", and otherwise we should use "Duplicate element" and "Remove element" |
Is this even doable in Gutenberg? I guess this is a core panel, that we have little control over. Can we insert such a link, @spacedmonkey? |
Completely possible. The background color is inserted by our code. We can hook in and add whatever we want to that sidebar. |
I'm talking about the very top link though. I haven't seen any of our components changing that panel except for the text inside. But if it's doable, then this is pretty quick to write up in Implementation Brief. |
I think it's doable by just adding a link directly within
@cathibosco Should we do this for all blocks? Seems a bit inconsistent otherwise. |
100% Agree with this ⬆️ I will await an answer before I write up an implementation. |
It was correctly stated that this is not easily doable in the editor (Gutenberg limitation). @cathibosco @jauyong Since that is not possible, what is the expected UI when opening the menu when a page is selected? With #3538 it currently looks like this: Where both remove links perform the same action. IMO that is very confusing and it should only display the "Remove Block" label, even though the label is not ideal. |
It doesn't perform the same action always. If a text block is selected then that will be removed. I didn't love the behavior, but we are limited by what we can control in GB. This behavior was detailed in the IB, which was approved and reviewed. |
In my comment I explicitly mentioned the "when a page is selected" use case :)
It doesn't match the AC though, which is why I am raising this question. |
It's always easier to understand what's better once something actually has a visual presentation and can be tested out. The goal is to create the best UX for the user and it's OK to make changes if it comes out later that some detail in the IB could be improved. WDYT?
The existing behavior of the More Options allows Removing a page when it's the first and only page as well. This is very useful when quickly wanting to "clear" the first Page since a new clean Page is always added if no Pages exist in the Story. It makes more sense than creating a new Story as suggested here or cleaning the page block by block since:
I honestly don't see any reason at all why it shouldn't be allowed. What's the downside? Thoughts? |
Agreed that it's confusing and makes sense to only display "Remove Block". |
The IB review as fallen down here. I included screenshots and details on behaviours in the IB. Why is this being flagged now? The point of the IB was to stop changes in functionality when it gets to code review like this. Personally I don't think we should merge #3538 as it doesn't add value and is a little confusing. I think we should focus on #3466 . However in my research,I couldn't find a way to change the text on the remove block to remove page, which is what I originally wanted to do. |
This is a new process for everyone, we're all learning how to do things better, looks like it's not so easy to think through all the details based on IB only. Visually being able to test the feature out is always easier. This has been a good experience for future reviews though and a reminder to try thinking through the edge cases even more, too. Unfortunate that this happened with a PR that you already started working on. |
AC3 and IB3 are being taken out of this ticket. Please see this slack conversation for more information. The AC and IB have been put in #3552 Removed:
When the remove page menu item is clicked, the current page should be remove. Test 3
|
Assigned to @csossi for him to do his thing. To confirm, the Remove page button, should not appear if there is only one page 👍 |
Feature description
As a user I want there to be an easier way to remove pages from within the editor.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
Implementation for this issue is broken into two piece of work.
InspectorControls
for the edit method the page block.Mock up of which looks like this.
Currently the context menu is limiting to only appearing in one of two cases. First if a block other the the page block is selected, it shows options. Case two, if a page block is selected and there a block in the clipboard, show a 'Paste block' option.
To implement this feature, some of the limitations and checks for if page is selected. These will have to be removed. The following limitations will need to be respected.
A mockup of what this will look like.

QA testing instructions
Test 1
Test 2
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: