What is the request?
The grouper's collapsed/expanded state is not remembered. Every time yasb starts (or is restarted for a config/stylesheet change), the grouper goes back to collapsed, so the widgets I had expanded are hidden again and I have to click the button once more.
In grouper.py the state starts as self._collapsed = self._collapse_options.enabled, and the same flag is then reused to decide whether the collapse button gets created at all, so there is currently no way to start expanded.
Why is it useful?
Collapsing is a per-user decision that rarely changes: if I expanded my tools group yesterday, that is how I want the bar to look today. Right now every restart silently undoes it.
It also depends a lot on how often yasb restarts. With watch_config/watch_stylesheet off, a theme or stylesheet change means a full restart, and the group collapses again every time.
This is the same problem that was solved for the systray in #1019, so it would be nice for the grouper to behave consistently with it.
How could it be implemented?
Two options, either one would work for me:
- Persist the state the same way the systray does (a small json under
%LOCALAPPDATA%\Yasb, keyed by bar/monitor + widget name) and restore it on start.
- Or just expose the initial state in the config, which is simpler:
extras:
type: "yasb.grouper.GrouperWidget"
options:
widgets: ["dnd", "brightness", "power_plan"]
collapse_options:
enabled: true
collapsed: false # initial state, currently always collapsed
For either one, _collapsed and "collapsing is enabled" would need to be two separate flags, since right now the button is only built when _collapsed is true.
The config option alone would already cover most cases; persistence would be the nicer behavior.
Additional context
yasb 2.0.6 on Windows 11.
What is the request?
The grouper's collapsed/expanded state is not remembered. Every time yasb starts (or is restarted for a config/stylesheet change), the grouper goes back to collapsed, so the widgets I had expanded are hidden again and I have to click the button once more.
In
grouper.pythe state starts asself._collapsed = self._collapse_options.enabled, and the same flag is then reused to decide whether the collapse button gets created at all, so there is currently no way to start expanded.Why is it useful?
Collapsing is a per-user decision that rarely changes: if I expanded my tools group yesterday, that is how I want the bar to look today. Right now every restart silently undoes it.
It also depends a lot on how often yasb restarts. With
watch_config/watch_stylesheetoff, a theme or stylesheet change means a full restart, and the group collapses again every time.This is the same problem that was solved for the systray in #1019, so it would be nice for the grouper to behave consistently with it.
How could it be implemented?
Two options, either one would work for me:
%LOCALAPPDATA%\Yasb, keyed by bar/monitor + widget name) and restore it on start.For either one,
_collapsedand "collapsing is enabled" would need to be two separate flags, since right now the button is only built when_collapsedis true.The config option alone would already cover most cases; persistence would be the nicer behavior.
Additional context
yasb 2.0.6 on Windows 11.