From 1826609215e8553db8d0da11de17d290f00057ca Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sun, 7 Jun 2026 18:01:45 -0700 Subject: [PATCH] Scope worktree sidebar under dedicated `--worktree-sidebar` color tokens (#4845) * Use a distinct background token for the worktree sidebar panel - Adds `--worktree-sidebar` and `--worktree-sidebar-foreground` CSS tokens (light: #f5f5f5, dark: #212121) so the sidebar can be visually lighter than the default `--sidebar` value - Applies `bg-worktree-sidebar` to the sidebar container * Lighten worktree sidebar and scope its color tokens under `--worktree-si - Dark mode panel lifted from `#212121` to `#2a2a2a` so it reads clearly above the `#0a0a0a` canvas. - Added `--worktree-sidebar-accent`, `--worktree-sidebar-border`, and `--worktree-sidebar-ring` tokens in both color schemes. - Migrated all sidebar components from shared `sidebar-*` tokens to the scoped `worktree-sidebar-*` tokens, preventing bleed when the two layers diverge. * Use worktree-sidebar tokens in settings sidebar instead of generic theme - Replaces `bg-accent`, `text-muted-foreground`, `border-border/50`, and `bg-card/40` with dedicated worktree-sidebar CSS custom properties - Enables independent styling of the settings sidebar separate from the main panel theme --- src/renderer/src/assets/main.css | 20 ++++++++++ .../components/settings/SettingsSidebar.tsx | 20 +++++----- .../ImportedWorktreesVisibilityLine.tsx | 18 ++++----- .../sidebar/SetupGuideSidebarEntry.tsx | 4 +- .../sidebar/SetupScriptPromptCard.tsx | 2 +- .../sidebar/SetupScriptPromptCardViews.tsx | 4 +- .../src/components/sidebar/SidebarNav.tsx | 40 ++++++++++++------- .../src/components/sidebar/SidebarToolbar.tsx | 2 +- .../WorkspaceKanbanAreaSelectionOverlay.tsx | 2 +- .../sidebar/WorkspaceKanbanCard.tsx | 2 +- .../sidebar/WorkspaceKanbanDrawer.tsx | 2 +- .../sidebar/WorkspaceKanbanDrawerHeader.tsx | 4 +- .../sidebar/WorkspaceKanbanPinDropTarget.tsx | 6 +-- .../sidebar/WorkspaceKanbanStatusLane.tsx | 12 +++--- .../src/components/sidebar/WorktreeCard.tsx | 14 ++++--- .../components/sidebar/WorktreeCardPorts.tsx | 2 +- .../src/components/sidebar/WorktreeList.tsx | 18 +++++---- .../sidebar/WorktreeTitleInlineRename.tsx | 2 +- src/renderer/src/components/sidebar/index.tsx | 8 ++-- .../sidebar/worktree-card-compact-agents.tsx | 16 ++++---- 20 files changed, 118 insertions(+), 80 deletions(-) diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index 557e9cda2..8e3892484 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -52,6 +52,12 @@ --color-chart-5: var(--chart-5); --color-sidebar: var(--sidebar); --color-sidebar-foreground: var(--sidebar-foreground); + --color-worktree-sidebar: var(--worktree-sidebar); + --color-worktree-sidebar-foreground: var(--worktree-sidebar-foreground); + --color-worktree-sidebar-accent: var(--worktree-sidebar-accent); + --color-worktree-sidebar-accent-foreground: var(--worktree-sidebar-accent-foreground); + --color-worktree-sidebar-border: var(--worktree-sidebar-border); + --color-worktree-sidebar-ring: var(--worktree-sidebar-ring); --color-sidebar-primary: var(--sidebar-primary); --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); --color-sidebar-accent: var(--sidebar-accent); @@ -137,6 +143,12 @@ --chart-3: var(--color-blue-600); --chart-4: var(--color-blue-700); --chart-5: var(--color-blue-800); + --worktree-sidebar: #f5f5f5; + --worktree-sidebar-foreground: #0a0a0a; + --worktree-sidebar-accent: #eaeaea; + --worktree-sidebar-accent-foreground: #171717; + --worktree-sidebar-border: #e5e5e5; + --worktree-sidebar-ring: #a1a1a1; --sidebar: #fafafa; --sidebar-foreground: #0a0a0a; --sidebar-primary: #171717; @@ -210,6 +222,14 @@ --chart-3: var(--color-blue-600); --chart-4: var(--color-blue-700); --chart-5: var(--color-blue-800); + /* Why: light mode sets worktree-sidebar to secondary (#f5f5f5); mirror that + lift in dark mode so the panel reads clearly above #0a0a0a canvas. */ + --worktree-sidebar: #2a2a2a; + --worktree-sidebar-foreground: #fafafa; + --worktree-sidebar-accent: #353535; + --worktree-sidebar-accent-foreground: #fafafa; + --worktree-sidebar-border: rgb(255 255 255 / 0.1); + --worktree-sidebar-ring: #737373; --sidebar: #171717; --sidebar-foreground: #fafafa; --sidebar-primary: #1447e6; diff --git a/src/renderer/src/components/settings/SettingsSidebar.tsx b/src/renderer/src/components/settings/SettingsSidebar.tsx index abfdf5211..0012cce65 100644 --- a/src/renderer/src/components/settings/SettingsSidebar.tsx +++ b/src/renderer/src/components/settings/SettingsSidebar.tsx @@ -85,10 +85,10 @@ function SettingsSetupGuideNavRow({ }) } className={cn( - 'flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50', + 'flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-worktree-sidebar-ring/50', setupActive - ? 'bg-accent font-medium text-accent-foreground' - : 'text-muted-foreground hover:bg-muted/60 hover:text-foreground' + ? 'bg-worktree-sidebar-accent font-medium text-worktree-sidebar-accent-foreground' + : 'text-worktree-sidebar-foreground/60 hover:bg-worktree-sidebar-foreground/8 hover:text-worktree-sidebar-foreground' )} > cn( - 'flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left text-[13px] outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50', + 'flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left text-[13px] outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-worktree-sidebar-ring/50', isActive - ? 'bg-accent font-medium text-accent-foreground' - : 'text-muted-foreground hover:bg-muted/60 hover:text-foreground' + ? 'bg-worktree-sidebar-accent font-medium text-worktree-sidebar-accent-foreground' + : 'text-worktree-sidebar-foreground/60 hover:bg-worktree-sidebar-foreground/8 hover:text-worktree-sidebar-foreground' ) const installStatusLabel = (status: SettingsNavInstallStatus): string => { switch (status) { @@ -156,8 +156,8 @@ export function SettingsSidebar({ ) return ( -