diff --git a/client/src/components/QuickBrainCapture.jsx b/client/src/components/QuickBrainCapture.jsx index 1bec01a2c3..bb8a6b81a0 100644 --- a/client/src/components/QuickBrainCapture.jsx +++ b/client/src/components/QuickBrainCapture.jsx @@ -8,6 +8,8 @@ import { parseBareUrl } from '../lib/bareUrl'; import { readClipboard } from '../lib/clipboard'; import { INGEST_OPTIONS, defaultIngestOptions, ingestOptionsFromSettings, isYoutubeVideoUrl } from '../lib/youtubeUrl'; import RepoIntakeOptions from './brain/RepoIntakeOptions'; +import RepoStudyFields from './brain/RepoStudyFields'; +import useRepoStudyConfig from '../hooks/useRepoStudyConfig'; import ProgressBar from './ui/ProgressBar'; import ToggleChip from './ui/ToggleChip'; @@ -30,7 +32,9 @@ export default function QuickBrainCapture() { // agent opt-ins (malware scan / repo study). const [showAdvanced, setShowAdvanced] = useState(false); const [ingestOpts, setIngestOpts] = useState(defaultIngestOptions); - const [agentPrompt, setAgentPrompt] = useState(''); + const analysis = useRepoStudyConfig({ enabled: isYoutube && showAdvanced }); + const { studyContext: agentPrompt, setStudyContext: setAgentPrompt } = analysis; + const [workMode, setWorkMode] = useState('issues'); const [tagsInput, setTagsInput] = useState(''); const [linkNote, setLinkNote] = useState(''); const repoIntake = useRepoIntake(input, linkNote); @@ -77,11 +81,13 @@ export default function QuickBrainCapture() { // the input clears immediately and the widget stays usable. setInput(''); setLinkNote(''); + const { studyContext: _context, ...agentOptions } = analysis.studyPayload(); ingest.start({ url: text, ...ingestOpts, ...(note ? { note } : {}), agentPrompt: agentPrompt.trim(), + ...(agentPrompt.trim() ? { ...agentOptions, workMode } : {}), tags: tagsInput.split(',').map((t) => t.trim()).filter(Boolean), }); return; @@ -246,19 +252,23 @@ export default function QuickBrainCapture() { ))} -
- -