By default, auto-collapse icon panels are not selected. You can select it, but this only works when the panel is docked and attached to the sidebar. You can try to paste the edge of the layer panel, click on the layer panel and edit the things in the layer. When you let go to do something else, the layer panel will automatically shrink. Its purpose is to save view space. ?
You can have a look at this painting.