Skip to content

Add pin from clipboard#210

Open
chablino wants to merge 3 commits into
sw33tLie:mainfrom
chablino:pin-from-clipboard
Open

Add pin from clipboard#210
chablino wants to merge 3 commits into
sw33tLie:mainfrom
chablino:pin-from-clipboard

Conversation

@chablino
Copy link
Copy Markdown

@chablino chablino commented May 24, 2026

Summary

  • Add a Pin from Clipboard menu item and configurable hotkey slot.
  • Pin the first clipboard item as an image when real image data is available.
  • Render text/HTML/RTF clipboard content as a pinned image, with normalization for imported lists, attachments, and block spacing.

Test Plan

  • git diff --check origin/main...HEAD
  • swiftc smoke checks for HTML image fallback and imported text spacing
  • xcodebuild -project macshot.xcodeproj -scheme macshot -configuration Debug -destination 'platform=macOS' -derivedDataPath /private/tmp/macshot-pin-clipboard-derivedData -clonedSourcePackagesDirPath /private/tmp/macshot-pin-clipboard-sourcePackages CODE_SIGNING_ALLOWED=NO -quiet build

Demo

Text clipboard:
Screenshot 2026-05-25 at 02-40-44

Copilot AI review requested due to automatic review settings May 24, 2026 18:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a “Pin from Clipboard” feature, including a new hotkey/menu item and clipboard-to-image rendering for both images and text content.

Changes:

  • Added new localized strings for “Pin from Clipboard” and a new clipboard-content alert.
  • Extended hotkey registration to include a new pinFromClipboard slot.
  • Introduced clipboard pinning services to convert clipboard image/text (HTML/RTF/plain) into an NSImage for pinning.

Reviewed changes

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

Show a summary per file
File Description
macshot/en.lproj/Localizable.strings Adds localized menu title and alert text for pinning clipboard content.
macshot/Services/HotkeyManager.swift Adds a new hotkey slot and wires it into registration and menu shortcut mapping.
macshot/Services/ClipboardTextPinRenderer.swift New renderer to normalize attributed text and rasterize it into an image with sensible bounds.
macshot/Services/ClipboardPinService.swift New service to extract an image directly or render text into an image from pasteboard items.
macshot/AppDelegate.swift Adds menu item + hotkey callback and implements the pin-from-clipboard flow + alert.

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

Comment thread macshot/Services/ClipboardTextPinRenderer.swift
Comment thread macshot/AppDelegate.swift
Comment thread macshot/Services/HotkeyManager.swift
Comment thread macshot/AppDelegate.swift Outdated
@chablino chablino force-pushed the pin-from-clipboard branch from 4a215fd to d199a16 Compare May 24, 2026 18:24
@chablino chablino requested a review from Copilot May 24, 2026 18:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread macshot/Services/HotkeyManager.swift
Comment thread macshot/AppDelegate.swift
Comment thread macshot/Services/ClipboardTextPinRenderer.swift Outdated
Comment thread macshot/Services/ClipboardPinService.swift
@chablino chablino force-pushed the pin-from-clipboard branch from d199a16 to 721e42d Compare May 24, 2026 18:51
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