Files
opencode-manager/frontend/src/components/message/MessageSkeleton.tsx
T
Chris Scott 5bd688de4b feat(themes): apply OpenCode color themes app-wide with a settings picker (#364)
- Vendor the 36 OpenCode theme palettes into the shared package, synced
  from the pinned OpenCode release tag via pnpm themes:sync.
- Add a colorTheme user preference across the settings schema, defaults,
  and the assistant internal API.
- Extend palettes with success, warning, info, and diff colors, and add a
  resolver that maps palettes to CSS tokens and applies them to the DOM.
- Apply the theme app-wide through a ThemeProvider context, adopting the
  tokens in message, repo, session, and settings components, agent
  colors, git status styles, and diff viewers.
- Add a theme picker to General settings and make model quick-select
  follow the active theme (fixes #355).
2026-09-28 00:19:32 -04:00

104 lines
4.4 KiB
TypeScript

export function MessageSkeleton() {
return (
<div className="flex flex-col space-y-2 p-2 overflow-x-hidden">
{/* User message skeleton */}
<div className="flex flex-col">
<div className="w-full rounded-lg p-1.5 bg-primary/20 border border-primary/30">
<div className="flex items-center gap-2 mb-1">
<div className="h-3 w-12 bg-muted animate-pulse rounded" />
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
</div>
<div className="space-y-2">
<div className="h-4 bg-muted animate-pulse rounded w-3/4" />
<div className="h-4 bg-muted animate-pulse rounded w-1/2" />
</div>
</div>
</div>
{/* Assistant message skeleton */}
<div className="flex flex-col">
<div className="w-full rounded-lg p-1.5 bg-card/50 border border-border">
<div className="flex items-center gap-2 mb-1">
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
<div className="flex items-center gap-1">
<div className="h-3 w-20 bg-primary/20 animate-pulse rounded" />
</div>
</div>
<div className="space-y-2">
<div className="h-4 bg-muted animate-pulse rounded w-full" />
<div className="h-4 bg-muted animate-pulse rounded w-5/6" />
<div className="h-4 bg-muted animate-pulse rounded w-2/3" />
<div className="h-20 bg-muted/50 animate-pulse rounded mt-3" />
</div>
</div>
</div>
<div className="flex flex-col">
<div className="w-full rounded-lg p-1.5 bg-primary/20 border border-primary/30">
<div className="flex items-center gap-2 mb-1">
<div className="h-3 w-12 bg-muted animate-pulse rounded" />
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
</div>
<div className="space-y-2">
<div className="h-4 bg-muted animate-pulse rounded w-3/4" />
<div className="h-4 bg-muted animate-pulse rounded w-1/2" />
</div>
</div>
</div>
{/* Assistant message skeleton */}
<div className="flex flex-col">
<div className="w-full rounded-lg p-1.5 bg-card/50 border border-border">
<div className="flex items-center gap-2 mb-1">
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
<div className="flex items-center gap-1">
<div className="h-3 w-20 bg-primary/20 animate-pulse rounded" />
</div>
</div>
<div className="space-y-2">
<div className="h-4 bg-muted animate-pulse rounded w-full" />
<div className="h-4 bg-muted animate-pulse rounded w-5/6" />
<div className="h-4 bg-muted animate-pulse rounded w-2/3" />
<div className="h-20 bg-muted/50 animate-pulse rounded mt-3" />
</div>
</div>
</div>
{/* Second user message skeleton */}
<div className="flex flex-col">
<div className="w-full rounded-lg p-1.5 bg-primary/20 border border-primary/30">
<div className="flex items-center gap-2 mb-1">
<div className="h-3 w-12 bg-muted animate-pulse rounded" />
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
</div>
<div className="space-y-2">
<div className="h-4 bg-muted animate-pulse rounded w-4/5" />
</div>
</div>
</div>
{/* Loading assistant message */}
<div className="flex flex-col">
<div className="w-full rounded-lg p-1.5 bg-card/50 border border-border animate-pulse-subtle">
<div className="flex items-center gap-2 mb-1">
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
<div className="flex items-center gap-1">
<span className="animate-pulse">●</span>
<div className="h-3 w-24 bg-primary/20 animate-pulse rounded" />
</div>
</div>
<div className="flex items-center gap-2 text-muted-foreground">
<span className="animate-pulse">▋</span>
<div className="h-4 w-20 bg-muted animate-pulse rounded" />
</div>
</div>
</div>
</div>
);
}