mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
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).
This commit is contained in:
1 parent
702e3c4e13
commit
5bd688de4b
116 files changed
+2702
-760
No files matched your search
@@ -93,25 +93,25 @@ const statusConfig: Record<
|
||||
modified: {
|
||||
icon: FileEdit,
|
||||
color: GIT_STATUS_COLORS.modified,
|
||||
bgColor: "bg-amber-500/10",
|
||||
bgColor: "bg-warning/10",
|
||||
label: GIT_STATUS_LABELS.modified,
|
||||
},
|
||||
added: {
|
||||
icon: FilePlus,
|
||||
color: GIT_STATUS_COLORS.added,
|
||||
bgColor: "bg-emerald-500/10",
|
||||
bgColor: "bg-success/10",
|
||||
label: GIT_STATUS_LABELS.added,
|
||||
},
|
||||
deleted: {
|
||||
icon: FileX,
|
||||
color: GIT_STATUS_COLORS.deleted,
|
||||
bgColor: "bg-rose-500/10",
|
||||
bgColor: "bg-destructive/10",
|
||||
label: GIT_STATUS_LABELS.deleted,
|
||||
},
|
||||
renamed: {
|
||||
icon: FileText,
|
||||
color: GIT_STATUS_COLORS.renamed,
|
||||
bgColor: "bg-blue-500/10",
|
||||
bgColor: "bg-info/10",
|
||||
label: GIT_STATUS_LABELS.renamed,
|
||||
},
|
||||
untracked: {
|
||||
@@ -123,7 +123,7 @@ const statusConfig: Record<
|
||||
copied: {
|
||||
icon: FileText,
|
||||
color: GIT_STATUS_COLORS.copied,
|
||||
bgColor: "bg-emerald-500/10",
|
||||
bgColor: "bg-success/10",
|
||||
label: GIT_STATUS_LABELS.copied,
|
||||
},
|
||||
};
|
||||
@@ -155,16 +155,16 @@ function DiffLineComponent({
|
||||
|
||||
const bgClass =
|
||||
line.type === "add"
|
||||
? "bg-emerald-500/10"
|
||||
? "bg-diff-add/10"
|
||||
: line.type === "remove"
|
||||
? "bg-rose-500/10"
|
||||
? "bg-diff-delete/10"
|
||||
: "";
|
||||
|
||||
const textClass =
|
||||
line.type === "add"
|
||||
? "text-emerald-700 dark:text-emerald-300"
|
||||
? "text-diff-add"
|
||||
: line.type === "remove"
|
||||
? "text-rose-700 dark:text-rose-300"
|
||||
? "text-diff-delete"
|
||||
: "text-foreground";
|
||||
|
||||
const lineNumber = line.newLineNumber ?? line.oldLineNumber;
|
||||
@@ -175,8 +175,8 @@ function DiffLineComponent({
|
||||
className={cn(
|
||||
"flex font-mono text-sm border-l-2 transition-colors min-w-0",
|
||||
bgClass,
|
||||
line.type === "add" && "border-l-emerald-500",
|
||||
line.type === "remove" && "border-l-rose-500",
|
||||
line.type === "add" && "border-l-diff-add",
|
||||
line.type === "remove" && "border-l-diff-delete",
|
||||
line.type === "context" && "border-l-transparent",
|
||||
isClickable && "cursor-pointer hover:bg-accent/30",
|
||||
)}
|
||||
@@ -196,10 +196,10 @@ function DiffLineComponent({
|
||||
)}
|
||||
<div className="w-6 flex-shrink-0 flex items-center justify-center bg-muted/20">
|
||||
{line.type === "add" && (
|
||||
<Plus className="w-3 h-3 text-emerald-600 dark:text-emerald-400" />
|
||||
<Plus className="w-3 h-3 text-diff-add" />
|
||||
)}
|
||||
{line.type === "remove" && (
|
||||
<Minus className="w-3 h-3 text-rose-600 dark:text-rose-400" />
|
||||
<Minus className="w-3 h-3 text-diff-delete" />
|
||||
)}
|
||||
</div>
|
||||
<pre
|
||||
@@ -325,8 +325,8 @@ export function FileDiffView({
|
||||
</span>
|
||||
{!diffData.isBinary && (
|
||||
<>
|
||||
<span className="text-green-500">+{diffData.additions}</span>
|
||||
<span className="text-red-500">-{diffData.deletions}</span>
|
||||
<span className="text-diff-add">+{diffData.additions}</span>
|
||||
<span className="text-diff-delete">-{diffData.deletions}</span>
|
||||
</>
|
||||
)}
|
||||
{diffData.diff && (
|
||||
|
||||
Reference in new issue
Block a user