Merge "Centeralize logic for panel expanded states" into main