Handle empty usage responses without leaving the panel in its loading skeleton.
- add a hasFetched flag to useUsageData so the UI can distinguish initial loading from an empty completed response
- update UsageIndicator to render the skeleton only before the first fetch completes and show the empty state afterward
- refresh dashboard hook and component tests to cover empty fetches, refresh behavior, and the new loading semantics
Files changed:
.../dashboard/app/components/UsageIndicator.tsx | 19 +-
.../components/__tests__/UsageIndicator.test.tsx | 395 +++++++++++----------
.../app/hooks/__tests__/useUsageData.test.ts | 42 ++-
packages/dashboard/app/hooks/useUsageData.ts | 5 +
4 files changed, 245 insertions(+), 216 deletions(-)
Fusion-Task-Id: FN-5886
Fusion-Task-Lineage: 8fa901a9-3167-4e33-a082-e5de95f692da
Parallel subagent pass: four typescript-pro agents on non-overlapping scopes.
Patterns applied:
- catch (err: any) { ... err.message ... } → catch (err) { ... getErrorMessage(err) ... }
using the new @fusion/core helper. Bare catch {} where the error was unused.
- SQLite row types: defined typed XxxRow interfaces per table and cast
.all()/.get() results via `as unknown as XxxRow[]` (the double cast is
required because better-sqlite3 returns Record<string, SQLOutputValue>).
- rowToX(row: any) converters: typed argument with the matching row interface.
- Dynamic settings key writes: (settings as Record<string, unknown>)[key].
- React event handlers and setState callbacks: inferred types or concrete
React.{Mouse,Change,Form}Event<...> where needed.
- pi-claude-cli: local PiMessage / PiContext duck types to avoid re-typing
pi-ai concrete shapes; typed Claude stream event message fields.
72 files changed, ~400 anys eliminated. Typecheck passes across the workspace.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add markOnboardingCompleted() to set completedAt timestamp when user finishes onboarding
- Add isOnboardingCompleted() to check if onboarding was completed (vs dismissed)
- Update ModelOnboardingModal to call markOnboardingCompleted on successful completion
- Skip onboarding auto-open when already completed locally
- Add completion state tracking tests in ModelOnboardingModal.test.tsx
- Add model-onboarding-state unit tests
- Update useAuthOnboarding to check local completion state before auto-opening
- Document localStorage completion state tracking pattern in .fusion/memory.md
- Fix moveTask to clear status/error/worktree/blockedBy when moving from in-progress to todo/triage
- Add error message display in TaskCard for failed tasks with truncation
- Add prominent error alert in TaskDetailModal for failed tasks
- Refactor usage tracking: move from app/components to dashboard/src/
- Add usage.ts and usage.test.ts for centralized usage tracking
- Remove UsageIndicator and useUsageData from app/ directory
- Update styles.css for error display components
- Update executor tests for error handling
- Add changeset for patch release