feat(settings): editable hex input for brand color - #78
Merged
Conversation
Closes #74. The Branding section already had the OS color picker and preset swatches, but the hex was read-only — no way to type or paste an exact brand color. Add an editable hex field alongside the picker and presets, extracted into a BrandColorPicker component. - utils/color: normalizeHex — lowercase, add missing #, expand #rgb shorthand; null for invalid (caller keeps the prior value). - BrandColorPicker: OS picker + editable hex field (local draft so partial typing is smooth; commits only a valid normalized hex) + presets with the active one highlighted. - Settings: swap the inline block for <BrandColorPicker>. brandColor stays in the form via defaultValues + setValue (no registered input needed). - Tests for normalizeHex and the component (typed hex, incomplete hex, preset click). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying helm with
|
| Latest commit: |
ff19e6c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4c7ffead.helm-d5s.pages.dev |
| Branch Preview URL: | https://feat-branding-color-picker.helm-d5s.pages.dev |
✅ AgentGate: Passed5 files changed · +141 -21 lines No issues found. Generated by AgentGate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #74. The Branding section already had the OS color picker (a small swatch — easy to miss) and preset swatches, but the hex was read-only — no way to type or paste an exact brand color. This adds an editable hex field for precise/custom colors, alongside the picker and presets.
Changes
utils/color.normalizeHex— lowercases, adds a missing#, and expands#rgb→#rrggbb; returnsnullfor invalid input (caller keeps the prior value).BrandColorPicker(new component) — the OS color picker + an editable hex input (keeps a local draft so partial typing is smooth; only commits a valid, normalized hex) + the preset swatches, with the active preset highlighted.<BrandColorPicker>;brandColorstays in the form viadefaultValues+setValue.Verification
npm run build✓ ·npm run check:cycles✓ ·npm run test:run247 pass (+8:normalizeHexcases + typing a valid/incomplete hex + preset click). Visual for your eyes — you can now type/paste any hex, use the OS picker, or click a preset, and they stay in sync.🤖 Generated with Claude Code