Remove automatic prompt switching for selected text

This commit is contained in:
Beingpax 2025-07-02 20:45:01 +05:45
parent 39b1ff744a
commit 3f72774433

View File

@ -20,20 +20,6 @@ class PromptDetectionService {
let originalEnhancementState = enhancementService.isEnhancementEnabled
let originalPromptId = enhancementService.selectedPromptId
if let selectedText = SelectedTextService.fetchSelectedText(), !selectedText.isEmpty {
let wordCount = selectedText.split { $0.isWhitespace || $0.isNewline }.count
if wordCount >= 2 {
return PromptDetectionResult(
shouldEnableAI: true,
selectedPromptId: PredefinedPrompts.assistantPromptId,
processedText: text, // The user's speech is the prompt for the selected text
detectedTriggerWord: nil,
originalEnhancementState: originalEnhancementState,
originalPromptId: originalPromptId
)
}
}
for prompt in enhancementService.allPrompts {
if !prompt.triggerWords.isEmpty {
if let (detectedWord, processedText) = findMatchingTriggerWord(from: text, triggerWords: prompt.triggerWords) {