gpt-engineer-app[bot] commited on
Commit Β·
052c05a
1
Parent(s): 97a1f05
Changes
Browse files
src/routes/dashboard.branch-debug.tsx
CHANGED
|
@@ -405,53 +405,92 @@ function CliView() {
|
|
| 405 |
</div>
|
| 406 |
);
|
| 407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 408 |
return (
|
| 409 |
<div className="flex-1 overflow-y-auto p-8">
|
| 410 |
-
<div className="max-w-3xl mx-auto space-y-
|
| 411 |
<div>
|
| 412 |
<h2 className="text-xl font-semibold flex items-center gap-2">
|
| 413 |
<FileCode className="h-5 w-5 text-primary" /> Run Branch Debug from VS Code
|
| 414 |
</h2>
|
| 415 |
<p className="text-sm text-muted-foreground mt-1">
|
| 416 |
-
|
| 417 |
</p>
|
| 418 |
</div>
|
| 419 |
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
<
|
| 423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 424 |
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
|
|
|
|
|
|
| 432 |
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
<
|
| 438 |
-
<div className="
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
| 442 |
</div>
|
| 443 |
</section>
|
| 444 |
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
<
|
| 448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
</section>
|
| 450 |
|
| 451 |
<div className="rounded-lg border border-primary/30 bg-primary/5 p-4 text-xs text-muted-foreground flex gap-3">
|
| 452 |
<Shield className="h-4 w-4 text-primary shrink-0 mt-0.5" />
|
| 453 |
<div>
|
| 454 |
-
|
| 455 |
</div>
|
| 456 |
</div>
|
| 457 |
</div>
|
|
|
|
| 405 |
</div>
|
| 406 |
);
|
| 407 |
|
| 408 |
+
const downloadExtension = () => {
|
| 409 |
+
fetch("/branchdebug-vscode-extension.zip")
|
| 410 |
+
.then((res) => { if (!res.ok) throw new Error(`Download failed: ${res.status}`); return res.blob(); })
|
| 411 |
+
.then((blob) => {
|
| 412 |
+
const a = document.createElement("a");
|
| 413 |
+
a.href = URL.createObjectURL(blob);
|
| 414 |
+
a.download = "branchdebug-vscode-extension.zip";
|
| 415 |
+
a.click();
|
| 416 |
+
URL.revokeObjectURL(a.href);
|
| 417 |
+
toast.success("Extension downloaded");
|
| 418 |
+
})
|
| 419 |
+
.catch((err) => toast.error(err.message));
|
| 420 |
+
};
|
| 421 |
+
|
| 422 |
return (
|
| 423 |
<div className="flex-1 overflow-y-auto p-8">
|
| 424 |
+
<div className="max-w-3xl mx-auto space-y-8">
|
| 425 |
<div>
|
| 426 |
<h2 className="text-xl font-semibold flex items-center gap-2">
|
| 427 |
<FileCode className="h-5 w-5 text-primary" /> Run Branch Debug from VS Code
|
| 428 |
</h2>
|
| 429 |
<p className="text-sm text-muted-foreground mt-1">
|
| 430 |
+
Two ways to connect your editor: install the official VS Code extension, or use the lightweight terminal helper.
|
| 431 |
</p>
|
| 432 |
</div>
|
| 433 |
|
| 434 |
+
{/* Option A: Extension */}
|
| 435 |
+
<section className="rounded-xl border border-primary/40 bg-primary/5 p-6 space-y-4">
|
| 436 |
+
<div className="flex items-start justify-between gap-4">
|
| 437 |
+
<div>
|
| 438 |
+
<div className="text-[10px] uppercase tracking-widest text-primary font-mono">Recommended</div>
|
| 439 |
+
<h3 className="text-lg font-semibold mt-0.5">BranchDebug VS Code Extension</h3>
|
| 440 |
+
<p className="text-sm text-muted-foreground mt-1 max-w-xl">
|
| 441 |
+
Sidebar panel, inline highlights, and one-click navigation to every suspect line. Works with VS Code, Cursor, and other Code-based editors.
|
| 442 |
+
</p>
|
| 443 |
+
</div>
|
| 444 |
+
<Button onClick={downloadExtension} className="shrink-0">
|
| 445 |
+
<ExternalLink className="h-4 w-4 mr-2" /> Download .zip
|
| 446 |
+
</Button>
|
| 447 |
+
</div>
|
| 448 |
|
| 449 |
+
<div className="rounded-lg bg-[#0a0e15] border border-border p-4 text-xs text-foreground space-y-2">
|
| 450 |
+
<div className="text-[10px] uppercase tracking-widest text-muted-foreground font-mono">Install (unpacked)</div>
|
| 451 |
+
<ol className="list-decimal list-inside space-y-1 text-muted-foreground">
|
| 452 |
+
<li>Unzip the downloaded file.</li>
|
| 453 |
+
<li>In VS Code / Cursor, open the unzipped folder and run <code className="text-primary">npm install && npm run compile</code>.</li>
|
| 454 |
+
<li>Press <code className="text-primary">F5</code> to launch an Extension Development Host, or run <code className="text-primary">vsce package</code> and install the resulting <code className="text-primary">.vsix</code>.</li>
|
| 455 |
+
<li>Open the BranchDebug sidebar β set <code className="text-primary">serverUrl</code> to <code className="text-primary">{endpoint.replace("/api/public/branch-debug", "")}</code>.</li>
|
| 456 |
+
</ol>
|
| 457 |
+
</div>
|
| 458 |
|
| 459 |
+
<div className="grid sm:grid-cols-3 gap-2 text-[11px]">
|
| 460 |
+
<div className="rounded-md bg-surface/50 border border-border p-2">
|
| 461 |
+
<div className="font-mono text-primary">branchdebug.analyzeCurrentBranch</div>
|
| 462 |
+
<div className="text-muted-foreground mt-0.5">Run analysis on your current branch.</div>
|
| 463 |
+
</div>
|
| 464 |
+
<div className="rounded-md bg-surface/50 border border-border p-2">
|
| 465 |
+
<div className="font-mono text-primary">URI handler</div>
|
| 466 |
+
<div className="text-muted-foreground mt-0.5">Opens <code>branchdebug://</code> deep links.</div>
|
| 467 |
+
</div>
|
| 468 |
+
<div className="rounded-md bg-surface/50 border border-border p-2">
|
| 469 |
+
<div className="font-mono text-primary">Inline highlights</div>
|
| 470 |
+
<div className="text-muted-foreground mt-0.5">Suspect lines decorated in the editor.</div>
|
| 471 |
+
</div>
|
| 472 |
</div>
|
| 473 |
</section>
|
| 474 |
|
| 475 |
+
{/* Option B: CLI */}
|
| 476 |
+
<section className="space-y-3">
|
| 477 |
+
<div>
|
| 478 |
+
<div className="text-[10px] uppercase tracking-widest text-muted-foreground font-mono">Alternative</div>
|
| 479 |
+
<h3 className="text-base font-semibold mt-0.5">Terminal helper (no install)</h3>
|
| 480 |
+
<p className="text-xs text-muted-foreground mt-0.5">For CI, headless servers, or when you don't want an extension.</p>
|
| 481 |
+
</div>
|
| 482 |
+
<Block cmd={install} />
|
| 483 |
+
<Block cmd={run} />
|
| 484 |
+
<div className="grid sm:grid-cols-2 gap-2">
|
| 485 |
+
<Block cmd={runCursor} />
|
| 486 |
+
<Block cmd={runBase} />
|
| 487 |
+
</div>
|
| 488 |
</section>
|
| 489 |
|
| 490 |
<div className="rounded-lg border border-primary/30 bg-primary/5 p-4 text-xs text-muted-foreground flex gap-3">
|
| 491 |
<Shield className="h-4 w-4 text-primary shrink-0 mt-0.5" />
|
| 492 |
<div>
|
| 493 |
+
Both paths send your diff through the same IP Shield β identifiers tokenized, comments stripped, secrets blocked β before any AI sees it. Real file paths and line numbers are restored locally.
|
| 494 |
</div>
|
| 495 |
</div>
|
| 496 |
</div>
|