mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 💳 feat: Show Balance in the Context Gauge as Credits, Currency, or Percent Move the balance out of the account menu into the composer's context gauge, below the context window, and add `balance.display` (credits | currency | percent, default credits) to choose how it reads. Currency reuses `interface.currency` at 1,000,000 credits per USD; percent shows only the share of the period's allotment spent. Settings > Account > Billing renders the same summary from the same hook, so both surfaces show identical figures, bar and refill timing in every mode. * 🧭 fix: Normalize the Balance Display Mode and Reuse a Fresh Reading on Hover Admin overrides reach the client without schema validation, so an unknown `balance.display` now reads as credits instead of being typed as a mode it is not. Hovering the gauge mounts the balance reader each time the card opens; a 30 s stale window stops every hover from refetching, while the explicit refetch after each turn still bypasses it. * 🩹 fix: Restore Gauge Popover Fixes and Tighten Balance States The popover extraction was written from a pre-sync read of TokenUsage, so it dropped dev's viewport caps and scrolling, the hideOnInteractOutside close fix, the Tailwind v4 outline-hidden rename, and the card's max-w-full; restore them. Refill copy now says when a refill becomes available rather than promising a deposit, since one lands only once the interval has passed and a charge would exhaust the balance. An empty balance reads as fully used even without an allotment, percent mode without one says usage is unavailable instead of leaving the figure blank, the balance-only ring takes the balance tone (amber until empty) and is a meter only once it has a value. * 🪙 fix: Read a Non-Positive Refill Amount as No Auto-Refill in Settings The server never refills when the amount is not positive, and the balance summary already says so; Settings showed its load error instead. * 💸 fix: Show the Insufficient-Funds Error in the Balance Display Mode The token-balance error still printed raw credit figures, so `percent` leaked the numbers it hides and `currency` mixed units with the gauge. It now reads the same display mode and formatter as the balance summary: credits as before, money in currency mode, no figures in percent mode. The auto-refill settings row also renders its own loading and failure states, since settings search can show it without the balance row beside it. * 🎚️ fix: Keep Fractional Credits and Drop the Moved Popover's Suppression Credit amounts keep up to two decimals, so an insufficient-funds message no longer reads 100.4 against 100.3 as 100 against 100; whole amounts still print without decimals. The design-rule backlog may not follow code into a new file, so the extracted popover uses the standard `transition` utility instead of the arbitrary `transition-[opacity,transform]` (which also misses Tailwind v4's separate `translate` and `scale` properties) and its suppression is removed. The composer geometry spec now reads the classes from `Popover.tsx`, where the gauge button lives. |
||
|---|---|---|
| .. | ||
| src | ||
| babel.config.js | ||
| jest.config.js | ||
| jest.resolver.cjs | ||
| jest.setup.ts | ||
| package.json | ||
| tailwind.compat.cjs | ||
| tailwind.config.js | ||
| tailwind.preset.cjs | ||
| tsconfig.json | ||
| tsconfig.test.json | ||
| tsdown.config.mjs | ||