persist showSidebar pref in session state; make toggle button component generic