hass-browser_mod
hass-browser_mod copied to clipboard
FR: *Default* order and visibility of sidebar panels
Problem:
Currently Frontend Settings
→ Sidebar order
option is enforcing.
Browser_mod resets order/visibility each time page is reloaded.
They cannot be changed by users without admin role at all.
What I want is to set (non enforcing) defaults - for "new" browsers. Those can be changed later by any user at his/her discretion.
Solution: Make option set default visibility/order for a "new" browser. This might be a separate option or a flag to existing setting.
The "new" browser is where:
- user has logged in for the first time or has logged out (HA behavior)
- user data has not been cleared from browser settings,
Technical: Not sure if there is a special API for that but:
const hasModifiedSidebarPanels = !!(localStorage.sidebarHiddenPanels || localStorage.sidebarPanelOrder);
Sidebar settings are stored in browsers localStorage. Those 2 keys are undefined until user modifies sidebar first time and remains defined even if initial order or visibility are restored from sidebar editing gui.