diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index b99d316..6183d2c 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -53,7 +53,6 @@ import { import { Progress } from '@/components/ui/progress'; import { Separator } from '@/components/ui/separator'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; -import { JsonViewer } from '@/components/json-viewer'; const registerSchema = z.object({ name: z.string().min(2), @@ -706,42 +705,34 @@ function Dashboard() { -
- - - Usage metrics - - - {metricCards.length === 0 ? ( -
- No usage data yet. Connect an OpenAI account and complete the sign-in flow to start refreshing. -
- ) : ( -
- {metricCards.map((metric) => ( -
-
- {titleizeMetric(metric.label)} -
-
- {metric.value.toLocaleString()} -
+ + + Usage metrics + + + {metricCards.length === 0 ? ( +
+ No usage data yet. Connect an OpenAI account and complete the sign-in flow to start refreshing. +
+ ) : ( +
+ {metricCards.map((metric) => ( +
+
+ {titleizeMetric(metric.label)}
- ))} -
- )} - - - - -
+
+ {metric.value.toLocaleString()} +
+
+ ))} +
+ )} +
+
@@ -768,79 +759,68 @@ function Dashboard() { {summary.accounts.map((account) => ( -
-
-
-
-
- {account.label} -
-
- {account.providerEmail || - account.emailHint || - 'No email available yet'} -
+
+
+
+
+ {account.label}
- - {account.status} - -
- -
-
- - Auth: {account.authType} -
-
Plan: {account.planType || 'Unknown'}
-
- Provider account:{' '} - - {account.providerAccountId || 'Unknown'} - -
-
Session expires: {formatDate(account.sessionExpiresAt)}
-
Last synced: {formatDate(account.lastSyncedAt)}
-
Connected: {formatDate(account.createdAt)}
-
- Error:{' '} - - {account.lastError || 'None'} - +
+ {account.providerEmail || + account.emailHint || + 'No email available yet'}
-
- - + + {account.status} + +
+ +
+
+ + Auth: {account.authType} +
+
Plan: {account.planType || 'Unknown'}
+
+ Provider account:{' '} + + {account.providerAccountId || 'Unknown'} + +
+
Session expires: {formatDate(account.sessionExpiresAt)}
+
Last synced: {formatDate(account.lastSyncedAt)}
+
Connected: {formatDate(account.createdAt)}
+
+ Error:{' '} + + {account.lastError || 'None'} +
- +
+ + +
))} diff --git a/apps/web/src/components/json-viewer.tsx b/apps/web/src/components/json-viewer.tsx deleted file mode 100644 index 57ead20..0000000 --- a/apps/web/src/components/json-viewer.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; - -export function JsonViewer({ title, description, value }: { title: string; description: string; value: unknown }) { - return ( - - - {title} - {description} - - -
-
-            {JSON.stringify(value, null, 2)}
-          
-
-
-
- ); -} diff --git a/apps/web/test/dashboard-card-copy.test.js b/apps/web/test/dashboard-card-copy.test.js index ded9e54..60266bf 100644 --- a/apps/web/test/dashboard-card-copy.test.js +++ b/apps/web/test/dashboard-card-copy.test.js @@ -9,7 +9,6 @@ describe('dashboard card copy', () => { expect(appSource).toContain('Unified capacity'); expect(appSource).toContain('Usage metrics'); expect(appSource).toContain('Connected OpenAI accounts'); - expect(appSource).toContain('description="Combined raw JSON."'); expect(appSource).toContain(">Merged by default. Inspect each account below.<"); expect(appSource).not.toContain( 'Fast glance card for the first two numeric metrics extracted from the merged usage payload.', @@ -20,8 +19,10 @@ describe('dashboard card copy', () => { expect(appSource).not.toContain( 'Raw aggregated JSON merged from every attached OpenAI Codex account.', ); + expect(appSource).not.toContain('Combined raw JSON.'); expect(appSource).not.toContain( 'By default, these accounts are merged into one Codex usage view. Switch tabs to inspect individual account payloads and timestamps.', ); + expect(appSource).not.toContain('Raw JSON for this account.'); }); }); diff --git a/apps/web/test/dashboard-payload-panels.test.js b/apps/web/test/dashboard-payload-panels.test.js new file mode 100644 index 0000000..83fb0e9 --- /dev/null +++ b/apps/web/test/dashboard-payload-panels.test.js @@ -0,0 +1,17 @@ +import { describe, expect, test } from 'bun:test'; +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; + +const appSource = readFileSync(join(import.meta.dir, '../src/App.tsx'), 'utf8'); + +describe('dashboard payload panels', () => { + test('removes merged payload and account payload panels from the dashboard', () => { + expect(appSource).not.toContain('title="Merged payload"'); + expect(appSource).not.toContain('title="Account payload"'); + expect(appSource).not.toContain('description="Combined raw JSON."'); + expect(appSource).not.toContain('description="Raw JSON for this account."'); + expect(appSource).not.toContain("summary.aggregatedUsage ?? { message: 'No data yet' }"); + expect(appSource).not.toContain("account.usage ?? {"); + expect(appSource).not.toContain("import { JsonViewer } from '@/components/json-viewer';"); + }); +}); diff --git a/apps/web/test/mobile-overflow-guards.test.js b/apps/web/test/mobile-overflow-guards.test.js index 9766e11..92d0333 100644 --- a/apps/web/test/mobile-overflow-guards.test.js +++ b/apps/web/test/mobile-overflow-guards.test.js @@ -3,22 +3,17 @@ import { readFileSync } from 'node:fs'; import { join } from 'node:path'; const appSource = readFileSync(join(import.meta.dir, '../src/App.tsx'), 'utf8'); -const jsonViewerSource = readFileSync( - join(import.meta.dir, '../src/components/json-viewer.tsx'), - 'utf8', -); describe('mobile overflow guards', () => { test('usage metrics cards allow long metric labels to wrap on mobile', () => { + expect(appSource).toContain('className="mt-6 min-w-0"'); expect(appSource).toContain('className="grid gap-3 sm:grid-cols-2"'); expect(appSource).toContain('className="min-w-0 rounded-2xl border border-white/10 bg-white/4 p-4"'); expect(appSource).toContain('className="text-sm text-slate-400 break-words"'); }); - test('merged payload viewer constrains JSON horizontally inside the card', () => { - expect(jsonViewerSource).toContain('className="min-w-0"'); - expect(jsonViewerSource).toContain('overflow-x-auto'); - expect(jsonViewerSource).toContain('whitespace-pre-wrap'); - expect(jsonViewerSource).toContain('break-all'); + test('connected account tabs no longer render a side-by-side payload column', () => { + expect(appSource).not.toContain('lg:grid-cols-[0.9fr_1.1fr]'); + expect(appSource).not.toContain('Account payload'); }); });