related to #27676
It might be worth adding a test in test_progressbar.py that verifies that the RichTask tree mirrors the CallbackContext tree. This would guard against regressions if RichProgressMonitor (which builds the tree) is modified in the future.
Both trees should have an identical structure except for the leaf nodes (max_subtasks=0) which are excluded in RichTask.__iter__().