From 773cb610e68a9c40f67c0ba877e61151482b26de Mon Sep 17 00:00:00 2001 From: Travis Van Nimwegen Date: Thu, 20 Mar 2025 17:22:57 -0400 Subject: [PATCH] Enhance configuration options - Introduced new configuration options for vision and notes LLM prompts - Added category detection feature toggle in ConfigModal - Updated ScreenshotProcessor to utilize new prompt configurations - Cleaned up HelpModal by removing outdated forum links --- manifest.json | 2 +- package.json | 2 +- src/components/MainViewHeader.tsx | 12 +- src/components/modals/ConfigModal.tsx | 103 +++++++++++++++++- src/components/modals/HelpModal.tsx | 12 -- ...TestConfigModal.tsx => TestSetupModal.tsx} | 10 +- src/services/llm-service.ts | 19 ++++ src/services/screenshot-processor.ts | 25 +++-- src/types/config-types.ts | 13 ++- versions.json | 3 +- 10 files changed, 163 insertions(+), 38 deletions(-) rename src/components/modals/{TestConfigModal.tsx => TestSetupModal.tsx} (95%) diff --git a/manifest.json b/manifest.json index 5027d5a..724ef8d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "vision-recall", "name": "Vision Recall", - "version": "1.1.0", + "version": "1.2.0", "minAppVersion": "1.8.3", "description": "Transform screenshots into searchable notes using AI vision and text analysis.", "author": "Travis Van Nimwegen", diff --git a/package.json b/package.json index b216938..3738647 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-vision-recall", - "version": "1.1.0", + "version": "1.2.0", "description": "Transform screenshots into searchable Obsidian notes using AI vision and text analysis.", "main": "main.js", "scripts": { diff --git a/src/components/MainViewHeader.tsx b/src/components/MainViewHeader.tsx index 2bdcdfd..ca5c372 100644 --- a/src/components/MainViewHeader.tsx +++ b/src/components/MainViewHeader.tsx @@ -7,7 +7,7 @@ import { DocViewerModal } from '@/components/modals/DocViewerModal'; import { ConfigModal } from '@/components/modals/ConfigModal'; import { cn } from '@/lib/utils'; import { useDataContext } from '@/data/DataContext'; -import { TestConfigModal } from './modals/TestConfigModal'; +import { TestSetupModal } from './modals/TestSetupModal'; import { ProcessingQueueModal } from './modals/ProcessingQueueModal'; import { useQueueStore } from '@/stores/queueStore'; import { DebugOperationsModal } from './modals/DebugOperationsModal'; @@ -166,10 +166,10 @@ export const MainViewHeader = ({ metadata, refreshMetadata, viewMode = 'list', o @@ -264,7 +264,7 @@ export const MainViewHeader = ({ metadata, refreshMetadata, viewMode = 'list', o diff --git a/src/components/modals/ConfigModal.tsx b/src/components/modals/ConfigModal.tsx index d766d91..452cd12 100644 --- a/src/components/modals/ConfigModal.tsx +++ b/src/components/modals/ConfigModal.tsx @@ -1,9 +1,10 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { Modal } from 'obsidian'; import { DataManager } from '@/data/DataManager'; import { Plugin } from 'obsidian'; import { Config, DefaultConfig } from '@/types/config-types'; import { createRoot } from 'react-dom/client'; +import { cn } from '@/lib/utils'; const ConfigModalContent = ({ dataManager, @@ -16,11 +17,17 @@ const ConfigModalContent = ({ const [config, setConfig] = useState({}); const [dirty, setDirty] = useState(false); + const [enableCategoryDetection, setEnableCategoryDetection] = useState(false); + + const promptTextareaRef = useRef(null); + const notesPromptTextareaRef = useRef(null); + useEffect(() => { if (initialized) return; const loadConfig = async () => { const currentConfig = dataManager.getConfig(); setConfig(currentConfig); + setEnableCategoryDetection(currentConfig.enableCategoryDetection); setInitialized(true); }; loadConfig(); @@ -34,9 +41,26 @@ const ConfigModalContent = ({ const updateConfig = (updates: Partial) => { setConfig(prev => ({ ...prev, ...updates })); + if (updates.enableCategoryDetection !== undefined) { + setEnableCategoryDetection(updates.enableCategoryDetection); + } setDirty(true); }; + const resetVisionLLMPrompt = () => { + if (promptTextareaRef.current) { + promptTextareaRef.current.value = DefaultConfig.visionLLMPrompt; + } + updateConfig({ visionLLMPrompt: DefaultConfig.visionLLMPrompt }); + }; + + const resetNotesLLMPrompt = () => { + if (notesPromptTextareaRef.current) { + notesPromptTextareaRef.current.value = DefaultConfig.notesLLMPrompt; + } + updateConfig({ notesLLMPrompt: DefaultConfig.notesLLMPrompt }); + }; + if (!initialized) { return
Loading...
; } @@ -96,6 +120,83 @@ const ConfigModalContent = ({ +
+
+
+ + +
+