Hi everyone,
I’m currently trying to customize the sidebar behavior in Frappe v15.
My goal is:
- The sidebar should be collapsed by default on all pages
- Except on the Workspace page, where it should remain expande
So far, I’ve tried two approaches:
-
Triggering the sidebar toggle button programmatically using
click() -
Manually adding the
.sidebar-collapsedclass to the sidebar wrapper
Both approaches seem to work, but I’m not sure if these are the recommended or cleanest ways to achieve this in Frappe v15.
My questions:
-
Is there a more proper or official way to control the sidebar’s default state?
-
Is there a built-in method or lifecycle hook that should be used instead?
-
Or is modifying the DOM / toggling classes the correct approach for this case?
I want to make sure I’m following best practices and not breaking anything internally.
Any guidance would be appreciated. Thank you!