authorgravatar for WeldFire@users.noreply.github.comWeld <WeldFire@users.noreply.github.com> 2026-03-10 11:45:39-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-10 09:45:39-07:00
log9e891d2e97d65a6e211e3da8ee95807b9a091563
treeea1acb667a3dba6789361258326a67745593675e
parentb8d07eb852e5ea30717f4079595eb68515e930cf
signature Signed by PGP key B5690EEEBB952194

Display application version in sidebar and settings (#720)


6 files changed, 50 insertions(+), 11 deletions(-)

CLAUDE.md+1-1
......@@ -1 +1 @@
1AGENTS.md
\ No newline at end of file
1AGENTS.md
apps/web/src/branding.ts+1
......@@ -1,3 +1,4 @@
11export const APP_BASE_NAME = "T3 Code";
22export const APP_STAGE_LABEL = import.meta.env.DEV ? "Dev" : "Alpha";
33export const APP_DISPLAY_NAME = `${APP_BASE_NAME} (${APP_STAGE_LABEL})`;
4export const APP_VERSION = import.meta.env.APP_VERSION || "0.0.0";
apps/web/src/components/Sidebar.tsx+19-10
......@@ -39,7 +39,7 @@ import { useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/rea
3939import { useLocation, useNavigate, useParams } from "@tanstack/react-router";
4040import { useAppSettings } from "../appSettings";
4141import { isElectron } from "../env";
42import { APP_STAGE_LABEL } from "../branding";
42import { APP_STAGE_LABEL, APP_VERSION } from "../branding";
4343import { isMacPlatform, newCommandId, newProjectId, newThreadId } from "../lib/utils";
4444import { useStore } from "../store";
4545import { isChatNewLocalShortcut, isChatNewShortcut, shortcutLabelForCommand } from "../keybindings";
......@@ -1238,15 +1238,24 @@ export default function Sidebar() {
12381238 const wordmark = (
12391239 <div className="flex items-center gap-2">
12401240 <SidebarTrigger className="shrink-0 md:hidden" />
1241 <div className="flex min-w-0 flex-1 items-center gap-1 mt-1.5 ml-1">
1242 <T3Wordmark />
1243 <span className="truncate text-sm font-medium tracking-tight text-muted-foreground">
1244 Code
1245 </span>
1246 <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">
1247 {APP_STAGE_LABEL}
1248 </span>
1249 </div>
1241 <Tooltip>
1242 <TooltipTrigger
1243 render={
1244 <div className="flex min-w-0 flex-1 items-center gap-1 mt-1.5 ml-1 cursor-pointer">
1245 <T3Wordmark />
1246 <span className="truncate text-sm font-medium tracking-tight text-muted-foreground">
1247 Code
1248 </span>
1249 <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">
1250 {APP_STAGE_LABEL}
1251 </span>
1252 </div>
1253 }
1254 />
1255 <TooltipPopup side="bottom" sideOffset={2}>
1256 Version {APP_VERSION}
1257 </TooltipPopup>
1258 </Tooltip>
12501259 </div>
12511260 );
12521261
apps/web/src/routes/_chat.settings.tsx+19
......@@ -13,6 +13,7 @@ import { preferredTerminalEditor } from "../terminal-links";
1313import { Button } from "../components/ui/button";
1414import { Input } from "../components/ui/input";
1515import { Switch } from "../components/ui/switch";
16import { APP_VERSION } from "../branding";
1617import { SidebarInset } from "~/components/ui/sidebar";
1718
1819const THEME_OPTIONS = [
......@@ -554,6 +555,24 @@ function SettingsRouteView() {
554555 </div>
555556 ) : null}
556557 </section>
558 <section className="rounded-2xl border border-border bg-card p-5">
559 <div className="mb-4">
560 <h2 className="text-sm font-medium text-foreground">About</h2>
561 <p className="mt-1 text-xs text-muted-foreground">
562 Application version and environment information.
563 </p>
564 </div>
565
566 <div className="flex items-center justify-between rounded-lg border border-border bg-background px-3 py-2">
567 <div>
568 <p className="text-sm font-medium text-foreground">Version</p>
569 <p className="text-xs text-muted-foreground">
570 Current version of the application.
571 </p>
572 </div>
573 <code className="text-xs font-medium text-muted-foreground">{APP_VERSION}</code>
574 </div>
575 </section>
557576 </div>
558577 </div>
559578 </div>
apps/web/src/vite-env.d.ts+8
......@@ -2,6 +2,14 @@
22
33import type { NativeApi, DesktopBridge } from "@t3tools/contracts";
44
5interface ImportMetaEnv {
6 readonly APP_VERSION: string;
7}
8
9interface ImportMeta {
10 readonly env: ImportMetaEnv;
11}
12
513declare global {
614 interface Window {
715 nativeApi?: NativeApi;
apps/web/vite.config.ts+2
......@@ -2,6 +2,7 @@ import tailwindcss from "@tailwindcss/vite";
22import react from "@vitejs/plugin-react";
33import { tanstackRouter } from "@tanstack/router-plugin/vite";
44import { defineConfig } from "vite";
5import { version } from "./package.json" with { type: "json" };
56
67const port = Number(process.env.PORT ?? 5733);
78const sourcemapEnv = process.env.T3CODE_WEB_SOURCEMAP?.trim().toLowerCase();
......@@ -29,6 +30,7 @@ export default defineConfig({
2930 define: {
3031 // In dev mode, tell the web app where the WebSocket server lives
3132 "import.meta.env.VITE_WS_URL": JSON.stringify(process.env.VITE_WS_URL ?? ""),
33 "import.meta.env.APP_VERSION": JSON.stringify(version),
3234 },
3335 resolve: {
3436 tsconfigPaths: true,