On expansion, the keyboard command works well if you only want to expand whichever panel (sidebar or content) is selected.
You can get a bit more flexibility, if you need it, and combine expand and collapse in a single toggle, with a
customized expansion script.