We copy the mkdocstrings template for attributes so that we can exclude the (default) value for attributes (and class variables) from the documentation as that is generally useless.
This is the fix for #1372 because the styles that were sticking had nothing to do with `:hover` per se.
The issue was in the fact that we were trying to start a second animation (back to the default background color) while the first animation hadn't started yet, so we would skip the creation of the new animation but the old one would still run to completion.
This issue also affects animations that start with a delay. If we set an animation A -> B with a delay of 10s and 1s later we set an animation B -> A, then the animation A -> B will run after 9s but the animation B -> A will not run because it was not created in the first place.
See https://github.com/Textualize/textual/pull/1644#issuecomment-1401720808
where Darren raises the excellent point that while the "technically correct"
approach that I had was... well, technically correct I guess (it toggled all
the nodes from the target node down), it didn't have what was likely the
desired effect.
So this commit does away with the previous logic for doing the toggle and
instead simply calls on expand or collapse depending on the state of the
source node.
Somehow I'd managed to typo them as True when they obviously should be False
to maintain backward-compatibility (and generally this is the only sensible
default).
As pointed out in #1649, a `ChildrenUpdated` message is documented but it
doesn't exist in the code. It looks like it got added during development,
then removed after it was realised it wasn't needed, but presumably it got
left in the docs:
https://github.com/Textualize/textual/pull/1143#discussion_r1030409026
It might seem excessive for just a single argument, but I feel it's
worthwhile doing it here. It's a single boolean parameter on each of the
methods that, left bare, will always end up reading badly. Consider:
tree.toggle( True )
vs:
tree.toggle( toggle_all=True )
the former looks awkward at best and ugly at worst; toggle True? What does
that even mean? The latter, while a touch more verbose, makes it really
clear what's going on.
Trying this on for size.