applets/colorpicker: Improve UX when there's no history

If you have no colors picked in your history, the applet seems at odds with itself:

  • The full representation/history correctly asserts that there's no colors.
  • The compact applet/tray claims you have #000000 picked, and you can copy it!

This is because an implementation detail leaked through, where the applet falls back to a transparent color when there's nothing picked. I changed it to the more expected behavior: if there's no color picked then say "No color".

If you're wondering why I added two new properties (hasColor/ hasAnyColors) that's because you can't pass an undefined/null value to a typed property like color. I could've also changed it to check for #000000 as an "empty color" but that's still a valid color.

Merge request reports

Loading