fix: Enhance color notes with friendly names and HTML representation
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
BE: Update system notes for the color widget to be consistent with widget values
Related Issue
Closes #451607
Summary
This MR improves the consistency between the color widget and the system notes by aligning how color changes are displayed. Previously, system notes showed raw hex values (e.g. #1068bf) with code styling, while the widget showed friendly color names with color chips. This MR updates system notes to include both the color name and the hex value, styled to match the widget.
✅ What’s Changed
-
Updated
change_color_noteinEE::SystemNotes::IssuablesServiceto:- Use user-friendly color names
- Render color chips matching the widget format
-
Introduced
color_hex_to_namehelper for hex-to-name mapping -
Enhanced system note format for readability and visual clarity
-
No migration of existing notes to maintain backward compatibility
✏️ System Note Format
Previous Format:
changed color from `#1068bf` to `#f17763`
New Format:
changed color from [
🔵 Blue chip] Blue (#1068bf) to [🌹 Rose chip] Rose (#f17763)
🧪 Testing
- Existing RSpec system notes tests updated to verify new formatting.
- Ensure both color name and hex are rendered correctly.
- Confirm visual consistency with widget’s display.
Why This Matters
Improves UX by ensuring visual and textual consistency across the UI and system logs, making it easier for users to understand and audit changes.