Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
Experimental Widget
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Aug 2017 at 08:45 UTC
Updated:
1 Oct 2018 at 15:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
miro_dietikerThis seems like an important UX step.
Comment #3
miro_dietikerUX wise, i want to look into this idea.
One idea is that we offer a setting where collapsing always only affects the regular form fields, while the full hierarchy is always output. Thus hierarchy expand/collapse would be a non-ajax operation.
We need to assess how much slow down this causes for reference situations.
This already needs a certain level of client side summary update.
Comment #4
miro_dietikerThis came up again because by adding containers combined with collapsed display editors loose overview.
Actually our use case would be to expand top level containers only. This can be achieved if it is a widget setting.
Comment #5
arpad.rozsa commentedI added the new edit mode "Closed, expand nested" to the widget settings and a test to check, if only the top level container is opened, when using this new mode.
Comment #6
miro_dietikerThis looks very nice. :-)
Comment #7
berdirSo this relies on overwriting the default if this is no submission by relying on the trigger element. Interesting approach.
Wondering if it would be easier to follow if you'd instead embed it into the logic above, something like this:
elseif (closed) {
closed
}
elseif (closed_expand_nested) {
default to closed then the code you have.
Other than that, this looks great, even has test coverage for nested containers to ensure that if you do want to have nested expanded too, you can do that with the widget settings there.
Comment #8
berdirComment #9
arpad.rozsa commentedIt is easier and I wanted to do it like you described, but first getting the field definitions in that elseif, didn't want to work exactly how it should've, so I went with the solution I uploaded before, But after rechecking everything now, it works fine, so I updated the code.
Comment #10
berdirFor next time: When updating a patch, you should provide an interdiff, so that it is easier to review the changes you did. See https://www.drupal.org/documentation/git/interdiff. I usually just do that by working on a branch, and committing each version, then the interdiff is just git diff HEAD~1.
Trying to set a better title, this has nothing to do with the autocollapse feature, only the regular edit mode.
And the current label for the option is also not confusing, I suggested that and I'm not sure what else to use. We don't expand nested paragraphs, we expand paragraphs that *have* nested paragraphs :)
Miro?
Comment #11
miro_dietikerHm, you removed the term "container" from the title - i would consider "Closed, expand containers" appropriate, but i see that this is maybe an unknown term.
In fact we are not only expanding the ones with children, but also empty ones that could have children.
I also thought about using generic tree terms (leave, node) but there's too much clashing with Drupal nodes.
So no good idea yet.
Comment #13
miro_dietikerClosed, expand nested => Closed, show nested
Committed otherwise as is.