From 444d97112a0cce8b655c8fe1c2f63c918741541d Mon Sep 17 00:00:00 2001 From: Beingpax Date: Wed, 31 Dec 2025 14:13:01 +0545 Subject: [PATCH] Add inline copy buttons to detail view --- .../History/TranscriptionDetailView.swift | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/VoiceInk/Views/History/TranscriptionDetailView.swift b/VoiceInk/Views/History/TranscriptionDetailView.swift index 94092bd..9606652 100644 --- a/VoiceInk/Views/History/TranscriptionDetailView.swift +++ b/VoiceInk/Views/History/TranscriptionDetailView.swift @@ -71,41 +71,42 @@ private struct MessageBubble: View { .foregroundColor(.secondary.opacity(0.7)) .padding(.horizontal, 12) - HStack(alignment: .top, spacing: 8) { - ScrollView { - Text(text) - .font(.system(size: 14, weight: .regular)) - .lineSpacing(2) - .textSelection(.enabled) - .padding(.horizontal, 12) - .padding(.vertical, 10) + ScrollView { + Text(text) + .font(.system(size: 14, weight: .regular)) + .lineSpacing(2) + .textSelection(.enabled) + .padding(.horizontal, 12) + .padding(.vertical, 10) + } + .frame(maxHeight: 350) + .background { + if isEnhanced { + RoundedRectangle(cornerRadius: 18, style: .continuous) + .fill(Color.accentColor.opacity(0.2)) + } else { + RoundedRectangle(cornerRadius: 18, style: .continuous) + .fill(.thinMaterial) + .overlay( + RoundedRectangle(cornerRadius: 18, style: .continuous) + .strokeBorder(Color.primary.opacity(0.06), lineWidth: 0.5) + ) } - .frame(maxHeight: 350) - .background { - if isEnhanced { - RoundedRectangle(cornerRadius: 18, style: .continuous) - .fill(Color.accentColor.opacity(0.2)) - } else { - RoundedRectangle(cornerRadius: 18, style: .continuous) - .fill(.thinMaterial) - .overlay( - RoundedRectangle(cornerRadius: 18, style: .continuous) - .strokeBorder(Color.primary.opacity(0.06), lineWidth: 0.5) - ) - } - } - + } + .overlay(alignment: .bottomTrailing) { Button(action: { copyToClipboard(text) }) { Image(systemName: justCopied ? "checkmark" : "doc.on.doc") .font(.system(size: 12)) .foregroundColor(justCopied ? .green : .secondary) - .frame(width: 24, height: 24) + .frame(width: 28, height: 28) + .background(Color(NSColor.controlBackgroundColor).opacity(0.9)) + .clipShape(Circle()) } .buttonStyle(.plain) .help("Copy to clipboard") - .padding(.top, 8) + .padding(8) } }