Problem/Motivation
With the changes made in #2829676: Change remove button by an "x" @Berdir suggested:
displaying the confirm/cancel (do we even have cancel right now?) as a centered element in the main area, not on the top-right corner like it is now. Probably even as a button type primary, so it is blue and well visible? Or maybe even some kind of client-side dialog/confirmation for faster user interaction?
After discussion we realized that core usually removes the element without a confirm form when a field is multiple.
Which would lead to have a more core-ish UI when deleting a paragraph.
Proposed resolution
Improve the UI when deleting a Paragraphs to declutter the UI and fix tests. This means to remove the confirmation buttons and remove the paragraph straight when clicking the remove button.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#26 | improve_cofirm-2831409-26.patch | 3.3 KB | hmdnawaz |
#19 | paragraphs_2831409_remove_18.interdiff.txt | 4.28 KB | miro_dietiker |
#16 | improve_confirm-2831409-16.patch | 11.4 KB | johnchque |
#12 | interdiff-2831409-10-12.txt | 1.21 KB | johnchque |
#12 | improve_confirm-2831409-12.patch | 10.87 KB | johnchque |
Comments
Comment #2
miro_dietikerHaving deleted as an intermediate state that can be undone is very drupal atypical. Why not simply execute the removal and even completely drop the deleted state?
It's not saved yet. So nothing is lost until a user clicks on save. That's Drupal typical.
Comment #3
drobnjak CreditAttribution: drobnjak at MD Systems GmbH commentedComment #4
johnchqueGreat, I gonna work on this.
Comment #5
johnchqueNow the Paragraph is deleted when clicking the x, no restore/confirm removal option.
Comment #8
johnchqueFixing tests. :)
Comment #9
tduong CreditAttribution: tduong at MD Systems GmbH commentedLooks nice :)
But I'm a bit confused about some points:
This comment should be updated as well (?) Not sure.. check first my last point.
Below these assertions, shouldn't we check also that this action is not "saved"/"these paragraphs are not actually deleted" if the user doesn't click on "Save an keep published", and then keep the rest of the test (// Delete the node) ?
Why changing the mode name to have 'removed' but keeping the element name like
'paragraphs_'
ID'_remove'
?Also since it is a UI change, some screenshots should be provided, but not sure what is the change exactly ...
Comment #10
johnchqueRight, let's make it fit better. Also added the requested tests. :) No idea what to take screenshot from.
Comment #11
tduong CreditAttribution: tduong at MD Systems GmbH commented"... unless the user saves the node.", then shouldn't there be also the test lines where the user saves the removed paragraph and check again the Edit page if the paragraph is actually deleted (?)
Otherwise looks alright for me :)
Comment #12
johnchqueAdded. :)
Comment #13
miro_dietikerBTW this was discussed already in a previous issue at #2414851: Make remove button remove the paragraph immediately
What confuses me is, that i cant see that issue change anything.
The previous parent issue is not directly related to overhauling the behavior of the remove / delete button.
Comment #16
johnchqueThe issue related didn't fix what is discussed here even the title says so, what it did was to add a "Deleted paragraph: paragraph type" message to the confirmation form. Will focus on bigger issues now.
Comment #17
johnchqueUpdated the issue summary and title.
Comment #19
miro_dietikerSo Thunder proposed some general UX improvements for their product at #2828095: [META] Roadmap for a better authoring UX
The specific proposal about the remove behavior is not yet visible, but it is aligned with our direction:
They propose a client side confirmation prior to delete submission. The remove button will basically expand and ask for confirmation.
That doesn't involve any ajax and thus our current behavior would even forcing them to override the server side double confirmation to avoid then triple confirmation.
Since i didn't get any negative feedback for this removal thing, committed it is.
One state less, much complexity gone. Party!
(Attaching interdiff of my additional changes prior to commit. Local tests passed. I managed to get rid of some code duplication around the remove button.)
I'm highly open to readd some less stateful client side double confirmation. (With JS test coverage :-) )
Comment #20
pixelmord CreditAttribution: pixelmord at Wunder for Hubert Burda Media commentedRegarding #19:
I created the meta issue for thunder that is related to this, our initial wireframes are visible in #2833922: Introduce a quick but safe way to remove/delete paragraphs. Thank you for the ground work to make this possible!
We need to see when we get to the point on our roadmap where we can introduce a client side JS solution for a quick confirmation similar to what is shown in the wireframe animation.
Comment #21
miro_dietikerPutting it into references. Thx!
Comment #22
pixelmord CreditAttribution: pixelmord at Wunder for Hubert Burda Media commentedAdded a feature request issue to open up discussion and have an issue where a patch and tests can be created:
#2833934: Introduce client side remove, with confirmation? and undo
Comment #24
Alexandre360 CreditAttribution: Alexandre360 commentedI installed the latest paragraph 8.x and I still have confirmation message when I try to delete a paragraph, did I miss something ?
Comment #25
Adam Clarey CreditAttribution: Adam Clarey commentedThis seems to have been reverted in later commits which is a shame because having to confirm removal is really annoying
Comment #26
hmdnawaz CreditAttribution: hmdnawaz commentedHere is the patch again for the latest version which was reverted in the latest commits.
Comment #27
baikhoI'm seeing the same on latest of
8.x-1.x
. Can we re-open this issue? It doesn't make sense to me to display this message if the functionality ignores the "confirm removal" option on save of a node or entity.Comment #28
BerdirWe will not change the legacy widget. Try the other one where this implemented
Comment #29
Hugo Chhor CreditAttribution: Hugo Chhor as a volunteer commentedFor those who want to easily skip "Confirm deletion / Restore actions" behavior, just implement this HOOK :
After the deletion, the data remain in the hidden state until the form is saved by the form submit button.
i.e. : If we refresh the page before saving the form, the data reappear as before.
The solution came to me after reading these Paragraphs files :
--
.../Plugin/Field/FieldWidget/InlineParagraphsWidget.php
--
.../tests/modules/paragraphs_test/paragraphs_test.module
Hope it would help ;-)