Skip to content

feat(badges): give the badge colour pickers the full palette and a hex field - #396

Merged
kirillDevPro merged 1 commit into
mainfrom
pr/badges-rebased
Sep 1, 2026
Merged

feat(badges): give the badge colour pickers the full palette and a hex field#396
kirillDevPro merged 1 commit into
mainfrom
pr/badges-rebased

Conversation

@kirillDevPro

Copy link
Copy Markdown
Collaborator

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).
  • Unit tests cover the hex parse/format round-trip and the custom-colour persistence, including that a shared-settings paste preserves the local custom-colour history.
  • In the app: Settings → Badges, open any colour picker — 65 swatches; type a hex, press Enter, confirm it appears at the front of every row's picker and survives a restart.

Notes

  • Depends on MoonUI #59, already merged. The lock moves the MoonUI pin to it; assert-only-moonui-moved holds — nothing else moved.
  • BadgesConfig::parse_share gained a current argument so a pasted badge set cannot wipe the local custom-colour list; its one call site is updated.
  • A real bug was caught during review on the MoonUI side and fixed there: custom_colors/set_custom_colors reversed the MRU order, so remembered colours came back oldest-first.
  • Not verified visually: the hex field inside the popover and the scroll behaviour at 65+ swatches in both themes.

…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.
@kirillDevPro
kirillDevPro merged commit 4d1bc79 into main Sep 1, 2026
6 checks passed
@kirillDevPro
kirillDevPro deleted the pr/badges-rebased branch September 1, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant