minor cleanup

This commit is contained in:
Serwan Asaad 2025-09-22 13:53:27 +02:00
parent c91f92f4d0
commit 1417b7a4fe
2 changed files with 4 additions and 2 deletions

View File

@ -134,7 +134,7 @@ class AIEnhancementService: ObservableObject {
private func getSystemMessage(for mode: EnhancementPrompt) -> String {
let clipboardSnapshot = NSPasteboard.general.string(forType: .string)
let selectedText = SelectedTextService.fetchSelectedText()
if let activePrompt = activePrompt,
activePrompt.id == PredefinedPrompts.assistantPromptId,
let selectedText = selectedText, !selectedText.isEmpty {

View File

@ -1,7 +1,9 @@
import Foundation
import AppKit
class SelectedTextService {
// Private pasteboard type to avoid clipboard history pollution
private static let privatePasteboardType = NSPasteboard.PasteboardType("com.prakashjoshipax.VoiceInk.transient")
static func fetchSelectedText() -> String? {
// Don't check for selected text within VoiceInk itself
guard let frontmostApp = NSWorkspace.shared.frontmostApplication,