Closing folders in list view
Opt ⌥ -Click the reveal arrow next to foo.

Alternatively,  Opt ⌥   ←  will do the same thing.
 Opt ⌥   →  will re-open them all.

It appears Mojave closes them all by default now [though with no real consistency I can find], but previously opt/action was the way.