Drop translucent sidebar theme setting
- Remove sidebar translucency from theme contracts and presets - Always render the sidebar opaque in the web app
This commit is contained in:
1 parent
adeed26289
commit
88cb025815
9 files changed
+21
-71
No files matched your search
@@ -203,7 +203,6 @@ it.layer(NodeServices.layer)("server settings", (it) => {
|
||||
foreground: "#0d0d0d",
|
||||
uiFontFamily: '"IBM Plex Sans", sans-serif',
|
||||
codeFontFamily: '"IBM Plex Mono", monospace',
|
||||
sidebarTranslucent: true,
|
||||
contrast: 46,
|
||||
},
|
||||
{
|
||||
@@ -219,7 +218,6 @@ it.layer(NodeServices.layer)("server settings", (it) => {
|
||||
foreground: "#fcfcfc",
|
||||
uiFontFamily: '"IBM Plex Sans", sans-serif',
|
||||
codeFontFamily: '"IBM Plex Mono", monospace',
|
||||
sidebarTranslucent: true,
|
||||
contrast: 41,
|
||||
},
|
||||
],
|
||||
@@ -247,7 +245,6 @@ it.layer(NodeServices.layer)("server settings", (it) => {
|
||||
foreground: "#0d0d0d",
|
||||
uiFontFamily: '"IBM Plex Sans", sans-serif',
|
||||
codeFontFamily: '"IBM Plex Mono", monospace',
|
||||
sidebarTranslucent: true,
|
||||
contrast: 46,
|
||||
},
|
||||
{
|
||||
@@ -263,7 +260,6 @@ it.layer(NodeServices.layer)("server settings", (it) => {
|
||||
foreground: "#fcfcfc",
|
||||
uiFontFamily: '"IBM Plex Sans", sans-serif',
|
||||
codeFontFamily: '"IBM Plex Mono", monospace',
|
||||
sidebarTranslucent: true,
|
||||
contrast: 41,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -31,7 +31,6 @@ import { toastManager } from "../ui/toast";
|
||||
import { Button } from "../ui/button";
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible";
|
||||
import { Input } from "../ui/input";
|
||||
import { Switch } from "../ui/switch";
|
||||
import { SettingsPageContainer, SettingsSection } from "./SettingsPanels";
|
||||
import {
|
||||
createDuplicateTheme,
|
||||
@@ -246,36 +245,25 @@ function ThemeEditor({
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{/* Contrast + translucent sidebar */}
|
||||
<div className="flex flex-wrap items-center gap-x-6 gap-y-3">
|
||||
<label className="flex min-w-0 flex-1 items-center gap-3">
|
||||
<span className="text-[11px] font-medium text-muted-foreground">Contrast</span>
|
||||
<input
|
||||
type="range"
|
||||
min={0}
|
||||
max={100}
|
||||
step={1}
|
||||
value={theme.contrast}
|
||||
onChange={(event) =>
|
||||
onChange((currentTheme) => ({
|
||||
...currentTheme,
|
||||
contrast: Number.parseInt(event.target.value, 10),
|
||||
}))
|
||||
}
|
||||
className="h-1.5 min-w-24 flex-1 cursor-pointer accent-primary"
|
||||
/>
|
||||
<code className="text-[11px] tabular-nums text-muted-foreground">{theme.contrast}</code>
|
||||
</label>
|
||||
<label className="flex items-center gap-2">
|
||||
<Switch
|
||||
checked={theme.sidebarTranslucent}
|
||||
onCheckedChange={(checked) =>
|
||||
onChange((currentTheme) => ({ ...currentTheme, sidebarTranslucent: checked }))
|
||||
}
|
||||
/>
|
||||
<span className="text-[11px] font-medium text-muted-foreground">Translucent sidebar</span>
|
||||
</label>
|
||||
</div>
|
||||
{/* Contrast */}
|
||||
<label className="flex items-center gap-3">
|
||||
<span className="text-[11px] font-medium text-muted-foreground">Contrast</span>
|
||||
<input
|
||||
type="range"
|
||||
min={0}
|
||||
max={100}
|
||||
step={1}
|
||||
value={theme.contrast}
|
||||
onChange={(event) =>
|
||||
onChange((currentTheme) => ({
|
||||
...currentTheme,
|
||||
contrast: Number.parseInt(event.target.value, 10),
|
||||
}))
|
||||
}
|
||||
className="h-1.5 min-w-24 flex-1 cursor-pointer accent-primary"
|
||||
/>
|
||||
<code className="text-[11px] tabular-nums text-muted-foreground">{theme.contrast}</code>
|
||||
</label>
|
||||
|
||||
{/* Advanced overrides */}
|
||||
<Collapsible defaultOpen={false}>
|
||||
|
||||
@@ -34,7 +34,6 @@ describe("parseAppearanceCache", () => {
|
||||
foreground: "#0d0d0d",
|
||||
uiFontFamily: '"IBM Plex Sans", sans-serif',
|
||||
codeFontFamily: '"IBM Plex Mono", monospace',
|
||||
sidebarTranslucent: true,
|
||||
contrast: 46,
|
||||
},
|
||||
{
|
||||
@@ -50,7 +49,6 @@ describe("parseAppearanceCache", () => {
|
||||
foreground: "#fcfcfc",
|
||||
uiFontFamily: '"IBM Plex Sans", sans-serif',
|
||||
codeFontFamily: '"IBM Plex Mono", monospace',
|
||||
sidebarTranslucent: true,
|
||||
contrast: 41,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -79,7 +79,6 @@ function applyResolvedAppearance(
|
||||
|
||||
root.classList.toggle("dark", resolvedTheme === "dark");
|
||||
root.style.colorScheme = resolvedTheme;
|
||||
root.dataset.sidebarTranslucent = String(themeDocument.sidebarTranslucent);
|
||||
applyThemeDocumentStyles(root.style, themeDocument);
|
||||
|
||||
clearThemeCssVariables(root.style, appliedVariableNames);
|
||||
|
||||
@@ -125,10 +125,6 @@ input {
|
||||
);
|
||||
}
|
||||
|
||||
html[data-sidebar-translucent="true"] [data-sidebar="sidebar"] {
|
||||
backdrop-filter: blur(var(--sidebar-blur, 0px));
|
||||
}
|
||||
|
||||
/* Window drag region (frameless titlebar) */
|
||||
.drag-region {
|
||||
-webkit-app-region: drag;
|
||||
|
||||
@@ -198,14 +198,6 @@ export const ThemeVariantSchema = Schema.Struct({
|
||||
title: "Code font family",
|
||||
description: "Font family used for code, terminal, and monospace surfaces.",
|
||||
}),
|
||||
sidebarTranslucent: Schema.Boolean.annotate({
|
||||
title: "Translucent sidebar",
|
||||
description: "Whether the sidebar should render with translucency.",
|
||||
examples: [true, false],
|
||||
}).annotateKey({
|
||||
title: "Translucent sidebar",
|
||||
description: "Whether the sidebar should render with translucency.",
|
||||
}),
|
||||
contrast: ThemeContrast.annotateKey({
|
||||
title: "Contrast",
|
||||
description: "A normalized contrast modifier from 0 to 100.",
|
||||
@@ -305,7 +297,6 @@ export const ThemeDocumentSchema = Schema.Struct({
|
||||
foreground: "#0d0d0d",
|
||||
uiFontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
||||
codeFontFamily: '"SF Mono", Menlo, monospace',
|
||||
sidebarTranslucent: true,
|
||||
contrast: 46,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -24,7 +24,6 @@ describe("ThemeDocumentSchema", () => {
|
||||
foreground: "#0d0d0d",
|
||||
uiFontFamily: '"IBM Plex Sans", sans-serif',
|
||||
codeFontFamily: '"IBM Plex Mono", monospace',
|
||||
sidebarTranslucent: true,
|
||||
contrast: 44,
|
||||
overrides: {
|
||||
diffAddition: "#0969da",
|
||||
@@ -51,7 +50,6 @@ describe("ThemeDocumentSchema", () => {
|
||||
foreground: "#0d0d0d",
|
||||
uiFontFamily: "sans-serif",
|
||||
codeFontFamily: "monospace",
|
||||
sidebarTranslucent: false,
|
||||
contrast: 40,
|
||||
}),
|
||||
).toThrow();
|
||||
@@ -77,7 +75,6 @@ describe("ServerSettingsPatch", () => {
|
||||
foreground: "#0d0d0d",
|
||||
uiFontFamily: '"IBM Plex Sans", sans-serif',
|
||||
codeFontFamily: '"IBM Plex Mono", monospace',
|
||||
sidebarTranslucent: false,
|
||||
contrast: 38,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -284,16 +284,14 @@ export function deriveThemeTokens(themeVariant: ThemeVariant): ThemeTokenMap {
|
||||
"warning-foreground": warningForeground,
|
||||
"diff-addition": statusPalette.success,
|
||||
"diff-deletion": statusPalette.destructive,
|
||||
sidebar: themeVariant.sidebarTranslucent
|
||||
? withAlpha(sidebarBase, isDark ? 0.84 : 0.94)
|
||||
: sidebarBase,
|
||||
sidebar: sidebarBase,
|
||||
"sidebar-foreground": themeVariant.foreground,
|
||||
"sidebar-accent": mixColors(sidebarBase, themeVariant.accent, 0.16 + contrastFactor * 0.1),
|
||||
"sidebar-accent-foreground": accentForeground,
|
||||
"sidebar-border": border,
|
||||
"ui-font-family": themeVariant.uiFontFamily,
|
||||
"code-font-family": themeVariant.codeFontFamily,
|
||||
"sidebar-blur": themeVariant.sidebarTranslucent ? "18px" : "0px",
|
||||
"sidebar-blur": "0px",
|
||||
};
|
||||
|
||||
if (themeVariant.overrides) {
|
||||
|
||||
@@ -30,7 +30,6 @@ type ThemeDocumentInput = {
|
||||
foreground: string;
|
||||
uiFontFamily: string;
|
||||
codeFontFamily: string;
|
||||
sidebarTranslucent: boolean;
|
||||
contrast: number;
|
||||
overrides?: ThemeDocument["overrides"];
|
||||
};
|
||||
@@ -51,7 +50,6 @@ function makeThemeDocument(input: ThemeDocumentInput): BuiltinThemePreset {
|
||||
foreground: input.foreground,
|
||||
uiFontFamily: input.uiFontFamily,
|
||||
codeFontFamily: input.codeFontFamily,
|
||||
sidebarTranslucent: input.sidebarTranslucent,
|
||||
contrast: input.contrast,
|
||||
...(input.overrides ? { overrides: input.overrides } : {}),
|
||||
},
|
||||
@@ -69,7 +67,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#262626",
|
||||
uiFontFamily: DEFAULT_UI_FONT,
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: false,
|
||||
contrast: 46,
|
||||
overrides: {
|
||||
background: "#fff",
|
||||
@@ -114,7 +111,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#f5f5f5",
|
||||
uiFontFamily: DEFAULT_UI_FONT,
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: false,
|
||||
contrast: 41,
|
||||
overrides: {
|
||||
background: "color-mix(in srgb, oklch(14.5% 0 0) 95%, #fff)",
|
||||
@@ -159,7 +155,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#201814",
|
||||
uiFontFamily: '"Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif',
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: false,
|
||||
contrast: 56,
|
||||
}),
|
||||
makeThemeDocument({
|
||||
@@ -172,7 +167,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#f5ede6",
|
||||
uiFontFamily: '"Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif',
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: true,
|
||||
contrast: 52,
|
||||
}),
|
||||
makeThemeDocument({
|
||||
@@ -185,7 +179,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#11232b",
|
||||
uiFontFamily: '"Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif',
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: true,
|
||||
contrast: 40,
|
||||
}),
|
||||
makeThemeDocument({
|
||||
@@ -198,7 +191,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#ebfbff",
|
||||
uiFontFamily: '"Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif',
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: true,
|
||||
contrast: 48,
|
||||
}),
|
||||
makeThemeDocument({
|
||||
@@ -211,7 +203,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#121212",
|
||||
uiFontFamily: '"Charter", "Bitstream Charter", "Sitka Text", Cambria, serif',
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: false,
|
||||
contrast: 64,
|
||||
}),
|
||||
makeThemeDocument({
|
||||
@@ -224,7 +215,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#f7f4ef",
|
||||
uiFontFamily: '"Charter", "Bitstream Charter", "Sitka Text", Cambria, serif',
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: false,
|
||||
contrast: 58,
|
||||
}),
|
||||
makeThemeDocument({
|
||||
@@ -237,7 +227,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#101828",
|
||||
uiFontFamily: DEFAULT_UI_FONT,
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: false,
|
||||
contrast: 68,
|
||||
overrides: {
|
||||
diffAddition: "#0969da",
|
||||
@@ -254,7 +243,6 @@ export const BUILTIN_THEME_PRESETS: readonly BuiltinThemePreset[] = [
|
||||
foreground: "#f0f6fc",
|
||||
uiFontFamily: DEFAULT_UI_FONT,
|
||||
codeFontFamily: DEFAULT_CODE_FONT,
|
||||
sidebarTranslucent: false,
|
||||
contrast: 64,
|
||||
overrides: {
|
||||
diffAddition: "#388bfd",
|
||||
@@ -330,7 +318,6 @@ export function canonicalizeThemeDocument(
|
||||
foreground: themeDocument.foreground,
|
||||
uiFontFamily: themeDocument.uiFontFamily,
|
||||
codeFontFamily: themeDocument.codeFontFamily,
|
||||
sidebarTranslucent: themeDocument.sidebarTranslucent,
|
||||
contrast: themeDocument.contrast,
|
||||
...(overrides ? { overrides } : {}),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user