From d5c3e1858ecf1fe2186850fbb1150fa8b8ab2c51 Mon Sep 17 00:00:00 2001 From: Test Date: Fri, 3 Apr 2026 19:06:52 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20selected=20type=20section=20uses=20type?= =?UTF-8?q?=20color=20=E2=80=94=20filled=20icon,=20colored=20chip,=20tinte?= =?UTF-8?q?d=20bg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a type section is selected in the sidebar, the row now uses the type's accent color: light-tinted background, filled Phosphor icon, colored label text, and solid-color badge with white text. Matches the visual treatment of main sections (Inbox, All Notes). Types with no custom color fall back to the default muted palette. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/SidebarParts.tsx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/components/SidebarParts.tsx b/src/components/SidebarParts.tsx index a7e5e3a0..f4d4a194 100644 --- a/src/components/SidebarParts.tsx +++ b/src/components/SidebarParts.tsx @@ -1,7 +1,7 @@ import { type ComponentType, useState, useEffect, useRef } from 'react' import type { SidebarSelection } from '../types' import { cn } from '@/lib/utils' -import { getTypeColor } from '../utils/typeColors' +import { getTypeColor, getTypeLightColor } from '../utils/typeColors' import { type IconProps } from '@phosphor-icons/react' export interface SectionGroup { @@ -94,11 +94,13 @@ export function SectionContent({ }: SectionContentProps) { const { label, type, Icon, customColor } = group const sectionColor = getTypeColor(type, customColor) + const sectionLightColor = getTypeLightColor(type, customColor) return ( onSelect({ kind: 'sectionGroup', type })} @@ -142,9 +144,9 @@ function InlineRenameInput({ initialValue, onSubmit, onCancel }: { ) } -function SectionHeader({ label, type, Icon, sectionColor, itemCount, isActive, onSelect, onContextMenu, dragHandleProps, isRenaming, renameInitialValue, onRenameSubmit, onRenameCancel }: { +function SectionHeader({ label, type, Icon, sectionColor, sectionLightColor, itemCount, isActive, onSelect, onContextMenu, dragHandleProps, isRenaming, renameInitialValue, onRenameSubmit, onRenameCancel }: { label: string; type: string; Icon: ComponentType - sectionColor: string; itemCount: number; isActive: boolean + sectionColor: string; sectionLightColor: string; itemCount: number; isActive: boolean onSelect: () => void; onContextMenu: (e: React.MouseEvent) => void dragHandleProps?: Record isRenaming?: boolean; renameInitialValue?: string @@ -152,14 +154,14 @@ function SectionHeader({ label, type, Icon, sectionColor, itemCount, isActive, o }) { return (
{ if (!isRenaming) onSelect() }} onContextMenu={isRenaming ? undefined : onContextMenu} >
- + {isRenaming && onRenameSubmit && onRenameCancel ? ( ) : ( - {label} + {label} )}
{itemCount > 0 && ( - + {itemCount} )}