labels: per-label color
CI & Build / Python lint (push) Successful in 3s
CI & Build / TypeScript typecheck (push) Successful in 8s
CI & Build / Python tests (push) Successful in 10s
CI & Build / Build & push image (push) Successful in 32s

Give labels a color (migration 0011 adds labels.color, server_default
'default' so existing labels keep the neutral chip). The PATCH endpoint now
updates name and/or color; note serialization carries each label's color.
Frontend: a swatch picker per label in the Edit-labels modal, colored chips
on cards + in the editor (LABEL_CHIP_CLASSES), and a color dot on each
sidebar label. Reuses the note color vocabulary. (Graph node coloring rides
this in the graph-liveliness task.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FRgehjoz7Yv8LkUfADxACm
This commit is contained in:
2026-07-20 13:11:50 -04:00
co-authored by Claude Opus 4.8
parent f3145a5e3f
commit f321c2bf70
11 changed files with 133 additions and 22 deletions
+14
View File
@@ -43,6 +43,20 @@ export const NOTE_SWATCH_CLASSES: Record<NoteColor, string> = {
gray: "bg-neutral-400 dark:bg-neutral-500",
};
// Label chip tints (bg + readable text), keyed by the same color vocabulary.
export const LABEL_CHIP_CLASSES: Record<NoteColor, string> = {
default: "bg-black/5 text-neutral-600 dark:bg-white/10 dark:text-neutral-300",
red: "bg-red-100 text-red-700 dark:bg-red-950/50 dark:text-red-300",
orange: "bg-orange-100 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300",
yellow: "bg-amber-100 text-amber-800 dark:bg-amber-950/50 dark:text-amber-300",
green: "bg-green-100 text-green-700 dark:bg-green-950/50 dark:text-green-300",
teal: "bg-teal-100 text-teal-700 dark:bg-teal-950/50 dark:text-teal-300",
blue: "bg-blue-100 text-blue-700 dark:bg-blue-950/50 dark:text-blue-300",
purple: "bg-purple-100 text-purple-700 dark:bg-purple-950/50 dark:text-purple-300",
pink: "bg-pink-100 text-pink-700 dark:bg-pink-950/50 dark:text-pink-300",
gray: "bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-200",
};
export const NOTE_COLOR_LABELS: Record<NoteColor, string> = {
default: "Default",
red: "Red",