graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
gui: add Settings → Updates (version + Check for updates) + bump to 0.0.164
Rach Pradhan4d0845e38ada
diff --git a/gui/package.json b/gui/package.jsonindex 1bf0e231..d86b19d5 100644--- a/gui/package.json+++ b/gui/package.json@@ -1,7 +1,7 @@{"name": "codegraff-gui","private": true,- "version": "0.0.163",+ "version": "0.0.164","license": "Apache-2.0","packageManager": "[email protected]","type": "module",diff --git a/gui/src-tauri/Cargo.lock b/gui/src-tauri/Cargo.lockindex 5ff48682..e197f218 100644--- a/gui/src-tauri/Cargo.lock+++ b/gui/src-tauri/Cargo.lock@@ -655,7 +655,7 @@ checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901"[[package]]name = "codegraff-gui"-version = "0.0.163"+version = "0.0.164"dependencies = ["anyhow","async-trait",diff --git a/gui/src-tauri/Cargo.toml b/gui/src-tauri/Cargo.tomlindex f991774a..388131bc 100644--- a/gui/src-tauri/Cargo.toml+++ b/gui/src-tauri/Cargo.toml@@ -6,7 +6,7 @@[package]name = "codegraff-gui"-version = "0.0.163"+version = "0.0.164"description = "Desktop coding agent interface powered by Codegraff"authors = ["Codegraff contributors"]license = "Apache-2.0"diff --git a/gui/src-tauri/tauri.conf.json b/gui/src-tauri/tauri.conf.jsonindex fb84ae68..cc73996d 100644--- a/gui/src-tauri/tauri.conf.json+++ b/gui/src-tauri/tauri.conf.json@@ -1,7 +1,7 @@{"$schema": "../node_modules/@tauri-apps/cli/config.schema.json","productName": "Codegraff",- "version": "0.0.163",+ "version": "0.0.164","identifier": "dev.codegraff.gui","build": {"frontendDist": "../dist",diff --git a/gui/src/components/general-settings/GeneralSettingsPane.tsx b/gui/src/components/general-settings/GeneralSettingsPane.tsxindex 5a028adc..4b2dcf87 100644--- a/gui/src/components/general-settings/GeneralSettingsPane.tsx+++ b/gui/src/components/general-settings/GeneralSettingsPane.tsx@@ -8,6 +8,7 @@ import { PaneSurface } from "@/components/ui/PaneSurface";import { cn } from "@/utils/cn";import { THEME_PRESETS } from "./constants/themePresets";+import { UpdatesCard } from "./UpdatesCard";const MODE_OPTIONS: { value: ThemeMode; label: string; icon: typeof SunIcon }[] =[@@ -77,6 +78,8 @@ export function GeneralSettingsPane() {</div></CardContent></Card>++ <UpdatesCard /></div></PaneSurface>);diff --git a/gui/src/components/general-settings/UpdatesCard.tsx b/gui/src/components/general-settings/UpdatesCard.tsxnew file mode 100644index 00000000..b60e243b--- /dev/null+++ b/gui/src/components/general-settings/UpdatesCard.tsx@@ -0,0 +1,119 @@+import { useEffect, useState } from "react";+import { getVersion } from "@tauri-apps/api/app";+import { relaunch } from "@tauri-apps/plugin-process";+import { check, type Update } from "@tauri-apps/plugin-updater";+import { DownloadIcon, RefreshCwIcon } from "lucide-react";++import { Button } from "@/components/ui/Button";+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card";++type Status =+ | { kind: "idle" }+ | { kind: "checking" }+ | { kind: "upToDate" }+ | { kind: "available"; update: Update }+ | { kind: "installing" }+ | { kind: "error"; message: string };++/**+ * Manual update control for the desktop app. The app also auto-checks on launch+ * (see services/updater.ts), but this gives a discoverable "Check for updates"+ * button plus the current version, and installs in-place via the Tauri updater.+ */+export function UpdatesCard() {+ const [version, setVersion] = useState("");+ const [status, setStatus] = useState<Status>({ kind: "idle" });++ useEffect(() => {+ getVersion()+ .then(setVersion)+ .catch(() => {});+ }, []);++ async function handleCheck() {+ setStatus({ kind: "checking" });+ try {+ const update = await check();+ setStatus(update ? { kind: "available", update } : { kind: "upToDate" });+ } catch (err) {+ setStatus({ kind: "error", message: String(err) });+ }+ }++ async function handleInstall() {+ if (status.kind !== "available") {+ return;+ }+ const { update } = status;+ setStatus({ kind: "installing" });+ try {+ await update.downloadAndInstall();+ await relaunch();+ } catch (err) {+ setStatus({ kind: "error", message: String(err) });+ }+ }++ const busy = status.kind === "checking" || status.kind === "installing";++ return (+ <Card>+ <CardHeader>+ <CardTitle>Updates</CardTitle>+ </CardHeader>+ <CardContent className="flex items-center justify-between gap-3">+ <div className="flex min-w-0 flex-col">+ <span className="text-sm text-foreground">+ Codegraff{version ? ` ${version}` : ""}+ </span>+ <span className="text-xs text-muted-foreground">+ {statusText(status)}+ </span>+ </div>+ {status.kind === "available" ? (+ <Button+ type="button"+ size="sm"+ onClick={handleInstall}+ disabled={busy}+ >+ <DownloadIcon data-icon="inline-start" strokeWidth={2} />+ Install & relaunch+ </Button>+ ) : (+ <Button+ type="button"+ size="sm"+ variant="secondary"+ onClick={handleCheck}+ disabled={busy}+ >+ <RefreshCwIcon+ data-icon="inline-start"+ strokeWidth={2}+ className={status.kind === "checking" ? "animate-spin" : undefined}+ />+ Check for updates+ </Button>+ )}+ </CardContent>+ </Card>+ );+}++function statusText(status: Status): string {+ switch (status.kind) {+ case "checking":+ return "Checking for updates…";+ case "upToDate":+ return "You're on the latest version.";+ case "available":+ return `Version ${status.update.version} is available.`;+ case "installing":+ return "Downloading and installing…";+ case "error":+ return `Couldn't check for updates: ${status.message}`;+ default:+ return "Updates install automatically on launch; check manually any time.";+ }+}