Skip to content

Commit bf5116c

Browse files
committed
feat: add ZIP download buttons to docs page and operations panel
Add "Download ZIP" button next to "Export All" on the docs page, and an "Export" button in the operations panel. Both link to the new GET /api/repos/{repo_id}/export endpoint.
1 parent 6054b7a commit bf5116c

2 files changed

Lines changed: 33 additions & 16 deletions

File tree

packages/web/src/app/repos/[id]/docs/page.tsx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { use, useState } from "react";
4-
import { Download, Loader2 } from "lucide-react";
4+
import { Download, FolderArchive, Loader2 } from "lucide-react";
55
import { Button } from "@/components/ui/button";
66
import { DocsExplorer } from "@/components/docs/docs-explorer";
77
import { listAllPages } from "@/lib/api/pages";
@@ -41,20 +41,27 @@ export default function DocsPage({
4141
Browse AI-generated documentation for every file, module, and symbol.
4242
</p>
4343
</div>
44-
<Button
45-
variant="outline"
46-
size="sm"
47-
onClick={handleExportAll}
48-
disabled={isExporting}
49-
className="shrink-0"
50-
>
51-
{isExporting ? (
52-
<Loader2 className="h-3.5 w-3.5 mr-1.5 animate-spin" />
53-
) : (
54-
<Download className="h-3.5 w-3.5 mr-1.5" />
55-
)}
56-
Export All
57-
</Button>
44+
<div className="flex gap-2 shrink-0">
45+
<Button
46+
variant="outline"
47+
size="sm"
48+
onClick={handleExportAll}
49+
disabled={isExporting}
50+
>
51+
{isExporting ? (
52+
<Loader2 className="h-3.5 w-3.5 mr-1.5 animate-spin" />
53+
) : (
54+
<Download className="h-3.5 w-3.5 mr-1.5" />
55+
)}
56+
Export All
57+
</Button>
58+
<Button variant="outline" size="sm" asChild>
59+
<a href={`/api/repos/${repoId}/export`} download>
60+
<FolderArchive className="h-3.5 w-3.5 mr-1.5" />
61+
Download ZIP
62+
</a>
63+
</Button>
64+
</div>
5865
</div>
5966

6067
{/* Explorer */}

packages/web/src/components/repos/operations-panel.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useState } from "react";
44
import { toast } from "sonner";
5-
import { RefreshCw, Zap, ChevronDown, ChevronUp, AlertTriangle } from "lucide-react";
5+
import { RefreshCw, Zap, ChevronDown, ChevronUp, AlertTriangle, Download } from "lucide-react";
66
import { syncRepo, fullResyncRepo } from "@/lib/api/repos";
77
import { Button } from "@/components/ui/button";
88
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
@@ -125,6 +125,16 @@ export function OperationsPanel({ repoId, repoName }: Props) {
125125
<RefreshCw className="h-3.5 w-3.5 mr-1.5" />
126126
{loading === "resync" ? "Starting…" : "Full Resync"}
127127
</Button>
128+
<Button
129+
variant="ghost"
130+
size="sm"
131+
asChild
132+
>
133+
<a href={`/api/repos/${repoId}/export`} download>
134+
<Download className="h-3.5 w-3.5 mr-1.5" />
135+
Export
136+
</a>
137+
</Button>
128138
</div>
129139
)}
130140
</CardContent>

0 commit comments

Comments
 (0)