From f813ad06f61ad6146698d82c4aed4b3a8e90dc5d Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Thu, 18 Dec 2025 02:27:35 -0500 Subject: [PATCH] feat(ui): add copilot-api install button and version display - add CopilotInfo type and install mutation to useCopilot hook - show version in status card when installed - add Install button with loading state when not installed --- .../copilot/copilot-status-card.tsx | 22 +++++++- ui/src/hooks/use-copilot.ts | 53 +++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/ui/src/components/copilot/copilot-status-card.tsx b/ui/src/components/copilot/copilot-status-card.tsx index f2a7866a..a877d3d8 100644 --- a/ui/src/components/copilot/copilot-status-card.tsx +++ b/ui/src/components/copilot/copilot-status-card.tsx @@ -8,7 +8,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { useCopilot } from '@/hooks/use-copilot'; -import { CheckCircle2, XCircle, AlertTriangle, Loader2 } from 'lucide-react'; +import { CheckCircle2, XCircle, AlertTriangle, Loader2, Download } from 'lucide-react'; export function CopilotStatusCard() { const { @@ -20,6 +20,8 @@ export function CopilotStatusCard() { isStartingDaemon, stopDaemon, isStoppingDaemon, + install, + isInstalling, } = useCopilot(); if (statusLoading) { @@ -80,7 +82,7 @@ export function CopilotStatusCard() { )} - copilot-api {status.installed ? 'Installed' : 'Not Installed'} + copilot-api {status.installed ? `v${status.version}` : 'Not Installed'} @@ -116,6 +118,22 @@ export function CopilotStatusCard() { {/* Actions */}
+ {!status.installed && ( + + )} + {!status.authenticated && (