Add Siri/Shortcuts App Intents for clipping management - #2
Open
slyboots wants to merge 4 commits into
Open
Conversation
Port rileytestut#4: add leading swipe actions for Copy/Share and a trailing destructive Delete action to the main app's history table view, reusing the existing copy/delete/_share handlers. Also extend the same swipe gestures to the custom keyboard's SwiftUI clipboard list via .swipeActions(), since it has its own separate list implementation not covered by the upstream PR.
Implements Get Clipping, Add Clipping, Delete Clipping, and Delete All Clippings as App Intents in the main Clip target, so they show up in the Shortcuts app (and Siri) with the app's own icon. - Get/Add/Delete Clipping operate on a single most-recent item via a minimal fetchLimit=1 query; all mutating intents run on viewContext and post the existing didChangePasteboard Darwin notification so the main app and keyboard extension pick up changes immediately. - Delete All Clippings uses a single unpredicated NSBatchDeleteRequest so no managed objects are ever faulted into memory. - ClippingEntity exposes optional text/url/image properties so Get Clipping can represent any of the app's content types from one action; images are passed through as raw stored bytes + UTI rather than decoding/re-encoding via UIImage. - Add Clipping accepts a single IntentFile parameter, detecting images by UTType and disambiguating text vs. URL by checking for a URL scheme, then reuses PasteboardItem.make(item:context:) to insert it.
slyboots
force-pushed
the
claude/clip-pr-changes-i3ws6o
branch
from
July 3, 2026 03:06
22a5675 to
1bc5077
Compare
…cuts-app-intents # Conflicts: # Clip.xcodeproj/project.pbxproj # ClipKit/SwiftUI/Keyboard.swift
AddClippingIntent.swift (Clip/Intents/) is the first caller of this method from outside ClipKit; every prior call site was SwiftUI preview code within ClipKit itself, so the missing access modifier went unnoticed until building the App Intents work in Xcode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cliptarget (Clip/Intents/): Get Clipping, Add Clipping, Delete Clipping, Delete All Clippings.ClippingEntityexposes optionaltext/url/imageproperties for Get Clipping's output, and Add Clipping accepts a single smartIntentFileinput, detecting images by UTType and disambiguating text vs. URL by checking for a URL scheme.fetchLimit = 1query instead of the display-cappedhistoryFetchRequest(); Delete All Clippings uses a single unpredicatedNSBatchDeleteRequestso no managed objects are ever faulted into memory; images are passed through as raw stored bytes + UTI rather than decoding/re-encoding viaUIImage.didChangePasteboardDarwin notification so the main app and keyboard extension pick up changes immediately.This branches off
claude/clip-pr-changes-i3ws6o(#1, still open), so this PR is stacked on top of it and only shows the new App Intents commit.Test plan
Clipscheme (this was written and reviewed without a Swift/Xcode toolchain available in the dev container, so it has not been compiler-verified)Generated by Claude Code