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.
This encourages importing it from `textual.widgets.tree` instead, keeping it
in line with the other changes made for #1637.
Note this is a breaking change.
This commit moves the bulk of the work of each action into an internal
method that does everything *apart* from invalidating the tree. The idea
being that all of the expanded states get updated, all of the update counts
get updated, and then finally one single tree invalidation takes place (the
latter taking place in the public method, which calls the related internal
method).
See #1430.
This was asked about on Discord; reading the docs over again it's not
obvious what an `int` is for, or a `str`. This change seeks to explain
things at the API level at least.
Without this information, grid-rows and grid-columns will have the same percent_unit for scalars that are relative and thus relative dimensions will be wrong.
This provides an interim fix for #983. While the longer-term solution for
this is for us to *not* have the `textual` command available if the user has
installed textual rather than textual[dev], this at least informs the user
what's going on and why for now.