We need to only collapse or expand the first panel under the cursor rather than all of them. Note that whether the parent panel or the subpanel is first depends on the order of the uiBlocks in the region's list.
make format
BKE_scene_get_depsgraph()
physics
simulation