From 348b028e2ae38a49ce74e4fdc3c2f50ae1666e35 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Tue, 17 Feb 2026 14:24:13 +0100 Subject: [PATCH] fix: use dynamic color-coding for active note states based on type --- src/components/Sidebar.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index ab9f7e3b..d371a580 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -50,6 +50,11 @@ export function Sidebar({ entries, selection, onSelect, onSelectNote, modifiedCo setCollapsed((prev) => ({ ...prev, [type]: !prev[type] })) } + const getSectionColor = (entry: VaultEntry) => { + const section = SECTION_GROUPS.find(s => s.type === entry.isA) + return section?.color || 'var(--foreground)' + } + const isActive = (sel: SidebarSelection): boolean => { if (selection.kind !== sel.kind) return false if (sel.kind === 'filter' && selection.kind === 'filter') return sel.filter === selection.filter @@ -207,8 +212,8 @@ export function Sidebar({ entries, selection, onSelect, onSelectNote, modifiedCo style={{ padding: '4px 16px 4px 28px', ...(isActive(isTopic ? { kind: 'topic', entry } : { kind: 'entity', entry }) && { - backgroundColor: 'var(--accent-red-light)', - color: 'var(--accent-red)', + backgroundColor: `${getSectionColor(entry).replace(')', '-light)')}`, + color: getSectionColor(entry), }), }} onClick={() => {