Skip to content

Add Siri/Shortcuts App Intents for clipping management - #2

Open
slyboots wants to merge 4 commits into
dev-vibefrom
claude/siri-shortcuts-app-intents
Open

Add Siri/Shortcuts App Intents for clipping management#2
slyboots wants to merge 4 commits into
dev-vibefrom
claude/siri-shortcuts-app-intents

Conversation

@slyboots

@slyboots slyboots commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds 4 Siri/Shortcuts App Intents in the main Clip target (Clip/Intents/): Get Clipping, Add Clipping, Delete Clipping, Delete All Clippings.
  • All 3 of the app's content types (text, URL, image) are supported: ClippingEntity exposes optional text/url/image properties for Get Clipping's output, and Add Clipping accepts a single smart IntentFile input, detecting images by UTType and disambiguating text vs. URL by checking for a URL scheme.
  • Since these live in the main app target (not a separate extension), Shortcuts automatically shows the Clip app icon as each action's tile — no extra icon assets needed.
  • Optimized for speed/memory: Get/Delete Clipping use a minimal fetchLimit = 1 query instead of the display-capped historyFetchRequest(); Delete All Clippings uses a single unpredicated NSBatchDeleteRequest so no managed objects are ever faulted into memory; images are passed through as raw stored bytes + UTI rather than decoding/re-encoding via UIImage.
  • All mutating intents post the existing didChangePasteboard Darwin 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

  • Open in Xcode and build the Clip scheme (this was written and reviewed without a Swift/Xcode toolchain available in the dev container, so it has not been compiler-verified)
  • In the Shortcuts app, search "Clip" and confirm all 4 actions appear with the Clip app icon
  • Build a test shortcut chaining Add Clipping → Get Clipping for each content type (text, URL, image) and confirm round-trip correctness
  • Confirm Delete Clipping / Delete All Clippings shrink the list as reflected in the main app's History view afterward

Generated by Claude Code

claude added 2 commits July 3, 2026 00:01
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
slyboots force-pushed the claude/clip-pr-changes-i3ws6o branch from 22a5675 to 1bc5077 Compare July 3, 2026 03:06
@slyboots
slyboots changed the base branch from claude/clip-pr-changes-i3ws6o to dev-vibe July 4, 2026 23:35
claude added 2 commits July 5, 2026 01:55
…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.
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