feat: GeneratePage — white + blue theme (card-based, clean inputs)
Browse files- frontend/src/pages/GeneratePage.tsx +68 -123
frontend/src/pages/GeneratePage.tsx
CHANGED
|
@@ -1,23 +1,22 @@
|
|
| 1 |
-
import
|
| 2 |
|
| 3 |
const API = import.meta.env.VITE_API_URL || 'http://localhost:8000';
|
| 4 |
|
| 5 |
const TABS = [
|
| 6 |
-
{ id: 'requirements', label: 'Requirements', icon: '📝'
|
| 7 |
-
{ id: 'api', label: 'API Spec', icon: '🔌'
|
| 8 |
-
{ id: 'code', label: 'Source Code', icon: '💻'
|
| 9 |
-
{ id: 'flow', label: 'User Flow', icon: '🖥️'
|
| 10 |
];
|
| 11 |
|
| 12 |
const FRAMEWORKS: Record<string, string[]> = {
|
| 13 |
python: ['pytest', 'unittest'],
|
| 14 |
javascript: ['jest', 'mocha', 'cypress', 'playwright'],
|
| 15 |
typescript: ['jest', 'vitest', 'playwright'],
|
| 16 |
-
go: ['go_testing'],
|
| 17 |
};
|
| 18 |
|
| 19 |
export function GeneratePage() {
|
| 20 |
-
const [tab, setTab] = useState('
|
| 21 |
const [input, setInput] = useState('');
|
| 22 |
const [lang, setLang] = useState('python');
|
| 23 |
const [framework, setFramework] = useState('pytest');
|
|
@@ -27,191 +26,137 @@ export function GeneratePage() {
|
|
| 27 |
const [loading, setLoading] = useState(false);
|
| 28 |
const [error, setError] = useState('');
|
| 29 |
const [activeFile, setActiveFile] = useState(0);
|
| 30 |
-
const [stage, setStage] = useState('');
|
| 31 |
|
| 32 |
const generate = async () => {
|
| 33 |
if (!input.trim()) return;
|
| 34 |
-
setLoading(true); setError(''); setResult(null);
|
| 35 |
-
|
| 36 |
try {
|
| 37 |
-
const endpoint = useMultiAgent ? '/api/v1/generate/multi-agent' : `/api/v1/generate/from-${tab === 'api' ? 'api-spec' : tab === 'flow' ? 'flow' : tab}`;
|
| 38 |
-
|
| 39 |
let body: any = { framework, language: lang, test_types: testTypes };
|
| 40 |
if (useMultiAgent) {
|
| 41 |
-
body
|
| 42 |
if (tab === 'requirements') body.requirements = input;
|
| 43 |
else if (tab === 'api') body.openapi_spec = JSON.parse(input);
|
| 44 |
else if (tab === 'code') body.source_code = input;
|
| 45 |
-
else body.requirements = input;
|
| 46 |
} else {
|
| 47 |
if (tab === 'requirements') body.requirements = input;
|
| 48 |
else if (tab === 'api') body.openapi_spec = JSON.parse(input);
|
| 49 |
-
else if (tab === 'code') { body.source_code = input; body.filename =
|
| 50 |
else body.flow_description = input;
|
| 51 |
}
|
| 52 |
-
|
| 53 |
-
setStage(useMultiAgent ? 'Running 5-agent pipeline...' : 'Generating tests...');
|
| 54 |
const res = await fetch(`${API}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) });
|
| 55 |
-
|
| 56 |
if (!res.ok) throw new Error((await res.json()).detail || `Error ${res.status}`);
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
// Save history
|
| 61 |
-
const h = JSON.parse(localStorage.getItem('tg_history') || '[]');
|
| 62 |
-
h.unshift({ ...data, _input: input.slice(0, 150), _tab: tab, _time: Date.now() });
|
| 63 |
-
localStorage.setItem('tg_history', JSON.stringify(h.slice(0, 30)));
|
| 64 |
-
} catch (e: any) { setError(e.message); } finally { setLoading(false); setStage(''); }
|
| 65 |
};
|
| 66 |
|
| 67 |
-
const currentTab = TABS.find(t => t.id === tab)!;
|
| 68 |
const testFiles = result?.test_files || [];
|
| 69 |
const quality = result?.quality;
|
| 70 |
const coverage = result?.behavior_coverage;
|
| 71 |
|
| 72 |
return (
|
| 73 |
-
<div className="max-w-
|
| 74 |
-
{/*
|
| 75 |
-
<div className="
|
| 76 |
-
<
|
| 77 |
-
|
| 78 |
-
<p className="text-xs text-gray-500 mt-0.5">Multi-agent AI pipeline • Iterative refinement • Behavior coverage</p>
|
| 79 |
-
</div>
|
| 80 |
-
<div className="flex items-center gap-3">
|
| 81 |
-
{/* Multi-agent toggle */}
|
| 82 |
-
<label className="flex items-center gap-2 cursor-pointer">
|
| 83 |
-
<input type="checkbox" checked={useMultiAgent} onChange={e => setUseMultiAgent(e.target.checked)}
|
| 84 |
-
className="w-4 h-4 rounded bg-white/5 border-white/10 text-emerald-500 focus:ring-emerald-500/20" />
|
| 85 |
-
<span className="text-xs text-gray-400">🧠 Multi-Agent Mode</span>
|
| 86 |
-
</label>
|
| 87 |
-
{/* Language */}
|
| 88 |
-
<select value={lang} onChange={e => { setLang(e.target.value); setFramework(FRAMEWORKS[e.target.value][0]); }}
|
| 89 |
-
className="bg-white/[0.03] border border-white/[0.06] rounded-lg px-3 py-1.5 text-xs text-white focus:border-emerald-500/40 focus:outline-none">
|
| 90 |
-
{Object.keys(FRAMEWORKS).map(l => <option key={l} value={l}>{l}</option>)}
|
| 91 |
-
</select>
|
| 92 |
-
{/* Framework */}
|
| 93 |
-
<select value={framework} onChange={e => setFramework(e.target.value)}
|
| 94 |
-
className="bg-white/[0.03] border border-white/[0.06] rounded-lg px-3 py-1.5 text-xs text-white focus:border-emerald-500/40 focus:outline-none">
|
| 95 |
-
{(FRAMEWORKS[lang] || []).map(f => <option key={f} value={f}>{f}</option>)}
|
| 96 |
-
</select>
|
| 97 |
-
</div>
|
| 98 |
</div>
|
| 99 |
|
| 100 |
-
|
| 101 |
-
<div className="grid lg:grid-cols-[1fr_1.2fr] gap-4 h-[calc(100vh-160px)]">
|
| 102 |
{/* LEFT: Input */}
|
| 103 |
-
<div className="flex flex-col
|
| 104 |
-
{/*
|
| 105 |
-
<div className="flex gap-
|
| 106 |
{TABS.map(t => (
|
| 107 |
<button key={t.id} onClick={() => { setTab(t.id); setInput(''); }}
|
| 108 |
-
className={`
|
| 109 |
-
tab === t.id ? 'bg-
|
| 110 |
-
|
| 111 |
-
</button>
|
| 112 |
))}
|
| 113 |
</div>
|
| 114 |
|
| 115 |
-
{/*
|
| 116 |
-
<div className="flex
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
{['unit', 'integration', 'edge_case', 'security', 'e2e'].map(t => (
|
| 118 |
<button key={t} onClick={() => setTestTypes(testTypes.includes(t) ? testTypes.filter(x => x !== t) : [...testTypes, t])}
|
| 119 |
-
className={`px-
|
| 120 |
-
testTypes.includes(t) ? 'bg-
|
| 121 |
-
{t.replace('_', ' ')}
|
| 122 |
-
</button>
|
| 123 |
))}
|
| 124 |
</div>
|
| 125 |
|
| 126 |
{/* Textarea */}
|
| 127 |
-
<textarea value={input} onChange={e => setInput(e.target.value)}
|
| 128 |
-
|
|
|
|
| 129 |
|
| 130 |
-
{/* Generate
|
| 131 |
<button onClick={generate} disabled={loading || !input.trim()}
|
| 132 |
-
className={`
|
| 133 |
-
|
| 134 |
-
'bg-gradient-to-r from-emerald-600 to-cyan-600 text-white shadow-lg shadow-emerald-500/20 hover:shadow-emerald-500/30 hover:scale-[1.01]'}`}>
|
| 135 |
-
{loading ? `⏳ ${stage}` : useMultiAgent ? '🧠 Run Multi-Agent Pipeline' : '⚡ Generate Tests'}
|
| 136 |
</button>
|
| 137 |
-
{error && <p className="
|
| 138 |
</div>
|
| 139 |
|
| 140 |
{/* RIGHT: Output */}
|
| 141 |
-
<div className="
|
| 142 |
{result ? (
|
| 143 |
<>
|
| 144 |
-
{/*
|
| 145 |
-
<div className="flex items-center justify-between px-
|
| 146 |
<div className="flex items-center gap-4">
|
| 147 |
{quality && (
|
| 148 |
<div className="flex items-center gap-2">
|
| 149 |
-
<div className={`w-
|
| 150 |
-
quality.grade === 'A' ? 'bg-
|
| 151 |
-
|
| 152 |
-
quality.grade === 'C' ? 'bg-amber-500/20 text-amber-300' : 'bg-red-500/20 text-red-300'}`}>
|
| 153 |
-
{quality.grade}
|
| 154 |
-
</div>
|
| 155 |
-
<span className="text-[11px] text-gray-500">Quality {quality.overall}%</span>
|
| 156 |
</div>
|
| 157 |
)}
|
| 158 |
-
{coverage &&
|
| 159 |
-
<div className="flex items-center gap-2">
|
| 160 |
-
<div className="w-16 h-1.5 rounded-full bg-white/[0.05] overflow-hidden">
|
| 161 |
-
<div className="h-full bg-gradient-to-r from-emerald-500 to-cyan-500 rounded-full" style={{ width: `${coverage.coverage_pct}%` }} />
|
| 162 |
-
</div>
|
| 163 |
-
<span className="text-[11px] text-gray-500">{coverage.coverage_pct}% behaviors</span>
|
| 164 |
-
</div>
|
| 165 |
-
)}
|
| 166 |
-
<span className="text-[11px] text-gray-600">{result.processing_time_ms?.toFixed(0)}ms</span>
|
| 167 |
</div>
|
| 168 |
<button onClick={() => navigator.clipboard.writeText(testFiles[activeFile]?.code || '')}
|
| 169 |
-
className="px-3 py-1 rounded-lg bg-
|
| 170 |
-
Copy Code
|
| 171 |
-
</button>
|
| 172 |
</div>
|
| 173 |
|
| 174 |
-
{/*
|
| 175 |
-
{result.iterations_performed > 0 && (
|
| 176 |
-
<div className="px-4 py-1.5 border-b border-white/[0.03] flex items-center gap-2">
|
| 177 |
-
<span className="text-[10px] px-2 py-0.5 rounded-full bg-purple-500/10 text-purple-300 border border-purple-500/20">
|
| 178 |
-
🔄 {result.iterations_performed} refinement iterations
|
| 179 |
-
</span>
|
| 180 |
-
{coverage?.uncovered_behaviors?.length > 0 && (
|
| 181 |
-
<span className="text-[10px] px-2 py-0.5 rounded-full bg-amber-500/10 text-amber-300 border border-amber-500/20">
|
| 182 |
-
⚠️ {coverage.uncovered} untested behaviors
|
| 183 |
-
</span>
|
| 184 |
-
)}
|
| 185 |
-
</div>
|
| 186 |
-
)}
|
| 187 |
-
|
| 188 |
-
{/* File Tabs */}
|
| 189 |
{testFiles.length > 1 && (
|
| 190 |
-
<div className="flex px-
|
| 191 |
{testFiles.map((f: any, i: number) => (
|
| 192 |
<button key={i} onClick={() => setActiveFile(i)}
|
| 193 |
-
className={`px-
|
| 194 |
-
|
| 195 |
-
{f.filename} <span className="text-gray-600 ml-1">({f.num_tests})</span>
|
| 196 |
</button>
|
| 197 |
))}
|
| 198 |
</div>
|
| 199 |
)}
|
| 200 |
|
| 201 |
{/* Code */}
|
| 202 |
-
<pre className="flex-1 overflow-auto p-
|
| 203 |
{testFiles[activeFile]?.code || result.test_code || 'No code generated'}
|
| 204 |
</pre>
|
| 205 |
</>
|
| 206 |
) : (
|
| 207 |
<div className="flex-1 flex items-center justify-center">
|
| 208 |
<div className="text-center px-8">
|
| 209 |
-
<div className="text-5xl mb-5 opacity-
|
| 210 |
-
<h3 className="text-
|
| 211 |
-
<p className="text-
|
| 212 |
-
Paste your input, select test types, and click generate.
|
| 213 |
-
{useMultiAgent && <span className="block mt-1 text-emerald-400/60">Multi-agent mode: tests will be iteratively refined for higher quality.</span>}
|
| 214 |
-
</p>
|
| 215 |
</div>
|
| 216 |
</div>
|
| 217 |
)}
|
|
|
|
| 1 |
+
import { useState } from 'react';
|
| 2 |
|
| 3 |
const API = import.meta.env.VITE_API_URL || 'http://localhost:8000';
|
| 4 |
|
| 5 |
const TABS = [
|
| 6 |
+
{ id: 'requirements', label: 'Requirements', icon: '📝' },
|
| 7 |
+
{ id: 'api', label: 'API Spec', icon: '🔌' },
|
| 8 |
+
{ id: 'code', label: 'Source Code', icon: '💻' },
|
| 9 |
+
{ id: 'flow', label: 'User Flow', icon: '🖥️' },
|
| 10 |
];
|
| 11 |
|
| 12 |
const FRAMEWORKS: Record<string, string[]> = {
|
| 13 |
python: ['pytest', 'unittest'],
|
| 14 |
javascript: ['jest', 'mocha', 'cypress', 'playwright'],
|
| 15 |
typescript: ['jest', 'vitest', 'playwright'],
|
|
|
|
| 16 |
};
|
| 17 |
|
| 18 |
export function GeneratePage() {
|
| 19 |
+
const [tab, setTab] = useState('code');
|
| 20 |
const [input, setInput] = useState('');
|
| 21 |
const [lang, setLang] = useState('python');
|
| 22 |
const [framework, setFramework] = useState('pytest');
|
|
|
|
| 26 |
const [loading, setLoading] = useState(false);
|
| 27 |
const [error, setError] = useState('');
|
| 28 |
const [activeFile, setActiveFile] = useState(0);
|
|
|
|
| 29 |
|
| 30 |
const generate = async () => {
|
| 31 |
if (!input.trim()) return;
|
| 32 |
+
setLoading(true); setError(''); setResult(null);
|
|
|
|
| 33 |
try {
|
| 34 |
+
const endpoint = useMultiAgent ? '/api/v1/generate/multi-agent' : `/api/v1/generate/from-${tab === 'api' ? 'api-spec' : tab === 'flow' ? 'flow' : tab === 'requirements' ? 'requirements' : 'code'}`;
|
|
|
|
| 35 |
let body: any = { framework, language: lang, test_types: testTypes };
|
| 36 |
if (useMultiAgent) {
|
| 37 |
+
body.max_iterations = 3;
|
| 38 |
if (tab === 'requirements') body.requirements = input;
|
| 39 |
else if (tab === 'api') body.openapi_spec = JSON.parse(input);
|
| 40 |
else if (tab === 'code') body.source_code = input;
|
| 41 |
+
else body.requirements = input;
|
| 42 |
} else {
|
| 43 |
if (tab === 'requirements') body.requirements = input;
|
| 44 |
else if (tab === 'api') body.openapi_spec = JSON.parse(input);
|
| 45 |
+
else if (tab === 'code') { body.source_code = input; body.filename = 'source.py'; }
|
| 46 |
else body.flow_description = input;
|
| 47 |
}
|
|
|
|
|
|
|
| 48 |
const res = await fetch(`${API}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) });
|
|
|
|
| 49 |
if (!res.ok) throw new Error((await res.json()).detail || `Error ${res.status}`);
|
| 50 |
+
setResult(await res.json()); setActiveFile(0);
|
| 51 |
+
} catch (e: any) { setError(e.message); } finally { setLoading(false); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
};
|
| 53 |
|
|
|
|
| 54 |
const testFiles = result?.test_files || [];
|
| 55 |
const quality = result?.quality;
|
| 56 |
const coverage = result?.behavior_coverage;
|
| 57 |
|
| 58 |
return (
|
| 59 |
+
<div className="max-w-7xl mx-auto px-6 py-8">
|
| 60 |
+
{/* Header */}
|
| 61 |
+
<div className="mb-6">
|
| 62 |
+
<h1 className="text-2xl font-bold text-slate-900">Test Generation Studio</h1>
|
| 63 |
+
<p className="text-slate-500 text-sm mt-1">Multi-agent AI pipeline • Iterative refinement • Behavior coverage</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
</div>
|
| 65 |
|
| 66 |
+
<div className="grid lg:grid-cols-[1fr_1.2fr] gap-6">
|
|
|
|
| 67 |
{/* LEFT: Input */}
|
| 68 |
+
<div className="flex flex-col gap-4">
|
| 69 |
+
{/* Tabs */}
|
| 70 |
+
<div className="flex gap-2">
|
| 71 |
{TABS.map(t => (
|
| 72 |
<button key={t.id} onClick={() => { setTab(t.id); setInput(''); }}
|
| 73 |
+
className={`px-3 py-2 rounded-lg text-sm font-medium transition-all ${
|
| 74 |
+
tab === t.id ? 'bg-blue-50 text-blue-700 border border-blue-100' : 'text-slate-500 hover:text-slate-900 hover:bg-slate-50 border border-transparent'
|
| 75 |
+
}`}>{t.icon} {t.label}</button>
|
|
|
|
| 76 |
))}
|
| 77 |
</div>
|
| 78 |
|
| 79 |
+
{/* Config row */}
|
| 80 |
+
<div className="flex items-center gap-3 flex-wrap">
|
| 81 |
+
<select value={lang} onChange={e => { setLang(e.target.value); setFramework(FRAMEWORKS[e.target.value]?.[0] || 'pytest'); }}
|
| 82 |
+
className="input-base w-auto">
|
| 83 |
+
{Object.keys(FRAMEWORKS).map(l => <option key={l} value={l}>{l}</option>)}
|
| 84 |
+
</select>
|
| 85 |
+
<select value={framework} onChange={e => setFramework(e.target.value)} className="input-base w-auto">
|
| 86 |
+
{(FRAMEWORKS[lang] || []).map(f => <option key={f} value={f}>{f}</option>)}
|
| 87 |
+
</select>
|
| 88 |
+
<label className="flex items-center gap-2 text-sm text-slate-600 cursor-pointer ml-auto">
|
| 89 |
+
<input type="checkbox" checked={useMultiAgent} onChange={e => setUseMultiAgent(e.target.checked)} className="w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500" />
|
| 90 |
+
🧠 Multi-Agent
|
| 91 |
+
</label>
|
| 92 |
+
</div>
|
| 93 |
+
|
| 94 |
+
{/* Test type pills */}
|
| 95 |
+
<div className="flex flex-wrap gap-2">
|
| 96 |
{['unit', 'integration', 'edge_case', 'security', 'e2e'].map(t => (
|
| 97 |
<button key={t} onClick={() => setTestTypes(testTypes.includes(t) ? testTypes.filter(x => x !== t) : [...testTypes, t])}
|
| 98 |
+
className={`px-3 py-1 rounded-full text-xs font-medium border transition-all ${
|
| 99 |
+
testTypes.includes(t) ? 'bg-blue-50 text-blue-700 border-blue-200' : 'bg-white text-slate-500 border-slate-200 hover:border-slate-300'
|
| 100 |
+
}`}>{t.replace('_', ' ')}</button>
|
|
|
|
| 101 |
))}
|
| 102 |
</div>
|
| 103 |
|
| 104 |
{/* Textarea */}
|
| 105 |
+
<textarea value={input} onChange={e => setInput(e.target.value)}
|
| 106 |
+
placeholder={tab === 'code' ? 'Paste source code here...' : tab === 'api' ? 'Paste OpenAPI JSON spec...' : tab === 'flow' ? 'Describe user flow...' : 'Paste requirements...'}
|
| 107 |
+
className="input-base flex-1 min-h-[300px] resize-none font-mono text-sm leading-relaxed" />
|
| 108 |
|
| 109 |
+
{/* Generate button */}
|
| 110 |
<button onClick={generate} disabled={loading || !input.trim()}
|
| 111 |
+
className={`btn-primary h-12 text-base w-full ${loading ? 'opacity-60 cursor-wait' : ''}`}>
|
| 112 |
+
{loading ? '⏳ Generating...' : useMultiAgent ? '🧠 Run Multi-Agent Pipeline' : '⚡ Generate Tests'}
|
|
|
|
|
|
|
| 113 |
</button>
|
| 114 |
+
{error && <p className="text-red-600 text-sm bg-red-50 px-4 py-2 rounded-lg border border-red-100">{error}</p>}
|
| 115 |
</div>
|
| 116 |
|
| 117 |
{/* RIGHT: Output */}
|
| 118 |
+
<div className="card min-h-[500px] flex flex-col overflow-hidden">
|
| 119 |
{result ? (
|
| 120 |
<>
|
| 121 |
+
{/* Top bar */}
|
| 122 |
+
<div className="flex items-center justify-between px-5 py-3 border-b border-slate-100 bg-slate-50/50">
|
| 123 |
<div className="flex items-center gap-4">
|
| 124 |
{quality && (
|
| 125 |
<div className="flex items-center gap-2">
|
| 126 |
+
<div className={`w-8 h-8 rounded-lg flex items-center justify-center text-sm font-bold ${
|
| 127 |
+
quality.grade === 'A' ? 'bg-green-50 text-green-700' : quality.grade === 'B' ? 'bg-blue-50 text-blue-700' : 'bg-amber-50 text-amber-700'}`}>{quality.grade}</div>
|
| 128 |
+
<span className="text-xs text-slate-500">{quality.overall}%</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
</div>
|
| 130 |
)}
|
| 131 |
+
{coverage && <span className="text-xs text-slate-500">{coverage.coverage_pct}% behaviors covered</span>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
</div>
|
| 133 |
<button onClick={() => navigator.clipboard.writeText(testFiles[activeFile]?.code || '')}
|
| 134 |
+
className="px-3 py-1.5 rounded-lg bg-blue-50 text-blue-700 text-xs font-medium hover:bg-blue-100 transition">Copy</button>
|
|
|
|
|
|
|
| 135 |
</div>
|
| 136 |
|
| 137 |
+
{/* File tabs */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
{testFiles.length > 1 && (
|
| 139 |
+
<div className="flex px-4 py-2 border-b border-slate-100 gap-1 overflow-x-auto">
|
| 140 |
{testFiles.map((f: any, i: number) => (
|
| 141 |
<button key={i} onClick={() => setActiveFile(i)}
|
| 142 |
+
className={`px-3 py-1 rounded text-xs font-medium transition ${i === activeFile ? 'bg-blue-50 text-blue-700' : 'text-slate-500 hover:text-slate-700'}`}>
|
| 143 |
+
{f.filename} ({f.num_tests})
|
|
|
|
| 144 |
</button>
|
| 145 |
))}
|
| 146 |
</div>
|
| 147 |
)}
|
| 148 |
|
| 149 |
{/* Code */}
|
| 150 |
+
<pre className="flex-1 overflow-auto p-5 text-sm text-slate-800 font-mono leading-[1.7] bg-white">
|
| 151 |
{testFiles[activeFile]?.code || result.test_code || 'No code generated'}
|
| 152 |
</pre>
|
| 153 |
</>
|
| 154 |
) : (
|
| 155 |
<div className="flex-1 flex items-center justify-center">
|
| 156 |
<div className="text-center px-8">
|
| 157 |
+
<div className="text-5xl mb-5 opacity-30">🧪</div>
|
| 158 |
+
<h3 className="text-lg font-semibold text-slate-700 mb-2">Ready to Generate</h3>
|
| 159 |
+
<p className="text-sm text-slate-500 max-w-sm">Paste your input and click generate. {useMultiAgent && <span className="text-blue-600">Multi-agent mode will iteratively refine for higher quality.</span>}</p>
|
|
|
|
|
|
|
|
|
|
| 160 |
</div>
|
| 161 |
</div>
|
| 162 |
)}
|