diff --git a/apps/desktop/src-tauri/src/infrastructure/gemini_service.rs b/apps/desktop/src-tauri/src/infrastructure/gemini_service.rs index 46cccfa..156d7af 100644 --- a/apps/desktop/src-tauri/src/infrastructure/gemini_service.rs +++ b/apps/desktop/src-tauri/src/infrastructure/gemini_service.rs @@ -14,7 +14,7 @@ use std::sync::{Arc, Mutex}; // 导入会话管理相关模块 use crate::data::models::conversation::{ ConversationMessage, MessageRole, MessageContent, ConversationHistoryQuery, - CreateConversationSessionRequest, AddMessageRequest, + AddMessageRequest, }; use crate::data::repositories::conversation_repository::ConversationRepository; diff --git a/apps/desktop/src/components/ChatInterface.tsx b/apps/desktop/src/components/ChatInterface.tsx index af95287..7ad0322 100644 --- a/apps/desktop/src/components/ChatInterface.tsx +++ b/apps/desktop/src/components/ChatInterface.tsx @@ -401,6 +401,8 @@ export const ChatInterface: React.FC = ({ showSources={showSources} enableMaterialCards={enableImageCards} enableReferences={true} + selectedTags={selectedTags} + onTagClick={toggleTag} /> ))} diff --git a/apps/desktop/src/components/EnhancedChatMessageV2.tsx b/apps/desktop/src/components/EnhancedChatMessageV2.tsx index faf1a24..7319b8e 100644 --- a/apps/desktop/src/components/EnhancedChatMessageV2.tsx +++ b/apps/desktop/src/components/EnhancedChatMessageV2.tsx @@ -47,6 +47,10 @@ interface EnhancedChatMessageV2Props { enableReferences?: boolean; /** 自定义样式类名 */ className?: string; + /** 已选中的标签列表 */ + selectedTags?: string[]; + /** 标签点击回调 */ + onTagClick?: (tag: string) => void; } /** @@ -58,7 +62,9 @@ export const EnhancedChatMessageV2: React.FC = ({ showSources = true, enableMaterialCards = true, enableReferences = true, - className = '' + className = '', + selectedTags = [], + onTagClick }) => { const [copied, setCopied] = useState(false); const [expandedSources, setExpandedSources] = useState(false); @@ -205,6 +211,8 @@ export const EnhancedChatMessageV2: React.FC = ({ showDetails={true} className="cursor-pointer" onViewLarge={() => handleMaterialClick(source as GroundingSource)} + selectedTags={selectedTags} + onTagClick={onTagClick} /> ))} diff --git a/apps/desktop/src/components/ImageCard.tsx b/apps/desktop/src/components/ImageCard.tsx index 443bffc..3a9e3d5 100644 --- a/apps/desktop/src/components/ImageCard.tsx +++ b/apps/desktop/src/components/ImageCard.tsx @@ -34,6 +34,10 @@ interface ImageCardProps { onViewLarge?: (source: GroundingSource) => void; /** 自定义样式类名 */ className?: string; + /** 已选中的标签列表 */ + selectedTags?: string[]; + /** 标签点击回调 */ + onTagClick?: (tag: string) => void; } /** @@ -46,7 +50,9 @@ export const ImageCard: React.FC = ({ position, onClose, onDownload, - className = '' + className = '', + selectedTags = [], + onTagClick }) => { const [imageLoaded, setImageLoaded] = useState(false); const [imageError, setImageError] = useState(false); @@ -186,14 +192,22 @@ export const ImageCard: React.FC = ({
- {(expandedEnvironmentTags ? environmentTags : environmentTags.slice(0, 2)).map((tag: string, index: number) => ( - - {tag} - - ))} + {(expandedEnvironmentTags ? environmentTags : environmentTags.slice(0, 2)).map((tag: string, index: number) => { + const isSelected = selectedTags.includes(tag); + return ( + + ); + })} {environmentTags.length > 2 && ( + ); + })} {categories.length > 2 && (