Skip to content

Add Hex Color Swatch Show Setting in Preferences#1338

Open
umang350 wants to merge 3 commits intop0deje:masterfrom
umang350:dev/hex-setting
Open

Add Hex Color Swatch Show Setting in Preferences#1338
umang350 wants to merge 3 commits intop0deje:masterfrom
umang350:dev/hex-setting

Conversation

@umang350
Copy link
Copy Markdown

Summary

  • Adds a new "Show hex color swatch" toggle in the Appearance settings pane
  • When enabled (default), a 12x12 color swatch preview is shown next to clipboard items whose text is a valid hex color code (e.g. #ff8942, fff)
  • When disabled, hex color strings appear as plain text without a swatch

Implementation

  • New showHexColorSwatch boolean preference key (default: true) in Defaults.Keys
  • ListItemView gates the accessoryImage rendering on the new setting, following the same @default pattern used by showApplicationIcons
  • Defaults.Toggle added to AppearanceSettingsPane between "Show application icons" and "Show footer"
  • Localization strings added to all 41 locale files (English translated, others left empty for future translation)

Files changed

  • Maccy/Extensions/Defaults.Keys+Names.swift — new key
  • Maccy/Views/ListItemView.swift — gate accessory image on setting
  • Maccy/Settings/AppearanceSettingsPane.swift — new toggle
  • Maccy/Settings/*/AppearanceSettings.strings — localization entries (41 files)

Test plan

  • Open Preferences > Appearance, verify "Show hex color swatch" toggle is visible
  • Copy a hex color string (e.g. #ff8942), verify swatch appears when toggle is on
  • Disable the toggle, verify swatch no longer appears for hex color items
  • Re-enable the toggle, verify swatch reappears

Copy link
Copy Markdown
Collaborator

@weisJ weisJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the color swatch showing really that bothering you? (I don't have nothing against this change)

It would be great if you could provide real translations instead of just stubbing them out.

Comment thread Maccy/Views/ListItemView.swift Outdated
.frame(width: showIcons ? 5 : 10)

if let accessoryImage {
if showHexColorSwatch, let accessoryImage {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct place for this check. You need to pass nil to accessoryImage in HistoryItemView. In the future there might be other accessory images for different reasons.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the logic to correct location.

@umang350
Copy link
Copy Markdown
Author

Is the color swatch showing really that bothering you? (I don't have nothing against this change)

It would be great if you could provide real translations instead of just stubbing them out.

Color swatch seems to be annoying when I am not dealing with HEX codes but just bare numbers. Just OCD and not able to figure out what the square box was until i read the source code to figure it out. I don't code everyday, just a PM.

@umang350 umang350 requested a review from weisJ February 17, 2026 12:41
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.

2 participants