Skip to content

Add icons to pasteboard picker - #7

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Jul 3, 2026
Merged

Add icons to pasteboard picker#7
cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

This PR adds icons to the pasteboard picker, with a few explained tricks for macOS 26 and 27.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds SF Symbol icons to the pasteboard picker entries and includes macOS 26/27-specific workarounds to keep the UI aligned and to restore menu item images on macOS 27.

Changes:

  • Update the pasteboard Picker rows to include a symbol icon + title formatting, plus a control size tweak.
  • Add NSPasteboard.iconName to map known pasteboards to SF Symbols.
  • Add an NSMenuItem swizzle (enabled on macOS 27+) to force menu item images visible for SwiftUI picker menus.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
WhatCopiedMac/Sources/Views/PickerView.swift Renders picker rows with icons and adds a macOS 26-only spacing alignment workaround.
WhatCopiedMac/Sources/Extensions/NSMenuItem+Extension.swift Adds a macOS 27+ preferredImageVisibility swizzle to restore SwiftUI Picker images.
WhatCopiedMac/Modules/Sources/AppKitExtensions/NSPasteboard+Extension.swift Introduces iconName to choose SF Symbols per pasteboard type.
WhatCopiedMac/main.swift Enables the new NSMenuItem swizzle on macOS 27+.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread WhatCopiedMac/Sources/Extensions/NSMenuItem+Extension.swift
Comment thread WhatCopiedMac/Sources/Extensions/NSMenuItem+Extension.swift
@cyanzhong
cyanzhong merged commit 057abcf into main Jul 3, 2026
2 checks passed
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