gpt-engineer-app[bot] commited on
Commit ·
e3ca9bc
1
Parent(s): 0f4392c
Changes
Browse files
src/routes/dashboard.branch-debug.tsx
CHANGED
|
@@ -547,16 +547,45 @@ function AnalyzerView({
|
|
| 547 |
{/* Input panel */}
|
| 548 |
<div className="border-r border-border overflow-y-auto p-6 space-y-4 bg-surface/20">
|
| 549 |
<div>
|
| 550 |
-
<div className="flex items-center justify-between mb-2">
|
| 551 |
-
<label className="text-[10px] font-mono uppercase tracking-widest text-muted-foreground">
|
| 552 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 553 |
</div>
|
| 554 |
<Textarea
|
| 555 |
value={diff}
|
| 556 |
onChange={(e) => setDiff(e.target.value)}
|
| 557 |
-
placeholder="Paste
|
| 558 |
className="font-mono text-xs h-64 resize-none bg-background"
|
| 559 |
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 560 |
</div>
|
| 561 |
<div>
|
| 562 |
<label className="text-[10px] font-mono uppercase tracking-widest text-muted-foreground mb-2 block">Failure description</label>
|
|
@@ -578,7 +607,7 @@ function AnalyzerView({
|
|
| 578 |
<p className="text-[10px] text-muted-foreground mt-1">Used to jump directly to suspect lines in your editor.</p>
|
| 579 |
</div>
|
| 580 |
<Button onClick={onRun} disabled={analyzing} className="w-full gap-2">
|
| 581 |
-
{analyzing ? <><Loader2 className="h-4 w-4 animate-spin" /> Analyzing…</> : <><Sparkles className="h-4 w-4" /> Analyze
|
| 582 |
</Button>
|
| 583 |
<div className="rounded-lg border border-yellow-500/30 bg-yellow-500/5 p-3 flex gap-2 text-[11px] text-muted-foreground">
|
| 584 |
<Shield className="h-3.5 w-3.5 text-yellow-500 shrink-0 mt-0.5" />
|
|
|
|
| 547 |
{/* Input panel */}
|
| 548 |
<div className="border-r border-border overflow-y-auto p-6 space-y-4 bg-surface/20">
|
| 549 |
<div>
|
| 550 |
+
<div className="flex items-center justify-between mb-2 gap-2 flex-wrap">
|
| 551 |
+
<label className="text-[10px] font-mono uppercase tracking-widest text-muted-foreground">Git diff or code snippet</label>
|
| 552 |
+
<div className="flex items-center gap-2">
|
| 553 |
+
{detected !== "unknown" && (
|
| 554 |
+
<span className={cn(
|
| 555 |
+
"text-[9px] font-mono uppercase tracking-widest px-2 py-0.5 rounded border",
|
| 556 |
+
detected === "diff" ? "border-purple-400/40 bg-purple-400/10 text-purple-300" : "border-primary/40 bg-primary/10 text-primary"
|
| 557 |
+
)}>
|
| 558 |
+
{detected === "diff" ? "⎇ git diff" : "{} snippet"}
|
| 559 |
+
</span>
|
| 560 |
+
)}
|
| 561 |
+
<button onClick={onSample} className="text-[10px] font-mono uppercase tracking-widest text-primary hover:underline">Load sample</button>
|
| 562 |
+
</div>
|
| 563 |
</div>
|
| 564 |
<Textarea
|
| 565 |
value={diff}
|
| 566 |
onChange={(e) => setDiff(e.target.value)}
|
| 567 |
+
placeholder={"Paste a git diff (git diff main..feature/...) — OR — paste a raw code snippet and we'll analyze it directly."}
|
| 568 |
className="font-mono text-xs h-64 resize-none bg-background"
|
| 569 |
/>
|
| 570 |
+
{detected === "snippet" && (
|
| 571 |
+
<div className="mt-2 flex items-center gap-2">
|
| 572 |
+
<label className="text-[10px] font-mono uppercase tracking-widest text-muted-foreground">Language</label>
|
| 573 |
+
<select
|
| 574 |
+
value={language}
|
| 575 |
+
onChange={(e) => setLanguage(e.target.value)}
|
| 576 |
+
className="text-[11px] font-mono px-2 py-1 rounded-md bg-background border border-border focus:border-primary outline-none"
|
| 577 |
+
>
|
| 578 |
+
{LANGUAGES.map((l) => <option key={l.id} value={l.id}>{l.label}</option>)}
|
| 579 |
+
</select>
|
| 580 |
+
</div>
|
| 581 |
+
)}
|
| 582 |
+
{detected !== "unknown" && (
|
| 583 |
+
<p className="text-[10px] text-muted-foreground mt-2 leading-relaxed">
|
| 584 |
+
{detected === "diff"
|
| 585 |
+
? "⎇ Diff mode — AI maps changed lines → failure → ranked suspects."
|
| 586 |
+
: "{} Snippet mode — AI analyzes this code directly for bugs matching your failure. No diff needed."}
|
| 587 |
+
</p>
|
| 588 |
+
)}
|
| 589 |
</div>
|
| 590 |
<div>
|
| 591 |
<label className="text-[10px] font-mono uppercase tracking-widest text-muted-foreground mb-2 block">Failure description</label>
|
|
|
|
| 607 |
<p className="text-[10px] text-muted-foreground mt-1">Used to jump directly to suspect lines in your editor.</p>
|
| 608 |
</div>
|
| 609 |
<Button onClick={onRun} disabled={analyzing} className="w-full gap-2">
|
| 610 |
+
{analyzing ? <><Loader2 className="h-4 w-4 animate-spin" /> Analyzing…</> : <><Sparkles className="h-4 w-4" /> Analyze {detected === "snippet" ? "snippet" : detected === "diff" ? "diff" : "code"}</>}
|
| 611 |
</Button>
|
| 612 |
<div className="rounded-lg border border-yellow-500/30 bg-yellow-500/5 p-3 flex gap-2 text-[11px] text-muted-foreground">
|
| 613 |
<Shield className="h-3.5 w-3.5 text-yellow-500 shrink-0 mt-0.5" />
|