Skip to content

Feat/expired tokens multi account theme - #10

Open
realitix wants to merge 6 commits into
Haletran:mainfrom
realitix:feat/expired-tokens-multi-account-theme
Open

Feat/expired tokens multi account theme#10
realitix wants to merge 6 commits into
Haletran:mainfrom
realitix:feat/expired-tokens-multi-account-theme

Conversation

@realitix

@realitix realitix commented Feb 19, 2026

Copy link
Copy Markdown

Summary

This PR adds three features to improve the extension's usability for power users and multi-account setups:

  • Graceful expired token handling — When an OAuth token expires, the extension now caches the last known data, shows a "(cached)" label, desaturates the icon, and monitors the credentials file for changes to auto-refresh. A new "Hide on Expired Token" toggle in preferences lets users hide the indicator entirely when the token is expired.
  • Multi-account support with auto-discovery — The extension automatically detects ~/.claude-*/ directories containing .credentials.json and monitors all accounts simultaneously. The panel displays the highest utilization across all accounts, and the dropdown menu shows per-account usage sections. Accounts can also be added manually and labeled via a new "Accounts" preferences group.
  • Theme-compatible styling — Removed hardcoded colors from section titles, percent labels, and reset labels so they inherit GNOME Shell theme colors. Uses opacity and neutral semi-transparent backgrounds for better light/dark theme compatibility.

Details

Expired token handling (98eef9a)

  • Monitors ~/.claude/.credentials.json for changes (debounced 500ms) and auto-refreshes on token update
  • On HTTP 401: caches last data, shows "(cached)" suffix, desaturates the panel icon
  • New hide-on-expired setting to completely hide the indicator when token is expired
  • New preference toggle: "Hide on Expired Token"

Multi-account support (10f9677)

  • New AccountState class to manage per-account state (credentials, file monitors, cached data, menu widgets)
  • Auto-discovers ~/.claude-*/ directories in the home folder
  • Respects $CLAUDE_CONFIG_DIR for the default account
  • Panel text shows the highest utilization across all accounts
  • Dropdown menu displays per-account sections with individual progress bars
  • New settings: extra-accounts (manually added config dirs) and account-labels (custom labels in path|label format)
  • Full preferences UI for managing accounts: auto-detected accounts are listed with editable labels, manual accounts can be added/removed

Theme compatibility (6e7fdf7)

  • Removed hardcoded color values from .claude-section-title, .claude-percent-label, .claude-reset-label
  • Progress bar background uses neutral rgba(128, 128, 128, 0.2) instead of white-based color
  • Reset label uses opacity: 0.6 instead of fixed gray color

Screenshots

Capture d’écran du 2026-02-19 17-39-23 Capture d’écran du 2026-02-19 17-39-41

It works great ! And thanks for this extension.

Monitor credentials file for changes and refresh automatically.
Show cached data with visual feedback (desaturated icon) when the
token expires, and add option to hide the indicator entirely.
Automatically detect ~/.claude-*/ directories and monitor multiple
OAuth accounts simultaneously. The panel displays the highest
utilization across all accounts, and the dropdown menu shows
per-account usage sections. Accounts can also be added manually
and labeled via the new Accounts preferences group.
Remove explicit color values from section titles, percent labels,
and reset labels so they inherit the GNOME Shell theme colors.
Replace fixed background-color on progress bar with a more neutral
semi-transparent gray. Use opacity instead of hardcoded color for
the reset label to better adapt to both light and dark themes.
@realitix

Copy link
Copy Markdown
Author

It fixes #3

Allow users to choose which account is displayed in the panel when
multiple accounts are configured: highest usage, lowest usage, or
specific pinned accounts shown side by side.
Create dynamic panel widgets per pinned account so each gets its own
label and progress bar, instead of sharing the single default bar.
When icon style is 'color', panel progress bars follow the usage color
scheme (green/yellow/orange/red). When 'monochrome', bars stay white.
@imajus

imajus commented May 1, 2026

Copy link
Copy Markdown

@Haletran bumping this and hope you can merge & release soon because it fixes the annoying issue #3

@dvdstelt

dvdstelt commented Jun 3, 2026

Copy link
Copy Markdown

+1

I created this PR which is completely separate from this one, that auto-refreshes the token. I use the Claude Desktop all the time instead of the CLI these days, which results in an expired token. I could raise a PR on top of this one as well to make that happen, but I didn't want to immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants