From 0bddac98ba8201cf87e0628ba90c34c2cc12bf29 Mon Sep 17 00:00:00 2001 From: Alvie Stoddard Date: Fri, 24 Jul 2026 12:36:27 -0700 Subject: [PATCH 1/3] Organize the clip context menu --- Sources/Pesty/UI/ClipCardView.swift | 31 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Sources/Pesty/UI/ClipCardView.swift b/Sources/Pesty/UI/ClipCardView.swift index 32ba404..2cf4e38 100644 --- a/Sources/Pesty/UI/ClipCardView.swift +++ b/Sources/Pesty/UI/ClipCardView.swift @@ -250,27 +250,28 @@ struct ClipCardView: View { Button("Paste") { AppController.shared.pasteItem(item) } Button("Copy") { AppController.shared.copyItem(item) } Divider() - if !store.pinboards.isEmpty { - Menu("Save to Pinboard") { + Button("Rename") { + if let t = TextPrompt.run(title: "Rename", message: "Card title", + defaultValue: item.customTitle ?? "") { + store.setTitle(t, for: item) + } + } + Button("Delete", role: .destructive) { store.delete(item) } + Divider() + Menu("Pin") { + if !store.pinboards.isEmpty { ForEach(store.pinboards) { b in Button(b.name) { store.saveToPinboard(item, boardID: b.id) } } + Divider() } - } - Button("Save to New Pinboard…") { - if let name = TextPrompt.run(title: "New Pinboard", message: "Name") { - let b = store.addPinboard(name: name) - store.saveToPinboard(item, boardID: b.id) - } - } - Button("Edit Title…") { - if let t = TextPrompt.run(title: "Edit Title", message: "Card title", - defaultValue: item.customTitle ?? "") { - store.setTitle(t, for: item) + Button("New Pinboard…") { + if let name = TextPrompt.run(title: "New Pinboard", message: "Name") { + let b = store.addPinboard(name: name) + store.saveToPinboard(item, boardID: b.id) + } } } - Divider() - Button("Delete", role: .destructive) { store.delete(item) } } } From bc7ec2adb0c68d9acb932178f25ee04a3bb7f424 Mon Sep 17 00:00:00 2001 From: Alvie Stoddard Date: Fri, 24 Jul 2026 12:48:18 -0700 Subject: [PATCH 2/3] Add icons to clip context menus --- Sources/Pesty/UI/ClipCardView.swift | 46 ++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/Sources/Pesty/UI/ClipCardView.swift b/Sources/Pesty/UI/ClipCardView.swift index 2cf4e38..e4d5811 100644 --- a/Sources/Pesty/UI/ClipCardView.swift +++ b/Sources/Pesty/UI/ClipCardView.swift @@ -237,40 +237,64 @@ struct ClipCardView: View { private var menu: some View { if let entry = pasteStackEntry { if entry.isPasted { - Button("Re-add to Stack") { AppController.shared.reAddPasteStackEntry(entry) } + Button { AppController.shared.reAddPasteStackEntry(entry) } label: { + Label("Re-add to Stack", systemImage: "arrow.uturn.left") + } } else { - Button("Paste") { AppController.shared.pasteStackEntry(entry) } + Button { AppController.shared.pasteStackEntry(entry) } label: { + Label("Paste", systemImage: "doc.on.clipboard") + } + } + Button { AppController.shared.copyItem(item) } label: { + Label("Copy", systemImage: "doc.on.doc") } - Button("Copy") { AppController.shared.copyItem(item) } Divider() - Button("Remove from Paste Stack", role: .destructive) { + Button(role: .destructive) { AppController.shared.removePasteStackEntry(entry) + } label: { + Label("Remove from Paste Stack", systemImage: "trash") } } else { - Button("Paste") { AppController.shared.pasteItem(item) } - Button("Copy") { AppController.shared.copyItem(item) } + Button { AppController.shared.pasteItem(item) } label: { + Label("Paste", systemImage: "doc.on.clipboard") + } + Button { AppController.shared.copyItem(item) } label: { + Label("Copy", systemImage: "doc.on.doc") + } Divider() - Button("Rename") { + Button { if let t = TextPrompt.run(title: "Rename", message: "Card title", defaultValue: item.customTitle ?? "") { store.setTitle(t, for: item) } + } label: { + Label("Rename", systemImage: "pencil") + } + Button(role: .destructive) { + store.delete(item) + } label: { + Label("Delete", systemImage: "trash") } - Button("Delete", role: .destructive) { store.delete(item) } Divider() - Menu("Pin") { + Menu { if !store.pinboards.isEmpty { ForEach(store.pinboards) { b in - Button(b.name) { store.saveToPinboard(item, boardID: b.id) } + Button { store.saveToPinboard(item, boardID: b.id) } label: { + Label(b.name, systemImage: "pin") + } } Divider() } - Button("New Pinboard…") { + Button { if let name = TextPrompt.run(title: "New Pinboard", message: "Name") { let b = store.addPinboard(name: name) store.saveToPinboard(item, boardID: b.id) } + } label: { + Label("New Pinboard…", systemImage: "plus") } + } label: { + Label("Pin", systemImage: "pin") } } } From f4a07eb9ed91e92d63f91d842e8b896cc0cd23c9 Mon Sep 17 00:00:00 2001 From: Alvie Stoddard Date: Fri, 24 Jul 2026 12:54:18 -0700 Subject: [PATCH 3/3] Show pinboard colors in the Pin menu --- Sources/Pesty/UI/ClipCardView.swift | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Sources/Pesty/UI/ClipCardView.swift b/Sources/Pesty/UI/ClipCardView.swift index e4d5811..fd2c28f 100644 --- a/Sources/Pesty/UI/ClipCardView.swift +++ b/Sources/Pesty/UI/ClipCardView.swift @@ -280,18 +280,18 @@ struct ClipCardView: View { if !store.pinboards.isEmpty { ForEach(store.pinboards) { b in Button { store.saveToPinboard(item, boardID: b.id) } label: { - Label(b.name, systemImage: "pin") + PinboardMenuItemLabel(pinboard: b) } } Divider() } Button { - if let name = TextPrompt.run(title: "New Pinboard", message: "Name") { + if let name = TextPrompt.run(title: "Create Pinboard", message: "Name") { let b = store.addPinboard(name: name) store.saveToPinboard(item, boardID: b.id) } } label: { - Label("New Pinboard…", systemImage: "plus") + Text("Create Pinboard…") } } label: { Label("Pin", systemImage: "pin") @@ -319,3 +319,19 @@ struct ClipCardView: View { } } } + +private struct PinboardMenuItemLabel: View { + let pinboard: Pinboard + + var body: some View { + HStack(spacing: 10) { + Circle() + .fill(pinboard.color) + .overlay { + Circle().stroke(.black.opacity(0.16), lineWidth: 0.5) + } + .frame(width: 18, height: 18) + Text(pinboard.name) + } + } +}