Skip to content

fix: Enhance color notes with friendly names and HTML representation

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_note in EE::SystemNotes::IssuablesService to:

    • Use user-friendly color names
    • Render color chips matching the widget format
  • Introduced color_hex_to_name helper 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.


Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading