From 339b2b92993f6ec959e0894dc6078ca57bc42d6a Mon Sep 17 00:00:00 2001 From: Danny Ricciotti Date: Sun, 10 Aug 2025 18:29:54 -0400 Subject: [PATCH] Add double-tap to edit functionality for prompt buttons - Replace single tap gesture with separate single/double tap handlers - Double-tap now opens edit dialog directly (more intuitive) - Single-tap still selects prompt (preserves existing behavior) - Update help text to reflect new interaction pattern - Right-click context menu remains unchanged Improves UX by making prompt editing more discoverable and following common UI patterns while maintaining backward compatibility. --- VoiceInk/Models/CustomPrompt.swift | 13 +++++++++++-- VoiceInk/Views/Components/PromptSelectionGrid.swift | 3 +-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/VoiceInk/Models/CustomPrompt.swift b/VoiceInk/Models/CustomPrompt.swift index cd2645c..36203d6 100644 --- a/VoiceInk/Models/CustomPrompt.swift +++ b/VoiceInk/Models/CustomPrompt.swift @@ -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) } -} \ No newline at end of file +} diff --git a/VoiceInk/Views/Components/PromptSelectionGrid.swift b/VoiceInk/Views/Components/PromptSelectionGrid.swift index ddb922a..ee49f0e 100644 --- a/VoiceInk/Views/Components/PromptSelectionGrid.swift +++ b/VoiceInk/Views/Components/PromptSelectionGrid.swift @@ -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 { } } } -