mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
- 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).
31 lines
822 B
TypeScript
31 lines
822 B
TypeScript
interface DiffStatsProps {
|
|
additions: number
|
|
deletions: number
|
|
variant?: 'default' | 'compact'
|
|
}
|
|
|
|
export function DiffStats({ additions, deletions, variant = 'default' }: DiffStatsProps) {
|
|
if (additions === 0 && deletions === 0) {
|
|
return null
|
|
}
|
|
|
|
const compact = variant === 'compact'
|
|
|
|
return (
|
|
<span className="flex items-center gap-1 text-xs font-mono">
|
|
{additions > 0 && (
|
|
<span className="text-diff-add">
|
|
{compact ? `+${additions}` : `+${additions}`}
|
|
</span>
|
|
)}
|
|
{additions > 0 && deletions > 0 && (
|
|
<span className="text-muted-foreground">{compact ? '/' : ' '}</span>
|
|
)}
|
|
{deletions > 0 && (
|
|
<span className="text-diff-delete">
|
|
{compact ? `-${deletions}` : `-${deletions}`}
|
|
</span>
|
|
)}
|
|
</span>
|
|
)
|
|
} |