Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
Display application version in sidebar and settings (#720)
Weld9e891d2e97d6
diff --git a/CLAUDE.md b/CLAUDE.mdindex 47dc3e3d8..c31706425 120000--- a/CLAUDE.md+++ b/CLAUDE.md@@ -1 +1 @@-AGENTS.md\ No newline at end of file+AGENTS.mddiff --git a/apps/web/src/branding.ts b/apps/web/src/branding.tsindex 4adc50bc1..bffd98381 100644--- a/apps/web/src/branding.ts+++ b/apps/web/src/branding.ts@@ -1,3 +1,4 @@export const APP_BASE_NAME = "T3 Code";export const APP_STAGE_LABEL = import.meta.env.DEV ? "Dev" : "Alpha";export const APP_DISPLAY_NAME = `${APP_BASE_NAME} (${APP_STAGE_LABEL})`;+export const APP_VERSION = import.meta.env.APP_VERSION || "0.0.0";diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsxindex 6a07a667a..c067475ca 100644--- a/apps/web/src/components/Sidebar.tsx+++ b/apps/web/src/components/Sidebar.tsx@@ -39,7 +39,7 @@ import { useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/reaimport { useLocation, useNavigate, useParams } from "@tanstack/react-router";import { useAppSettings } from "../appSettings";import { isElectron } from "../env";-import { APP_STAGE_LABEL } from "../branding";+import { APP_STAGE_LABEL, APP_VERSION } from "../branding";import { isMacPlatform, newCommandId, newProjectId, newThreadId } from "../lib/utils";import { useStore } from "../store";import { isChatNewLocalShortcut, isChatNewShortcut, shortcutLabelForCommand } from "../keybindings";@@ -1238,15 +1238,24 @@ export default function Sidebar() {const wordmark = (<div className="flex items-center gap-2"><SidebarTrigger className="shrink-0 md:hidden" />- <div className="flex min-w-0 flex-1 items-center gap-1 mt-1.5 ml-1">- <T3Wordmark />- <span className="truncate text-sm font-medium tracking-tight text-muted-foreground">- Code- </span>- <span className="rounded-full bg-muted/50 px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.18em] text-muted-foreground/60">- {APP_STAGE_LABEL}- </span>- </div>+ <Tooltip>+ <TooltipTrigger+ render={+ <div className="flex min-w-0 flex-1 items-center gap-1 mt-1.5 ml-1 cursor-pointer">+ <T3Wordmark />+ <span className="truncate text-sm font-medium tracking-tight text-muted-foreground">+ Code+ </span>+ <span className="rounded-full bg-muted/50 px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.18em] text-muted-foreground/60">+ {APP_STAGE_LABEL}+ </span>+ </div>+ }+ />+ <TooltipPopup side="bottom" sideOffset={2}>+ Version {APP_VERSION}+ </TooltipPopup>+ </Tooltip></div>);diff --git a/apps/web/src/routes/_chat.settings.tsx b/apps/web/src/routes/_chat.settings.tsxindex 024553022..7e6fc56f7 100644--- a/apps/web/src/routes/_chat.settings.tsx+++ b/apps/web/src/routes/_chat.settings.tsx@@ -13,6 +13,7 @@ import { preferredTerminalEditor } from "../terminal-links";import { Button } from "../components/ui/button";import { Input } from "../components/ui/input";import { Switch } from "../components/ui/switch";+import { APP_VERSION } from "../branding";import { SidebarInset } from "~/components/ui/sidebar";const THEME_OPTIONS = [@@ -554,6 +555,24 @@ function SettingsRouteView() {</div>) : null}</section>+ <section className="rounded-2xl border border-border bg-card p-5">+ <div className="mb-4">+ <h2 className="text-sm font-medium text-foreground">About</h2>+ <p className="mt-1 text-xs text-muted-foreground">+ Application version and environment information.+ </p>+ </div>++ <div className="flex items-center justify-between rounded-lg border border-border bg-background px-3 py-2">+ <div>+ <p className="text-sm font-medium text-foreground">Version</p>+ <p className="text-xs text-muted-foreground">+ Current version of the application.+ </p>+ </div>+ <code className="text-xs font-medium text-muted-foreground">{APP_VERSION}</code>+ </div>+ </section></div></div></div>diff --git a/apps/web/src/vite-env.d.ts b/apps/web/src/vite-env.d.tsindex a7773ab27..c3a23ad40 100644--- a/apps/web/src/vite-env.d.ts+++ b/apps/web/src/vite-env.d.ts@@ -2,6 +2,14 @@import type { NativeApi, DesktopBridge } from "@t3tools/contracts";+interface ImportMetaEnv {+ readonly APP_VERSION: string;+}++interface ImportMeta {+ readonly env: ImportMetaEnv;+}+declare global {interface Window {nativeApi?: NativeApi;diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.tsindex d3715e766..637a61805 100644--- a/apps/web/vite.config.ts+++ b/apps/web/vite.config.ts@@ -2,6 +2,7 @@ import tailwindcss from "@tailwindcss/vite";import react from "@vitejs/plugin-react";import { tanstackRouter } from "@tanstack/router-plugin/vite";import { defineConfig } from "vite";+import { version } from "./package.json" with { type: "json" };const port = Number(process.env.PORT ?? 5733);const sourcemapEnv = process.env.T3CODE_WEB_SOURCEMAP?.trim().toLowerCase();@@ -29,6 +30,7 @@ export default defineConfig({define: {// In dev mode, tell the web app where the WebSocket server lives"import.meta.env.VITE_WS_URL": JSON.stringify(process.env.VITE_WS_URL ?? ""),+ "import.meta.env.APP_VERSION": JSON.stringify(version),},resolve: {tsconfigPaths: true,