feat(badges): give the badge colour pickers the full palette and a hex field - #396
Merged
Conversation
…x field A user with 23 detect types could reach only nine usable swatches, two of them white: the Badges tab built its pickers without passing a palette, so they fell back to MoonUI's ten theme colours. design::picker_palette already offers 65 swatches and the chart and strategy pickers already use it — the settings tab was simply never wired to it. Pass it here too, and let the hex readout be typed into, so a colour outside any palette is still reachable. Colours entered that way are remembered per theme and offered back at the front of the picker, which is what makes them usable across 23 badges rather than one. The MoonUI pin moves to the merged MoonColorPicker change the typed-hex field needs; nothing but MoonUI moved in the lock.
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
A user with 23 detect types could reach only nine usable swatches, two of them white, and the hex readout could not be typed into — so past nine badges there was no way to tell them apart by colour.
The cause was small:
design::picker_palette()already offers 65 swatches and the chart and strategy pickers already pass it, but the Badges tab built its pickers without a palette and silently fell back to MoonUI's ten theme colours.This wires it up, and makes the hex readout an input so a colour outside any palette is still reachable. Colours entered that way are remembered per theme and offered back at the front of the picker — which is what makes them usable across 23 badges rather than one.
How to verify
cargo test --workspace— green (1300 + 255).Notes
assert-only-moonui-movedholds — nothing else moved.BadgesConfig::parse_sharegained acurrentargument so a pasted badge set cannot wipe the local custom-colour list; its one call site is updated.custom_colors/set_custom_colorsreversed the MRU order, so remembered colours came back oldest-first.