From 2ec157e160409909c755939ef3ee72633634db75 Mon Sep 17 00:00:00 2001 From: Andrew S Erwin Date: Thu, 5 Nov 2026 13:26:12 -0600 Subject: [PATCH] Show the release version in the sidebar footer Baked at image build time: web/Dockerfile takes ARG SUPERBRAIN_VERSION (default dev) into NEXT_PUBLIC_SUPERBRAIN_VERSION; the release workflow passes the tag, README Option B gains the matching --build-arg, and local compose builds show 'dev build'. Rendered muted under the sidebar footer when expanded, so any deployment can be identified from the UI alone. --- .github/workflows/release.yml | 2 ++ README.md | 1 + web/Dockerfile | 6 +++++- web/components/sidebar.tsx | 11 +++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5306138..69e8f02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,6 +117,8 @@ jobs: file: web/Dockerfile platforms: linux/amd64,linux/arm64 push: true + # Bakes the release tag into the client bundle (sidebar footer). + build-args: SUPERBRAIN_VERSION=${{ github.ref_name }} tags: | federatedcomputer/superbrain-web:${{ github.ref_name }} federatedcomputer/superbrain-web:latest diff --git a/README.md b/README.md index db540ba..dd95bf3 100644 --- a/README.md +++ b/README.md @@ -490,6 +490,7 @@ V=1.2.3 docker buildx build --platform linux/amd64,linux/arm64 --push \ -t federatedcomputer/superbrain-app:$V -t federatedcomputer/superbrain-app:latest . docker buildx build --platform linux/amd64,linux/arm64 --push \ + --build-arg SUPERBRAIN_VERSION=$V \ -t federatedcomputer/superbrain-web:$V -t federatedcomputer/superbrain-web:latest web docker buildx build --platform linux/amd64,linux/arm64 --push \ --build-context deploy=deploy/federated \ diff --git a/web/Dockerfile b/web/Dockerfile index 923233d..b64f8bd 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -8,7 +8,11 @@ FROM node:22.23.3-alpine3.24 AS build WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . -ENV NEXT_TELEMETRY_DISABLED=1 +# Release version baked into the client bundle (sidebar footer). The release +# workflow passes the tag as SUPERBRAIN_VERSION; every other build keeps the +# default and the UI shows "dev build". +ARG SUPERBRAIN_VERSION=dev +ENV NEXT_TELEMETRY_DISABLED=1 NEXT_PUBLIC_SUPERBRAIN_VERSION=$SUPERBRAIN_VERSION RUN yarn build FROM node:22.23.3-alpine3.24 AS runtime diff --git a/web/components/sidebar.tsx b/web/components/sidebar.tsx index 96dec87..a171336 100644 --- a/web/components/sidebar.tsx +++ b/web/components/sidebar.tsx @@ -3,6 +3,12 @@ import Link from 'next/link' import { useRouter, useSearchParams } from 'next/navigation' import { Suspense, useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react' + +// Release version baked into the client bundle at image build time +// (web/Dockerfile ARG SUPERBRAIN_VERSION; CI passes the tag, local builds +// keep "dev"). Shown in the sidebar footer so any deployment can be +// identified from the UI alone. +const APP_VERSION = process.env.NEXT_PUBLIC_SUPERBRAIN_VERSION || '' import { cn } from '@/lib/utils' import { Calendar, Tags, Users, Kanban, Link2, Settings, ChevronLeft, ChevronRight, ChevronDown, @@ -110,6 +116,11 @@ export function Sidebar({ open, onToggle, onQuickFind, pathname, isAdmin = false + {open && APP_VERSION && ( +

+ {APP_VERSION === 'dev' ? 'dev build' : `v${APP_VERSION}`} +

+ )} )