I am not sure that the side arrow and down arrow meanings are intuitive. It wasn’t for me at least.
I have two ideas…
Update to a menu like the font size menu. Not sure what to name the menu item, but the submenu would include minimize & expand or
An alternative might be to move the down arrow to the left of the code line number and a click on that arrow will minimize the line and its contents and the arrow rotates to the right?