Merge pull request #231 from objectiveSee/feature/edit-ux

Add double-tap to edit functionality for prompt buttons
This commit is contained in:
Prakash Joshi Pax 2025-08-11 08:35:52 +05:45 committed by GitHub
commit 0ad1a96c2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View File

@ -234,7 +234,16 @@ extension CustomPrompt {
.padding(.vertical, 6)
.contentShape(Rectangle())
.scaleEffect(isSelected ? 1.05 : 1.0)
.onTapGesture(perform: onTap)
.onTapGesture(count: 2) {
// Double tap to edit
if let onEdit = onEdit {
onEdit(self)
}
}
.onTapGesture(count: 1) {
// Single tap to select
onTap()
}
.contextMenu {
if onEdit != nil || onDelete != nil {
if let onEdit = onEdit {
@ -341,4 +350,4 @@ extension CustomPrompt {
.contentShape(Rectangle())
.onTapGesture(perform: action)
}
}
}

View File

@ -70,7 +70,7 @@ struct PromptSelectionGrid: View {
.font(.caption)
.foregroundColor(.secondary)
Text("Right-click on prompts to edit or delete")
Text("Double-click to edit • Right-click for more options")
.font(.caption)
.foregroundColor(.secondary)
}
@ -80,4 +80,3 @@ struct PromptSelectionGrid: View {
}
}
}