Commit a4d9519
fix(fields): honor hex option colors in status/select badges
Select/status badge colors silently ignored the field option's `color` when it
was a HEX value (which is how objects almost always declare it). getBadgeColorClasses
only matched NAMED palette keys (red/blue/…) against BADGE_COLOR_MAP, so a hex
like '#8B5CF6' fell through to a semantic-by-value / hash heuristic — producing
colors that contradicted the author's intent:
• In Review (#8B5CF6 purple) → rendered alarming RED
• Backlog (#94A3B8 grey) → rendered yellow
• Medium (#3B82F6 blue) → rendered amber
Add hexToPaletteName() (HSL hue-bucket, low-saturation → gray) + resolveColorName()
and use them in getBadgeColorClasses, getSemanticColorName, and the dot path. Hex
option colors now resolve to the nearest palette color and render as the author
intended; named colors, the value-semantic map, and the hash fallback are
unchanged. Fixes wrong/alarming status colors across every app that declares
option colors as hex (the common case).
Verified on the Tasks list (:5181): In Review purple, Backlog grey, Medium blue,
Done green, Urgent red — all matching task.object.ts. 142 badge/color/select
tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0928713 commit a4d9519
1 file changed
Lines changed: 48 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
782 | 825 | | |
783 | | - | |
| 826 | + | |
| 827 | + | |
784 | 828 | | |
785 | 829 | | |
786 | 830 | | |
| |||
800 | 844 | | |
801 | 845 | | |
802 | 846 | | |
803 | | - | |
| 847 | + | |
| 848 | + | |
804 | 849 | | |
805 | 850 | | |
806 | 851 | | |
| |||
872 | 917 | | |
873 | 918 | | |
874 | 919 | | |
875 | | - | |
| 920 | + | |
876 | 921 | | |
877 | 922 | | |
878 | 923 | | |
| |||
0 commit comments