From 864a7e29a1652fbb54eb5c1ff84ebeeb736cfe14 Mon Sep 17 00:00:00 2001 From: AgentSeal Date: Wed, 29 Apr 2026 15:05:39 -0700 Subject: [PATCH] feat(desktop): add findings tips, collapsible activity, loading overlay, empty state, star banner --- desktop/src/App.tsx | 191 ++++++++-------- desktop/src/components/ActivitySection.tsx | 55 +++++ desktop/src/components/EmptyProviderState.tsx | 33 +++ desktop/src/components/FindingsSection.tsx | 64 ++++++ desktop/src/components/LoadingOverlay.tsx | 15 ++ desktop/src/components/StarBanner.tsx | 36 ++++ desktop/src/lib/tips.ts | 70 ++++++ desktop/src/styles.css | 203 ++++++++++++++++++ 8 files changed, 568 insertions(+), 99 deletions(-) create mode 100644 desktop/src/components/ActivitySection.tsx create mode 100644 desktop/src/components/EmptyProviderState.tsx create mode 100644 desktop/src/components/FindingsSection.tsx create mode 100644 desktop/src/components/LoadingOverlay.tsx create mode 100644 desktop/src/components/StarBanner.tsx create mode 100644 desktop/src/lib/tips.ts diff --git a/desktop/src/App.tsx b/desktop/src/App.tsx index 979fcad..6e656bc 100644 --- a/desktop/src/App.tsx +++ b/desktop/src/App.tsx @@ -15,6 +15,11 @@ import { TrendInsight } from './components/TrendInsight' import { ForecastInsight } from './components/ForecastInsight' import { PulseInsight } from './components/PulseInsight' import { StatsInsight } from './components/StatsInsight' +import { FindingsSection } from './components/FindingsSection' +import { ActivitySection } from './components/ActivitySection' +import { LoadingOverlay } from './components/LoadingOverlay' +import { EmptyProviderState } from './components/EmptyProviderState' +import { StarBanner } from './components/StarBanner' const payloadCache = new PayloadCache() @@ -28,6 +33,10 @@ const PERIODS: Array<{ id: Period; label: string }> = [ { id: 'all', label: 'All' }, ] +const PERIOD_LABELS: Record = { + today: 'Today', week: '7 Days', '30days': '30 Days', month: 'Month', all: 'All', +} + const REFRESH_INTERVAL_MS = 60_000 export function App() { @@ -75,14 +84,12 @@ export function App() { } }, [period, provider, currency]) - // Initial + interval refresh useEffect(() => { refresh(true) const id = setInterval(() => refresh(false), REFRESH_INTERVAL_MS) return () => clearInterval(id) }, [refresh]) - // Tray menu "Refresh" event useEffect(() => { const unlisten = listen('codeburn://refresh', () => refresh(true)) return () => { unlisten.then(fn => fn()) } @@ -101,9 +108,7 @@ export function App() { invoke('open_terminal_command', { args: ['report'] }).catch(console.error) } - const openOptimize = () => { - invoke('open_terminal_command', { args: ['optimize'] }).catch(console.error) - } + const isFilteredEmpty = provider !== 'all' && payload.current.cost <= 0 && payload.current.calls === 0 return (
@@ -122,104 +127,90 @@ export function App() { currency={currency} /> -
-
- {payload.current.label} -
-
- {formatCurrency(payload.current.cost, currency)} -
-
- {payload.current.calls.toLocaleString()} calls - {payload.current.sessions} sessions -
-
- - - -
- - {insight === 'trend' && ( - - )} - {insight === 'forecast' && ( - - )} - {insight === 'pulse' && ( - - )} - {insight === 'stats' && ( - - )} -
- - {!loading && payload.current.calls === 0 && payload.current.sessions === 0 ? ( -
-

No session data yet

-

- CodeBurn reads local session logs from your AI coding tools. It looks like - none of the supported tools have written any sessions on this machine yet. -

-

Supported sources:

-
    -
  • ~/.claude/projects/ (Claude Code)
  • -
  • ~/.codex/sessions/ (Codex CLI)
  • -
  • Cursor IDE local database
  • -
  • GitHub Copilot session events
  • -
-

Run one of those tools for a session, then hit Refresh.

+
+
+
+ {payload.current.label} +
+
+ {formatCurrency(payload.current.cost, currency)} +
+
+ {payload.current.calls.toLocaleString()} calls + {payload.current.sessions} sessions +
- ) : ( -
-

Activity

- {payload.current.topActivities.length === 0 && ( -

No activity for this period.

- )} - {payload.current.topActivities.map(a => ( -
-
{a.name}
-
{formatCompactCurrency(a.cost, currency)}
-
{a.turns}
-
- {a.oneShotRate == null ? '—' : `${Math.round(a.oneShotRate * 100)}%`} -
-
+ +
- )} + - + {isFilteredEmpty ? ( + + ) : ( + <> +
+ + {insight === 'trend' && ( + + )} + {insight === 'forecast' && ( + + )} + {insight === 'pulse' && ( + + )} + {insight === 'stats' && ( + + )} +
- {payload.optimize.findingCount > 0 && ( -
- -
- )} + {!loading && payload.current.calls === 0 && payload.current.sessions === 0 ? ( +
+

No session data yet

+

+ CodeBurn reads local session logs from your AI coding tools. It looks like + none of the supported tools have written any sessions on this machine yet. +

+

Supported sources:

+
    +
  • ~/.claude/projects/ (Claude Code)
  • +
  • ~/.codex/sessions/ (Codex CLI)
  • +
  • Cursor IDE local database
  • +
  • GitHub Copilot session events
  • +
+

Run one of those tools for a session, then hit Refresh.

+
+ ) : ( + + )} + + + + + + )} + + {loading && } +