Skip to content

feat(macos): overage + límite vinculante + estado global en la app de barra de menú - #2

Open
crilam wants to merge 2 commits into
mainfrom
worktree-macos-menubar-app
Open

feat(macos): overage + límite vinculante + estado global en la app de barra de menú#2
crilam wants to merge 2 commits into
mainfrom
worktree-macos-menubar-app

Conversation

@crilam

@crilam crilam commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Qué agrega

Amplía la app de barra de menú con los tres indicadores unified que faltaban (todos desde la misma fuente OAuth, sin nueva credencial):

  1. Medidor de Overage — uso extra sobre el plan (unified-overage-utilization), con color propio (púrpura <100%, rojo ≥100%) y soporta >100%. Solo se muestra si es relevante.
  2. Motivo de bloqueo del overage (unified-overage-disabled-reason), p.ej. org_spend_cap_reached → texto legible.
  3. Badge "límite actual" en la ventana vinculante (unified-representative-claim: 5h vs 7d).
  4. Estado global (unified-status) con punto de color allowed/warning/rejected.

Contexto

Se evaluó exponer límites por-modelo (Fable, Opus) o por-feature (Claude design): no es posible desde el feed de suscripción de Claude Code — el bucket unified agrega todos los modelos. Los límites por-modelo solo existen en la API de desarrollador (/v1/organizations/rate_limits, requiere Admin key) y no reflejan el uso del plan Max.

Verificación

  • swift build -c release limpio.
  • Bundle reconstruido, app relanzada: proceso estable, sin crash.
  • Datos reales confirmados: overage 105%, org_spend_cap_reached, representative-claim five_hour.

🤖 Generated with Claude Code

crilam and others added 2 commits July 28, 2026 14:19
… BLE

Monitor de uso de Claude Code como NSStatusItem: lee el token OAuth del
Keychain y los headers anthropic-ratelimit-unified-* de la API (misma
fuente que el daemon), sin dispositivo físico ni Bluetooth. Popover con
medidores 5h/7d, colores por umbral y cuenta regresiva de reinicio.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…global

Parsea los headers unified-overage-*, representative-claim y unified-status.
Popover: tercer medidor "Overage" (color propio, permite >100%), motivo de
bloqueo (p.ej. org_spend_cap_reached), tag "límite actual" en la ventana que
aprieta (5h/7d) y punto de estado global con color por allowed/warning/rejected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53d1b81816

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
}

if let usage = store.usage {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Surface refresh failures when cached usage exists

After the first successful poll, usage remains non-nil when a later refresh fails because UsageStore.refresh() only sets lastError. This branch therefore continues showing the cached meters instead of the error, while main.swift also suppresses the ! indicator whenever cached usage exists; an expired token or prolonged network outage can consequently leave an arbitrarily stale percentage displayed with no failure indication. Retain the last snapshot if desired, but surface its stale/error state.

Useful? React with 👍 / 👎.

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.

1 participant