may be related to #2919678: Collapse all button incorrectly shown and #2919685: Inconsistent behaviour for "Collapse all" and "Edit all" Buttons
Problem/Motivation
Given you use paragraphs experimental widget and configure it to use edit mode "Closed (same as in #2919678: Collapse all button incorrectly shown) and make sure to set Autocollapse to "None". Then create a new node with at least to paragraphs and save it. Now edit the node again.
As long as you do not click on the "Collapse all" button, paragraphs are not autocollapsed (as configured). But as soon as you click on "Collapse all", autocollapse will be activated and you can only have one paragraph open at a time
Comment | File | Size | Author |
---|---|---|---|
#28 | interdiff-2919689-25-28.txt | 1.29 KB | johnchque |
#28 | collapse_all_button-2919689-28.patch | 6 KB | johnchque |
| |||
#28 | collapse_all_button-2919689-28-test-only.patch | 2.18 KB | johnchque |
#25 | interdiff-2919689-23-25.txt | 3.85 KB | johnchque |
#25 | collapse_all_button-2919689-25.patch | 5.97 KB | johnchque |
|
Comments
Comment #2
daniel.bosenComment #3
miro_dietikerYeah "Expand all" will disable the autocollapse again. This enable / disable of the autocollapse works in both directions.
It was designed for people who want this... ;-)
I guess we need an extra autocollapse setting that completely disables it - or create a new one that then triggers autocollapse behavior like now.
Autocollapse:
Open for better labels. :-)
Comment #4
daniel.bosenI think the current behaviour is confusing and not very obvious. Not sure about a good wording here. How many peaple want this anyway? :)
Maybe a second modifier could be introduced like this:
Autocollapse?
- yes
- no
Change autocollapse behaviour with Collapse all / Edit all?
- yes
- no
Comment #5
mtodor CreditAttribution: mtodor at Thunder commentedI'll try to add this behavior proposed as it's proposed on #4, because with current behavior it's possible to start with "Autocollapse" enabled or disabled and it will change with "Collapse all" or "Edit all" action. So it's better to keep it separated instead of introducing 4th option to "Autocollapse" mode with: Enabled until "edit all".
And what do you think about using of Checkboxes instead of Dropdown buttons, since it's only true/false value in both cases?
Comment #6
mtodor CreditAttribution: mtodor at Thunder commentedI have adjusted implementation a bit. Since there is one case where behaviour is not so nice - fe. when you have autocollapse: yes and change autocollapse on collapse/edit all: no - then "Edit all" button should not expand all paragraphs (in general, it should be disabled). So what I have changed is, that "Change autocollapse behaviour" option works only for "Collapse all" button and "Edit all" button will always disable Autocollapse.
Patch with a proposal is attached to issue.
Just one more proposal (not related to this issue). Since this autocollapse enable/disable on collapse/edit all is a bit understandable and hidden behaviour, maybe we could show indicator if autocollapse is enabled or disabled. For example:
Comment #8
mtodor CreditAttribution: mtodor at Thunder commentedCorrected missing schema entry.
Comment #9
miro_dietikerOK, convinced and revoking #3 - Sorry for the change of direction. :-)
We don't want to have a new setting for this small extra.
This is a bug, it should consider the "Autocollapse" setting and only enable autocollapse if it is enabled in the widget setting.
At the same time, if it's easy, let's hide the Autocollapse setting completely with states when the default state is open.
More ideas about collapse UX in follow-ups and opt-in only.
Comment #10
johnchqueWorking on this. :)
Comment #11
johnchqueOK, it seems that we didn't need to update the autocollapse setting at all.
Tests added. :)
Comment #14
johnchqueFixing tests. :)
Comment #17
miro_dietikerIf you drop these, then expanding all is of a temporary effect if autocollapse is enabled in the widget.
It makes the autocollapse mode unusable for many cases.
If autocollapse is enabled in the widget settings, it is still needed to do these disable / enable switches.
Comment #18
johnchqueThen what should it be the desired behavior?
If autocollapse enabled:
- Edit first paragraph, second is closed
- Edit second paragraph, first is closed
- Edit all, all open (disabling autocollapse) until...
- Collapse all, all closed (autcollapse enabled) until "Editing all"
?
Comment #19
miro_dietikerExactly. You just put the widget state changes above into an if() that checks if the widget configuration has autocollapse enabled.
Comment #20
johnchqueI see, let's work on that then. :)
Comment #23
johnchqueMaybe better. :)
Comment #24
miro_dietikerReads too much "setting" for me. :-) maybe just _default?
I would prefer to assert here (additionally) the editable field...
BTW below we have some nice helper checkParagraphInMode() but it's a BrowserTest... We should convert and reuse the helper in some mid term follow-up.
Comment #25
johnchqueLet's see. :)
Comment #27
Berdirtypo: doesn not
Ah, so we actually had explicit test coverage for the old behavior, interesting.
The comment here needs an update I think, not correct anymore if autocollapse is not enabled in the first place in this context.
Comment #28
johnchqueFixing comments as suggested above. :)
Comment #31
miro_dietikerYes, now it looks nice, committed.