molecule-core/canvas/src/lib
Hongming Wang 858b1d70ce feat(canvas): Phase 5 — credit balance pill + low-balance banner
Adds the UI surface for the credit system to /orgs:
- CreditsPill next to each org row. Tone shifts from zinc → amber at
  10% of plan to red at zero.
- LowCreditsBanner appears under the pill for running orgs when the
  balance crosses thresholds: overage_used > 0 → "overage active",
  balance <= 0 → "out of credits, upgrade", trial tail → "trial almost
  out".
- Pure helpers extracted to lib/credits.ts so formatCredits, pillTone,
  and bannerKind are unit-tested without jsdom.

Backend List query now returns credits_balance / plan_monthly_credits
/ overage_used_credits / overage_cap_credits so no second round-trip
is needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 07:27:29 -07:00
..
__tests__ feat(canvas): Phase 5 — credit balance pill + low-balance banner 2026-04-19 07:27:29 -07:00
api feat(canvas): SaaS cross-origin — slug header + cookie credentials (Phase F) 2026-04-14 20:08:39 -07:00
validation initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
api.ts fix(canvas): add 15s fetch timeout on API calls 2026-04-19 02:12:47 -07:00
auth.ts feat(canvas): AuthGate — redirect anonymous users to cp login (Phase F close) 2026-04-14 20:37:26 -07:00
billing.ts feat(canvas): post-checkout UX — Stripe success lands on /orgs with banner 2026-04-19 04:18:32 -07:00
canvas-actions.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
credits.ts feat(canvas): Phase 5 — credit balance pill + low-balance banner 2026-04-19 07:27:29 -07:00
deploy-preflight.ts fix(canvas): add hermes + gemini-cli to deploy preflight required keys 2026-04-16 21:45:54 -07:00
design-tokens.ts fix(canvas): address all code review findings on PR #482 2026-04-16 07:48:47 -07:00
hydrate.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
runtime-names.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
services.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
tenant.ts feat(canvas): SaaS cross-origin — slug header + cookie credentials (Phase F) 2026-04-14 20:08:39 -07:00
utils.ts chore(canvas): initialize shadcn/ui — components.json + cn utility 2026-04-18 07:57:17 -07:00
ws-url.ts fix: code review findings — token UI, auth hardening, WS dedup 2026-04-16 10:42:26 -07:00