diff options
Diffstat (limited to 'web/app.js')
| -rw-r--r-- | web/app.js | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -950,11 +950,11 @@ async function submitAnswer(taskId, questionId, answer, banner) { // ── Elaborate (Draft with AI) ───────────────────────────────────────────────── -async function elaborateTask(prompt) { +async function elaborateTask(prompt, workingDir) { const res = await fetch(`${API_BASE}/api/tasks/elaborate`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ prompt }), + body: JSON.stringify({ prompt, working_dir: workingDir }), }); if (!res.ok) { let msg = `HTTP ${res.status}`; @@ -1699,7 +1699,11 @@ if (typeof document !== 'undefined') document.addEventListener('DOMContentLoaded form.querySelectorAll('.form-error, .elaborate-banner').forEach(el => el.remove()); try { - const result = await elaborateTask(prompt); + const sel = document.getElementById('project-select'); + const workingDir = sel.value === '__new__' + ? document.getElementById('new-project-input').value.trim() + : sel.value; + const result = await elaborateTask(prompt, workingDir); // Populate form fields const f = document.getElementById('task-form'); |
