From b72bfbb5b486399ccb900200c1fec18340e787c2 Mon Sep 17 00:00:00 2001 From: xcaliber Date: Sat, 21 Feb 2026 13:53:36 +0000 Subject: [PATCH] Changeset 0.7.0.13 (#38) --- Dockerfile | 8 +++++++- Dockerfile.frontend | 1 + docker-entrypoint-fe.sh | 9 ++++++++- server/Dockerfile | 4 +++- src/css/styles.css | 5 +++-- src/index.html | 21 +++++++++++---------- src/js/api.js | 2 +- src/js/app.js | 2 +- src/js/events.js | 2 +- src/js/ui.js | 8 ++++++-- 10 files changed, 42 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 915bdd4..0a07d3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,9 @@ FROM golang:1.22-bookworm AS backend WORKDIR /app COPY server/go.mod server/go.sum* ./ COPY server/ . +COPY VERSION ./ RUN go mod download && go mod tidy && go mod verify -RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /bin/switchboard . +RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=$(cat VERSION)" -o /bin/switchboard . # ── Stage 2: Vendor JS libs ───────────────── FROM node:20-alpine AS vendor @@ -43,6 +44,11 @@ COPY --from=backend /bin/switchboard /usr/local/bin/switchboard # Frontend static files COPY src/ /usr/share/nginx/html/ +COPY VERSION /VERSION + +# Inject version into index.html at build time +RUN APP_VERSION=$(cat /VERSION | tr -d '[:space:]') && \ + sed -i "s|%%APP_VERSION%%|${APP_VERSION}|g" /usr/share/nginx/html/index.html # Vendor libs (overwrite any existing copies in src/vendor/) COPY --from=vendor /vendor/marked.min.js /usr/share/nginx/html/vendor/marked.min.js diff --git a/Dockerfile.frontend b/Dockerfile.frontend index 0489064..eeffb03 100644 --- a/Dockerfile.frontend +++ b/Dockerfile.frontend @@ -31,6 +31,7 @@ RUN rm -f /etc/nginx/conf.d/default.conf COPY src/ /usr/share/nginx/html/ COPY --from=vendor /vendor/ /usr/share/nginx/html/vendor/ +COPY VERSION /VERSION COPY docker-entrypoint-fe.sh /docker-entrypoint-fe.sh RUN chmod +x /docker-entrypoint-fe.sh diff --git a/docker-entrypoint-fe.sh b/docker-entrypoint-fe.sh index e354cf1..0d2d18c 100644 --- a/docker-entrypoint-fe.sh +++ b/docker-entrypoint-fe.sh @@ -13,6 +13,12 @@ set -e BASE_PATH="${BASE_PATH:-}" +# Read version from VERSION file (baked in at build time) +APP_VERSION="dev" +if [ -f /VERSION ]; then + APP_VERSION=$(cat /VERSION | tr -d '[:space:]') +fi + # Compute base href (needs trailing slash for tag) if [ -z "${BASE_PATH}" ]; then BASE_HREF="/" @@ -24,9 +30,10 @@ fi sed -i \ -e "s|%%BASE_PATH%%|${BASE_PATH}|g" \ -e "s|%%BASE_HREF%%|${BASE_HREF}|g" \ + -e "s|%%APP_VERSION%%|${APP_VERSION}|g" \ /usr/share/nginx/html/index.html -echo "✅ Frontend configured: BASE_PATH=${BASE_PATH:-/}" +echo "✅ Frontend configured: BASE_PATH=${BASE_PATH:-/} VERSION=${APP_VERSION}" # ── Generate nginx config ─────────────────── # If BASE_PATH is set, serve under that prefix with alias. diff --git a/server/Dockerfile b/server/Dockerfile index 4a43a41..0eec876 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -8,6 +8,8 @@ # Build stage FROM golang:1.22-bookworm AS builder +ARG APP_VERSION=dev + WORKDIR /app # Copy module files and download deps @@ -17,7 +19,7 @@ RUN go mod download # Copy source and tidy (resolves any go.sum gaps) COPY . . RUN go mod tidy -RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /bin/switchboard . +RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=${APP_VERSION}" -o /bin/switchboard . # Runtime stage FROM debian:bookworm-slim diff --git a/src/css/styles.css b/src/css/styles.css index 3023cae..63712d5 100644 --- a/src/css/styles.css +++ b/src/css/styles.css @@ -1,7 +1,7 @@ @import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap'); /* ========================================== - Chat Switchboard v0.6.1 + Chat Switchboard Clean utility layout · Open WebUI inspired ========================================== */ @@ -67,8 +67,9 @@ a:hover { text-decoration: underline; } padding: 2px 0; line-height: 1.4; background: var(--banner-bg); color: var(--banner-fg); flex-shrink: 0; z-index: 9999; + min-height: 22px; box-sizing: border-box; } -.banner.active { display: block; } +.banner.active { display: flex; align-items: center; justify-content: center; } .banner-top { order: -1; } .banner-bottom { order: 999; } diff --git a/src/index.html b/src/index.html index b66bae4..08e7249 100644 --- a/src/index.html +++ b/src/index.html @@ -5,11 +5,12 @@ + Chat Switchboard - + @@ -161,7 +162,7 @@
✈️ Air-gap ready
🧠 Thinking blocks
-
v0.6.2
+
v%%APP_VERSION%%
@@ -240,13 +241,13 @@

Display

- -
80%100%130%
+ +
80%150%
-
12px14px20px
+
12px20px
@@ -440,10 +441,10 @@ - - - - - + + + + + diff --git a/src/js/api.js b/src/js/api.js index 1d0d550..b95c476 100644 --- a/src/js/api.js +++ b/src/js/api.js @@ -1,5 +1,5 @@ // ========================================== -// Chat Switchboard – API Client (v0.7.0) +// Chat Switchboard – API Client // ========================================== // Backend-only mode. Handles auth tokens and // all HTTP calls. No offline fallback. diff --git a/src/js/app.js b/src/js/app.js index a6888b5..7a160b1 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,5 +1,5 @@ // ========================================== -// Chat Switchboard – Application (v0.6.1) +// Chat Switchboard – Application // ========================================== const App = { diff --git a/src/js/events.js b/src/js/events.js index 85aa510..4c9a885 100644 --- a/src/js/events.js +++ b/src/js/events.js @@ -1,5 +1,5 @@ // ========================================== -// Chat Switchboard – EventBus (v0.5.3) +// Chat Switchboard – EventBus // ========================================== // Labeled event bus with WebSocket bridge. // Components subscribe by label (supports * wildcard). diff --git a/src/js/ui.js b/src/js/ui.js index 49cebaa..92bcbd0 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -1,5 +1,5 @@ // ========================================== -// Chat Switchboard – UI (v0.6.1) +// Chat Switchboard – UI // ========================================== const UI = { @@ -466,7 +466,11 @@ const UI = { }, applyAppearance(scale, msgFont) { - document.documentElement.style.zoom = scale / 100; + const z = scale === 100 ? '' : scale / 100; + // Zoom content areas + modals (but NOT .app or banners) + document.querySelectorAll('.sidebar, .chat-area, .modal-overlay').forEach(el => el.style.zoom = z); + const splash = document.getElementById('splashGate'); + if (splash) splash.style.zoom = z; document.documentElement.style.setProperty('--msg-font', msgFont + 'px'); localStorage.setItem('cs-appearance', JSON.stringify({ scale, msgFont })); },