diff --git a/ui/src/pages/accounts.tsx b/ui/src/pages/accounts.tsx index 74d322a0..2e36ffe7 100644 --- a/ui/src/pages/accounts.tsx +++ b/ui/src/pages/accounts.tsx @@ -5,14 +5,87 @@ import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; -import { ArrowRight, Link2, Plus, Unlink, Users, Waves, Zap } from 'lucide-react'; +import { AlertTriangle, ArrowRight, Link2, Plus, Unlink, Users, Waves, Zap } from 'lucide-react'; import { AccountsTable } from '@/components/account/accounts-table'; import { CreateAuthProfileDialog } from '@/components/account/create-auth-profile-dialog'; +import { CopyButton } from '@/components/ui/copy-button'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { ScrollArea } from '@/components/ui/scroll-area'; import { useAccounts } from '@/hooks/use-accounts'; +import { cn } from '@/lib/utils'; +import type { LucideIcon } from 'lucide-react'; + +type MetricTone = 'default' | 'shared' | 'deeper' | 'isolated'; + +function MetricTile({ + label, + value, + icon: Icon, + tone = 'default', +}: { + label: string; + value: number; + icon: LucideIcon; + tone?: MetricTone; +}) { + const toneClasses: Record = { + default: { + border: 'border-border', + icon: 'text-primary', + }, + shared: { + border: 'border-emerald-300/60 dark:border-emerald-900/40', + icon: 'text-emerald-700 dark:text-emerald-400', + }, + deeper: { + border: 'border-indigo-300/60 dark:border-indigo-900/40', + icon: 'text-indigo-700 dark:text-indigo-400', + }, + isolated: { + border: 'border-blue-300/60 dark:border-blue-900/40', + icon: 'text-blue-700 dark:text-blue-400', + }, + }; + + return ( +
+
+ {label} + +
+

{value}

+
+ ); +} + +function StrategyCard({ + title, + description, + variant, +}: { + title: string; + description: string; + variant: 'auth' | 'pool'; +}) { + const variantClasses = + variant === 'auth' + ? 'border-emerald-300/70 bg-emerald-50/40 dark:border-emerald-900/40 dark:bg-emerald-900/10' + : 'border-blue-300/70 bg-blue-50/40 dark:border-blue-900/40 dark:bg-blue-900/10'; + const titleClasses = + variant === 'auth' + ? 'text-emerald-800 dark:text-emerald-300' + : 'text-blue-800 dark:text-blue-300'; + + return ( +
+

{title}

+

{description}

+
+ ); +} export function AccountsPage() { const navigate = useNavigate(); @@ -26,169 +99,278 @@ export function AccountsPage() { const sharedStandardCount = data?.sharedStandardCount || 0; const deeperSharedCount = data?.deeperSharedCount || 0; const isolatedCount = data?.isolatedCount || 0; + const hasLegacyFollowUp = legacyContextCount > 0 || legacyContinuityCount > 0; return ( -
-
-
-
- ccs auth Continuity -

Accounts

-

- This page manages - ccs auth - accounts only. Choose isolated, shared-standard, or shared-deeper continuity per - account. -

+ <> +
+ {/* Left rail */} +
+
+
+
+ +

Accounts

+
+

+ Dedicated + ccs auth + continuity controls. +

+
+ +
+ + +
-
- - + +
+
+

+ Snapshot +

+
+ + + + +
+
+ +
+

+ Strategy Lanes +

+ + +
+ + {hasLegacyFollowUp && ( +
+

+ Migration Follow-up +

+
+
+ +
+ {legacyContextCount > 0 && ( +

+ {legacyContextCount} account + {legacyContextCount > 1 ? 's still need' : ' still needs'} first-time + mode confirmation. +

+ )} + {legacyContinuityCount > 0 && ( +

+ {legacyContinuityCount} shared account + {legacyContinuityCount > 1 ? 's remain' : ' remains'} on standard legacy + continuity depth. +

+ )} +
+
+
+
+ )} +
+
+ +
+
+ Standard shared + {sharedStandardCount} +
+
+ CLIProxy hidden + {cliproxyCount} +
+
+
+ + {/* Main workspace */} +
+ {/* Table column */} +
+
+
+ ccs auth Workspace + History Sync Controls +
+

Auth Accounts

+

+ This table is intentionally scoped to + ccs auth + accounts. Edit each account for isolated, shared-standard, or shared-deeper + continuity behavior. +

+
+ +
+ {cliproxyCount > 0 && ( + + + CLIProxy pool accounts are managed in their own page + + {cliproxyCount} OAuth account{cliproxyCount > 1 ? 's are' : ' is'} available in + CLIProxy. This table only covers local + ccs auth + profiles. + + + )} + + + + Account Matrix + + Shared total: {sharedCount}. Update sync behavior from the pencil action in each + row. + + + + {isLoading ? ( +
Loading accounts...
+ ) : ( + + )} +
+
+
+
+ + {/* Right guidance column */} +
+
+

Continuity Guide

+

+ Choose the lightest mode that solves your workflow. +

+
+ + +
+ + + Shared Standard + Project workspace sync only. + + + Best default when users need continuity but want minimal coupling. + + + + + + Shared Deeper (Advanced) + + Adds session-env, file-history,{' '} + shell-snapshots, todos. + + + + Use only when cross-account continuity is worth stronger coupling. + + + + + + Quick Commands + Copy and run in terminal. + + +
+ + ccs auth create work --context-group sprint-a --deeper-continuity + + +
+
+ ccs cliproxy auth claude + +
+
+
+
+
-
- - - - Lane A: ccs auth continuity - - - - Profile isolation + opt-in sync - - - - Use this when you want per-account control over isolated vs shared history behavior. - - - - - - - Lane B: CLIProxy Claude pool - - - - OAuth pool and lower manual switching - - - - Use CLIProxy when you want pooled Claude OAuth accounts and easier account routing - behavior. - - -
- -
+ {/* Mobile fallback */} +
- - Total Auth Accounts - - - {authAccounts.length} - + + Accounts + + Manage + ccs auth + continuity per account. + + + + + - - - - Shared Standard - - - - {sharedStandardCount} - - - +
+ + + + +
- - - - Shared Deeper - - - - {deeperSharedCount} - - - - - - - - Isolated - - - - {isolatedCount} - + + + Account Matrix + + {isLoading ? ( +
Loading accounts...
+ ) : ( + + )} +
- {cliproxyCount > 0 && ( - - - CLIProxy accounts are intentionally excluded from this table - - {cliproxyCount} CLIProxy OAuth account{cliproxyCount > 1 ? 's are' : ' is'} available. - Manage them in CLIProxy Plus to enable account pool usage. - - - )} - - {legacyContextCount > 0 && ( - - - Legacy accounts need first-time sync mode review - - {legacyContextCount} account{legacyContextCount > 1 ? 's were' : ' was'} onboarded - before explicit context controls. Use the pencil action to confirm isolated or shared - behavior. - - - )} - - {legacyContinuityCount > 0 && ( - - - Shared legacy accounts default to standard continuity - - {legacyContinuityCount} shared account - {legacyContinuityCount > 1 ? 's are' : ' is'} currently on legacy standard depth. Edit - and switch to deeper continuity only when you intentionally want broader history sync. - - - )} - - - - ccs auth Accounts - - Shared total: {sharedCount}. Create accounts here, then tune per-account sync mode and - continuity depth from the table. - - - - {isLoading ? ( -
Loading accounts...
- ) : ( - - )} -
-
- setCreateDialogOpen(false)} /> -
+ ); }