Sidebar Gets Inadvertently Turned On, Found cause and possible solution

I don’t use the sidebar but noticed it would be on even with the option saying ‘off’ in the menu. Found out today it was changing the appearance settings and then closing the tab that was glitching it.


Description of the issue:
How can this issue be reproduced?

  1. Considering the side bar is OFF, then go to Settings, Appearance, Theme Brave Colors.

  2. That will open a panel to the right (and the sidebar). I would toggle Light/Dark for some applications but it is not necessary to make changes for this test.

  3. If you then close the settings tab at the top, you’ll note the sidebar is now left on even though it’s marked as ‘off’.

Expected result:
The sidebar tab will be left on even though it’s boolean value is off

Brave Version( check About Brave):

1.87.191

Additional Information:

The intended action is to click the little X on the upper right of the appearance panel which will collapse the sidebar correctly. Real humans WON’T do that though as why click an X and then close the tab (2 actions) when you can just close the tab (1 action).

To solve this, add a cleanup check every time a tab is closed (if not already) and within that check, verify current boolean value of the sidebar state(true/false) and if the sidebar object is currently active in hierarchy(true/false). If there is an incongruency, set the active state to the boolean state, solved.

@DoodleDangWang I can reproduce this.
I’ve gone ahead and filed this issue here: