Label create form: color dropdown with preset swatches (5-10) + custom hex with live preview #325
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#325
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
On the label create form (and any label color input), replace the raw 6-hex text input with a color dropdown: 5–10 preset swatches to choose from, plus an option to specify a custom hex value. When the hex field holds a valid 6-hex value, show a live color preview next to it.
Current state (code evidence)
web/src/pages/Labels.jsxcreate form (:69-99): the color field is a bare text input —class="input w-28",pattern="[0-9a-fA-F]{6}",title="6-hex RGB without #", defaulting tod73a4a. No visual feedback until the label is created and rendered in the list.:43-47— inlinebackground-color: #<color>dot), so a preview can reuse the exact same rendering.getColor()seeded"d73a4a"; label creation posts{name, color}throughlabels.create— no backend change needed.LabelChip, milestones page) consumes the same{name, color}shape — color values are unconstrained strings server-side, validated client-side only by this pattern attribute.Proposed design
web/src/lib/(headless, per convention) of 8 label-friendly colors — balanced across semantic families so the chooser covers bug/idea/question/wontfix-ish hues without implying the GitHub label names:e.g.
d73a4a(red),e36209(orange),f9d0c4→ better saturated set:d73a4a,e36209,fbca04(yellow),0e8a16(green),1d76db(blue),5319e7(purple),d876e3(magenta),3a3a3a(gray-ish). (These are the classic GitHub label palette hues — familiar and proven legible on both themes; final swatch list is the implementer's, but 8 is the target count.)<select>-style control (match the app's filter-select styling,Issues.jsx:96) or a small popover swatch grid (the repo has established popover patterns —RefPicker/ChooserMenuin CommentComposer) — implementer's call, but it must include:patternvalidation kept,:43-47) that shows the color when the value is a valid 6-hex (regex^[0-9a-fA-F]{6}$) and falls back to a neutral/empty state when invalid — never a broken or stale preview,#), same validation.LabelColorPickerinweb/src/components/), note that a future issue-edit/rename flow can reuse it; do not build the edit flow in this issue.Acceptance criteria
#) — server contract unchanged, no new endpoints.Fix open in PR #335: #335 (branch fix/issue-325). Preset dropdown (8 swatches) + Custom hex reveal + live preview reusing the row swatch rendering; headless tests + vite build green; no backend change, no new deps. Browser proof explicitly open (shared-daemon loopback block) — worth a live-Chrome pass on review.
Review of PR #335 (fix/issue-325) — verified in scratch worktree at origin/fix/issue-325 (
b747e66). No browser pass (sandbox blocks loopback; node tests + reasoning only — noted explicitly per instructions).ACCEPTANCE (all met):
TESTS (scratch worktree, node_modules symlinked from main):
NITS (non-blocking, no push made):
MERGE RECOMMENDATION: ready to merge (modulo the requested real-browser sanity check, which neither author nor reviewer could perform in this sandbox).
Fixed by PR #335 (review clean; palette + popover a11y + submit contract + #278 popover reuse verified), merged. Closing.