Skip to content

Claude code plugin: add dynamic progress bar icon, caching, and improved error handling#2155

Open
rsnemmen wants to merge 4 commits intomatryer:mainfrom
rsnemmen:claude-code
Open

Claude code plugin: add dynamic progress bar icon, caching, and improved error handling#2155
rsnemmen wants to merge 4 commits intomatryer:mainfrom
rsnemmen:claude-code

Conversation

@rsnemmen
Copy link
Copy Markdown
Contributor

@rsnemmen rsnemmen commented Mar 8, 2026

  • Add VAR_SHOW_BARS variable (default: true) to toggle a dynamic dual
    progress bar icon in the menu bar: 5h window on top row, 7d window on
    bottom row, generated as a 32×14 RGBA PNG via inline Python
    (struct/zlib/base64, no dependencies)

  • Add token caching (/tmp/.claude_swiftbar_token, 15 min TTL) to avoid
    repeated Keychain reads on every poll

  • Add API response caching (/tmp/.claude_swiftbar_cache, 5 min TTL,
    matching the poll interval) to avoid redundant network calls

  • Add curl --connect-timeout and --max-time flags; detect HTTP 000 and
    show "No internet connection" error

  • Handle HTTP 429 explicitly with a "rate limited" message

  • On 401, clear the token cache so the next run re-reads from Keychain

  • Replace ⚠️ emoji with plain "!" in show_error title for cleaner
    menu bar appearance

rsnemmen and others added 3 commits February 27, 2026 10:05
Displays how many credits are left in the 5 hour window. When you click on the
menu bar icon, it gives more information:
- 5 hour window
- 7 day window
- 7 day Opus window
  - Add VAR_SHOW_BARS variable (default: true) to toggle a dynamic dual
    progress bar icon in the menu bar: 5h window on top row, 7d window on
    bottom row, generated as a 32×14 RGBA PNG via inline Python
    (struct/zlib/base64, no dependencies)

  - Add token caching (/tmp/.claude_swiftbar_token, 15 min TTL) to avoid
    repeated Keychain reads on every poll

  - Add API response caching (/tmp/.claude_swiftbar_cache, 5 min TTL,
    matching the poll interval) to avoid redundant network calls

  - Add curl --connect-timeout and --max-time flags; detect HTTP 000 and
    show "No internet connection" error

  - Handle HTTP 429 explicitly with a "rate limited" message

  - On 401, clear the token cache so the next run re-reads from Keychain

  - Replace ⚠️ emoji with plain "!" in show_error title for cleaner
    menu bar appearance
@sprak3000
Copy link
Copy Markdown
Collaborator

@rsnemmen

Not sure if this PR's work was included in the most recent one I merged. Do these changes still need to be applied?

@rsnemmen
Copy link
Copy Markdown
Contributor Author

rsnemmen commented Mar 22, 2026 via email

@sprak3000
Copy link
Copy Markdown
Collaborator

Yes, these changes were not included in the previous PR, mainly progress bars. Can’t live without them now.RodrigoOn Mar 21, 2026, at 11:09 PM, Luis Cruz @.> wrote:sprak3000 left a comment (matryer/xbar-plugins#2155) @rsnemmen Not sure if this PR's work was included in the most recent one I merged. Do these changes still need to be applied? —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

👍🏽 You'll need to resolve the conflicts then. Once this is updated, we'll get it merged.

@sprak3000
Copy link
Copy Markdown
Collaborator

@rsnemmen

Looks like your merge made this PR have 0 changes... Could you check what is in main and see if you rolled up the changes previously here into your later PR?

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.

2 participants