From 0f7eefe5747bc4df579d8f9d972ecf9fcd5c785c Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Mon, 19 Jan 2026 13:53:29 +0200 Subject: [PATCH] refactor(vscode): simplify accent color derivation --- packages/ui/src/lib/theme/vscode/adapter.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/ui/src/lib/theme/vscode/adapter.ts b/packages/ui/src/lib/theme/vscode/adapter.ts index d3f0c006..ec8fc370 100644 --- a/packages/ui/src/lib/theme/vscode/adapter.ts +++ b/packages/ui/src/lib/theme/vscode/adapter.ts @@ -212,14 +212,8 @@ export const buildVSCodeThemeFromPalette = (palette: VSCodeThemePalette): Theme // This makes inactive tabs and secondary text clearly distinguishable from active/primary text const rawMutedFg = read('descriptionForeground', base.colors.surface.mutedForeground); const mutedFg = applyAlpha(rawMutedFg, palette.kind === 'light' ? 0.55 : 0.5); - // Prefer VS Code's "added diff" color as our primary accent when available (users expect this to match their theme). - const diffInserted = palette.colors['diffEditor.insertedTextBorder'] - ?? palette.colors['diffEditor.insertedLineBackground'] - ?? palette.colors['diffEditor.insertedTextBackground'] - ?? palette.colors['gitDecoration.addedResourceForeground']; - const accent = diffInserted - ? forceOpaque(diffInserted) - : read('button.background', read('textLink.foreground', base.colors.primary.base)); + // Prefer stable UI colors for accent to avoid theme-specific diff values. + const accent = read('button.background', read('textLink.foreground', base.colors.primary.base)); const accentFg = read('button.foreground', base.colors.primary.foreground || base.colors.surface.background); const hoverBg = read('list.hoverBackground', read('editor.selectionBackground', base.colors.interactive.hover)); const activeBg = read('list.activeSelectionBackground', hoverBg); @@ -239,9 +233,7 @@ export const buildVSCodeThemeFromPalette = (palette: VSCodeThemePalette): Theme const badgeBg = read('badge.background', accent); const badgeFg = read('badge.foreground', foreground); - const success = diffInserted - ? forceOpaque(diffInserted) - : read('testing.iconPassed', base.colors.status.success); + const success = read('testing.iconPassed', base.colors.status.success); const successBg = applyAlpha(success, palette.kind === 'light' ? 0.12 : 0.16); const successBorder = applyAlpha(success, palette.kind === 'light' ? 0.35 : 0.45);