Skip to content

menubar: bring the lasts-until-reset verdict to the Capacity Dock and quota hover card #1215

Description

@MiguelMachado-dev

Proposal

#726 shipped deficit/reserve + lasts-to-reset/run-out captions on the Plan tab's utilization rows (#728). The two other quota surfaces — the Capacity Dock rows and the agent-tab hover card (QuotaDetailRow) — still show only "Resets in Xd Yh", so the am-I-going-to-make-it answer is missing exactly where most users now look.

Add the same verdict there, one line under the bar:

  • Lasts until reset — linear projection ≤ 100% at reset
  • Runs out in 2d 3h — overflow with the linear ETA (weekly/monthly windows)
  • Won't last until reset — overflow on ≤6h windows, keeping the existing ETA-suppression guard so short windows don't cry wolf
  • silent when early in the window, reset unknown, or already exhausted

Implementation sketch

Working proof exists on my fork — happy to PR it if the direction is right.

  • QuotaPace.inferredWindowSeconds(label:resetsAt:): window length from the normalized provider labels ("Weekly", "5-hour", "3-day", "Monthly usage limit"). The adapters derive labels from exact API durations, so the round trip is lossless except calendar months, which compute back from the reset date in UTC (mirroring monthlyWindowSeconds).
  • QuotaSummary.Window.paceVerdict: (text, willOverflow) on top of the existing QuotaPace.evaluate — no new math, no new data.
  • Rendered in CapacityDockQuotaRow and QuotaDetailRow, orange when overflowing.

Open questions for maintainers:

  1. Label inference vs threading exact windowSeconds through QuotaSummary.Window (~15 call sites). I picked inference — zero call-site churn, exact for every label the adapters emit today — but threading is more explicit if you'd rather.
  2. Wording on the ≤6h overflow ("Won't last until reset") vs deficit/reserve-only there, per the menubar: quota windows show no pace — add run-out projection (deficit, lasts-to-reset / runs-out-in) #726 review note.
  3. Whether the dock's compact rows should show it for every window or just the weekly headline.

Tests: 9 cases in QuotaPaceVerdictTests.swift (verdict text, overflow flag, every silence guard, label inference including "Weekly · Opus" and "Monthly usage limit").

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions