From 144e417d9c6c425dd2083b747ad8b7396da62b64 Mon Sep 17 00:00:00 2001 From: Zbigniew Sobiecki Date: Sat, 18 Apr 2026 20:11:58 +0000 Subject: [PATCH 1/5] feat(ui): add color swatch to ComboboxOption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optional `swatch` field on ComboboxOption. When set, the Combobox renders a 12×12 rounded dot before the label in both the trigger (selected value) and every option row in the dropdown. Accepts any CSS color value — hex/rgb/named. Additive; existing callers that don't set `swatch` are unchanged. PM wizard label picker (next commit) uses this so operators can distinguish `cascade-*` labels at a glance. Co-Authored-By: Claude Opus 4 (1M context) --- web/src/components/ui/combobox.tsx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/web/src/components/ui/combobox.tsx b/web/src/components/ui/combobox.tsx index 787fccb6..8883a9d2 100644 --- a/web/src/components/ui/combobox.tsx +++ b/web/src/components/ui/combobox.tsx @@ -12,6 +12,12 @@ export interface ComboboxOption { detail?: string; /** Optional group for organizing options */ group?: string; + /** + * Optional color swatch shown as an 8x8 rounded dot before the label. + * Any CSS color (hex, rgb(), named) works. Used by the PM-wizard label + * pickers so operators can tell `cascade-*` labels apart at a glance. + */ + swatch?: string; } interface ComboboxProps { @@ -85,8 +91,17 @@ export function Combobox({ disabled={disabled} className={cn('w-full justify-between font-normal', className)} > - - {displayValue || {emptyLabel}} + + {selectedOption?.swatch && ( + @@ -137,6 +152,13 @@ export function Combobox({ value === option.value ? 'opacity-100' : 'opacity-0', )} /> + {option.swatch && ( +