Fix #325: label color picker #335

Merged
crueber merged 1 commit from fix/issue-325 into main 2026-09-11 16:27:06 +00:00
Owner

Closes #325.

Replaces the bare 6-hex input on the /:o/:r/labels create form with a LabelColorPicker (web/src/components/, reusable by a future edit flow): trigger button (current-color swatch + hex, .input styling) opens a preset popover of 8 swatches (LABEL_COLOR_PRESETS in web/src/lib/label-colors.js — classic GitHub hues, d73a4a first preserving the form default) plus a Custom hex… row revealing the pattern-validated free-text input. Live preview dot beside the input reuses the exact list-row swatch rendering (neutral while invalid). Presets fill the same parent color signal; submit posts the resolved 6-hex unchanged — no backend change, no new deps, no new CSS (reuses audited .label-drop panel: opaque + 390px viewport-bound per #278). Keyboard: native buttons, outside-click/Esc close with onCleanup (LabelPicker/RefPicker idioms); dark+light share the treatment. Docs decision appended in docs/features/02_issues.md (law 12).

Tests: new web/test/unit/label-colors.test.js (10 tests: palette count/validity/uniqueness, validation matrix, preset matching, picker wiring/preview/idioms/no-backend guards) — 630/630 non-smoke tests pass repo-wide; vite build + SDK bundle green.

Open (explicit): browser proof — shared obscura daemon blocks loopback targets and no private daemon per workspace rules, so no live-Chrome pass; smoke.test.js cancels identically on clean main (node fetch cannot reach loopback in this sandbox, pre-existing). Real-browser check requested on review.

Closes #325. Replaces the bare 6-hex input on the `/:o/:r/labels` create form with a `LabelColorPicker` (`web/src/components/`, reusable by a future edit flow): trigger button (current-color swatch + hex, `.input` styling) opens a preset popover of 8 swatches (`LABEL_COLOR_PRESETS` in `web/src/lib/label-colors.js` — classic GitHub hues, `d73a4a` first preserving the form default) plus a Custom hex… row revealing the pattern-validated free-text input. Live preview dot beside the input reuses the exact list-row swatch rendering (neutral while invalid). Presets fill the same parent color signal; submit posts the resolved 6-hex unchanged — no backend change, no new deps, no new CSS (reuses audited `.label-drop` panel: opaque + 390px viewport-bound per #278). Keyboard: native buttons, outside-click/Esc close with onCleanup (LabelPicker/RefPicker idioms); dark+light share the treatment. Docs decision appended in `docs/features/02_issues.md` (law 12). Tests: new `web/test/unit/label-colors.test.js` (10 tests: palette count/validity/uniqueness, validation matrix, preset matching, picker wiring/preview/idioms/no-backend guards) — 630/630 non-smoke tests pass repo-wide; `vite build` + SDK bundle green. Open (explicit): browser proof — shared obscura daemon blocks loopback targets and no private daemon per workspace rules, so no live-Chrome pass; smoke.test.js cancels identically on clean main (node fetch cannot reach loopback in this sandbox, pre-existing). Real-browser check requested on review.
Labels create form color field becomes LabelColorPicker
(02 Decisions): preset popover from LABEL_COLOR_PRESETS
(web/src/lib/label-colors.js, node --test), Custom hex reveal with
pattern validation kept, live preview reusing the list-row swatch
rendering. No backend change; no new deps; no new CSS (.label-drop
reuse keeps the #278 opaque + 390px bounds).
Sign in to join this conversation.
No description provided.