diff --git a/src/pages/views/workspace/WorkspaceInput.tsx b/src/pages/views/workspace/WorkspaceInput.tsx index 6c07092..5088b23 100644 --- a/src/pages/views/workspace/WorkspaceInput.tsx +++ b/src/pages/views/workspace/WorkspaceInput.tsx @@ -106,6 +106,7 @@ export const WorkspaceInput: React.FC = ({ onSend(trimmed, allFileIds, attachedDataSourceIds); setPrompt(''); setShowAutocomplete(false); + setShowSourcePicker(false); setAttachedFileIds([]); setAttachedDataSourceIds([]); }, [prompt, isProcessing, _extractFileRefs, attachedFileIds, attachedDataSourceIds, onSend]); @@ -161,6 +162,14 @@ export const WorkspaceInput: React.FC = ({ setAttachedDataSourceIds(prev => prev.filter(id => id !== dsId)); }, []); + const [showSourcePicker, setShowSourcePicker] = useState(false); + + const _toggleDataSource = useCallback((dsId: string) => { + setAttachedDataSourceIds(prev => + prev.includes(dsId) ? prev.filter(id => id !== dsId) : [...prev, dsId], + ); + }, []); + const _stopRecognition = useCallback(() => { if (recognitionRef.current) { try { recognitionRef.current.stop(); } catch { /* ignore */ } @@ -441,6 +450,78 @@ export const WorkspaceInput: React.FC = ({ {uploading ? '...' : '+'} + {dataSources.length > 0 && ( +
+ + {showSourcePicker && ( +
+
+ Active Sources auswählen +
+ {dataSources.map(ds => { + const isSelected = attachedDataSourceIds.includes(ds.id); + return ( +
_toggleDataSource(ds.id)} + style={{ + padding: '8px 12px', cursor: 'pointer', fontSize: 13, + display: 'flex', alignItems: 'center', gap: 8, + background: isSelected ? '#e8f5e9' : 'transparent', + }} + onMouseEnter={e => { if (!isSelected) e.currentTarget.style.background = '#f5f5f5'; }} + onMouseLeave={e => { if (!isSelected) e.currentTarget.style.background = ''; }} + > + + {isSelected ? '✓' : ''} + + + {ds.label || ds.path || ds.id} + +
+ ); + })} +
+ )} +
+ )} + {onProvidersChange && (