feat: multi-account, configure window, escalating notifications, polished installer#2
Open
psychofict wants to merge 1 commit intoStaticB1:mainfrom
Open
Conversation
…shed installer
Adds nine features to the widget. Single-account behaviour is preserved
when only one account is configured.
Features:
- Multi-account: tray label aggregates across configured accounts
(Work:67% Personal:12%); per-account Claude config dir; per-account
hide-from-tray and disable-polling flags.
- Configure window: tray menu → Configure… opens a tabbed Gtk window
for editing accounts, thresholds, poll interval, burn-rate alerts.
Live-applies, no restart.
- Notification escalation: warn → critical → 100% tiers per window
per account, persisted across restarts so a mid-window relaunch
doesn't re-fire alerts. Re-arms when the window's resets_at shifts.
- Burn-rate alerts: configurable multiplier, 8-hour grace at start
of new 7d window to avoid false alarms on low-elapsed-time data.
- Graceful failure UX: ! for auth/network/rate errors, ? for the
brief gap between rollover and fresh data; last-known % preserved
so transient blips don't blank the indicator.
- Compact reset times: countdown (2h 15m) when polling, absolute
(9:00P / Th 7:00P) when polling is disabled for that account.
- Interactive installer: asks how many accounts to monitor, gathers
label + claude_dir + creds.json check per account.
- pyenv detection: --copies venv that survives pyenv version
switches; PyGObject pinned <3.51 on Ubuntu 22.04.
- Uninstaller: explicit prompt before removing user config.
Architecture changes:
- Split out shared.py (config + utility functions),
config_window.py (Configure UI), usage_popup.py (details popup)
to keep claude_usage_widget.py focused on the indicator + poll loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds nine features to the widget while preserving single-account behaviour when only one account is configured.
Work:67% Personal:12%); per-account Claude config dir; per-account Hide from tray and No poll flags.resets_atshifts.!for auth/network/rate errors,?for the brief gap between rollover and fresh data; last-known % preserved so transient blips don't blank the indicator.2h 15m) when polling, absolute (9:00P/Th 7:00P) when polling is disabled for that account.--copiesvenv that survives pyenv version switches; PyGObject pinned<3.51on Ubuntu 22.04.Architecture changes
The single `claude_usage_widget.py` becomes four files:
Notable: v1.0.4's Preserve cached data during 429 rate limit overlaps the broader cache-preservation logic introduced here, so the older narrow form has been superseded.
Test plan
acc1:NN% acc2:NN%.!; restore → previous % returns; force a window rollover →?shows briefly until next fetch.