From 6ea41020a04e7be3e25fd2e2b10f0584622af5a1 Mon Sep 17 00:00:00 2001 From: Beingpax Date: Fri, 19 Dec 2025 09:48:05 +0545 Subject: [PATCH] Move Help & Feedback button inline --- .../Metrics/HelpAndResourcesSection.swift | 14 ++++++- VoiceInk/Views/Metrics/MetricsContent.swift | 41 ------------------- 2 files changed, 12 insertions(+), 43 deletions(-) diff --git a/VoiceInk/Views/Metrics/HelpAndResourcesSection.swift b/VoiceInk/Views/Metrics/HelpAndResourcesSection.swift index 1086649..bbf51fb 100644 --- a/VoiceInk/Views/Metrics/HelpAndResourcesSection.swift +++ b/VoiceInk/Views/Metrics/HelpAndResourcesSection.swift @@ -25,6 +25,14 @@ struct HelpAndResourcesSection: View { title: "Documentation", url: "https://tryvoiceink.com/docs" ) + + resourceLink( + icon: "exclamationmark.bubble.fill", + title: "Feedback or Issues?", + action: { + EmailSupport.openSupportEmail() + } + ) } } .padding(18) @@ -38,9 +46,11 @@ struct HelpAndResourcesSection: View { ) } - private func resourceLink(icon: String, title: String, url: String) -> some View { + private func resourceLink(icon: String, title: String, url: String? = nil, action: (() -> Void)? = nil) -> some View { Button(action: { - if let url = URL(string: url) { + if let action = action { + action() + } else if let urlString = url, let url = URL(string: urlString) { NSWorkspace.shared.open(url) } }) { diff --git a/VoiceInk/Views/Metrics/MetricsContent.swift b/VoiceInk/Views/Metrics/MetricsContent.swift index 000f57d..10485d4 100644 --- a/VoiceInk/Views/Metrics/MetricsContent.swift +++ b/VoiceInk/Views/Metrics/MetricsContent.swift @@ -141,7 +141,6 @@ struct MetricsContent: View { HStack(spacing: 12) { KeyboardShortcutsButton(showKeyboardShortcuts: $showKeyboardShortcuts) CopySystemInfoButton() - FeedbackButton() } } @@ -242,46 +241,6 @@ private enum Formatters { } } -private struct FeedbackButton: View { - @State private var isClicked: Bool = false - - var body: some View { - Button(action: { - openFeedback() - }) { - HStack(spacing: 8) { - Image(systemName: isClicked ? "checkmark.circle.fill" : "exclamationmark.bubble.fill") - .rotationEffect(.degrees(isClicked ? 360 : 0)) - .animation(.spring(response: 0.3, dampingFraction: 0.7), value: isClicked) - - Text(isClicked ? "Sending" : "Feedback or Issues?") - .animation(.spring(response: 0.3, dampingFraction: 0.7), value: isClicked) - } - .font(.system(size: 13, weight: .medium)) - .padding(.horizontal, 12) - .padding(.vertical, 8) - .background(Capsule().fill(.thinMaterial)) - } - .buttonStyle(.plain) - .scaleEffect(isClicked ? 1.1 : 1.0) - .animation(.spring(response: 0.3, dampingFraction: 0.7), value: isClicked) - } - - private func openFeedback() { - EmailSupport.openSupportEmail() - - withAnimation(.spring(response: 0.3, dampingFraction: 0.7)) { - isClicked = true - } - - DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { - withAnimation(.spring(response: 0.3, dampingFraction: 0.7)) { - isClicked = false - } - } - } -} - private struct KeyboardShortcutsButton: View { @Binding var showKeyboardShortcuts: Bool