molecule-core/canvas/src
Molecule AI Frontend Engineer e89d9a1239 feat(canvas): wire live metrics API in WorkspaceUsage (#592)
WorkspaceUsage now fetches GET /workspaces/:id/metrics on mount and on
workspaceId change. Displays input_tokens and output_tokens formatted
with toLocaleString, and estimated_cost_usd as $X.XXXXXX. Shows three
zinc-700 skeleton rows while loading; surfaces error text on failure.
Stale-fetch guard via ignore flag prevents state updates after unmount.

Also fixes missing 'use client' in RevealToggle.tsx (#603) — the
onClick handler requires client-side hydration.

Tests updated: 12 tests covering loading skeleton, API call correctness,
token formatting, cost formatting, error state, and workspaceId refetch.
All 551 canvas tests pass; build clean.

Closes #592
Closes #603

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:00:14 +00:00
..
__tests__ fix(canvas): replace unsafe-inline/unsafe-eval with nonce-based CSP (#450) 2026-04-16 20:35:27 +00:00
app Merge pull request #251 from Molecule-AI/feat/cookie-consent-banner 2026-04-15 13:49:53 -07:00
components feat(canvas): wire live metrics API in WorkspaceUsage (#592) 2026-04-17 06:00:14 +00:00
hooks initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
lib fix: code review findings — token UI, auth hardening, WS dedup 2026-04-16 10:42:26 -07:00
store fix: code review findings — token UI, auth hardening, WS dedup 2026-04-16 10:42:26 -07:00
stores initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
styles fix(canvas): C1/C2/C3/C5 dark-theme CSS and ReactFlow colorMode 2026-04-16 10:45:16 +00:00
types initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
middleware.ts fix(canvas): replace unsafe-inline/unsafe-eval with nonce-based CSP (#450) 2026-04-16 20:35:27 +00:00