Double Folding for Trees

Shows how trees can be enriched with a second expand-control.
One expands just the folder, the other expands the folder and all its sub-folders recursively.

Use the bigger traditional expand-control to expand / collapse just the current folder.
Use the smaller new expand-control to expand / collapse the tree fully.
Mind that the small control nicely indicates the presence of sub-folders!

I have also written a Blog about this.

First Tree (small, initially expanded, expand-all control is right)


Second Tree (big, initially collapsed, expand-all control is left)

Test Cases

Refresh the browser page before each test sequence.

In First Tree, ...

  1. click on small expand-control of item 1 to collapse the whole tree
  2. click on small expand-control of item 1 to expand it fully
Expected: all items are expanded, and all controls point down.
  1. click on small expand-control of item 1 to collapse the whole tree
  2. click on big expand-control of item 1 to expand just the root folder
Expected: just the root folder is expanded, the small expand-control on root points right, indicating collapsed sub-folders.
  1. click on small expand-control of item 1 to collapse the whole tree
  2. click on big expand-control of item 1 to expand just the root folder
Expected: item 1.3 is collapsed.
  1. click on (big) expand-control of item 1.3 to collapse it
  2. click on big expand-control of item 1 to collapse it
  3. click on small expand-control of item 1 to expand it fully
Expected: all items are expanded, and all controls point down.

In Second Tree, ...

  1. click on big expand-control of root to expand just the root folder
Expected: just the root folder is expanded, the small expand-control on root points right, indicating collapsed sub-folders.
  1. click on big expand-control of root to expand just the root folder
  2. click on big expand-control of item 3 to expand just that folder
  3. click on small expand-control of item 3.3 to expand it fully
  4. click on small expand-control of item 3 to expand it fully
Expected: all items are expanded, and their controls point down, except item 1 and item 4.

Known Bugs

  1. click on small expand-control of root to expand the tree fully
  2. collapse all folders below the root folder
Expected: the expand-all control on root folder is pointing right, indicating that not all sub-folders are expanded.
Result: the expand-all control on root folder is still pointing down, indicating that all sub-folders are expanded, but some are collapsed. This is because tree-nodes do not communicate with nodes above them.

ɔ⃝  Fritz Ritzberger, 2017-08-18