From e956753a38068278ab7141bd76688092690c8730 Mon Sep 17 00:00:00 2001 From: 7418 <7418@openclaw.ai> Date: Sun, 8 Feb 2026 21:02:39 +0800 Subject: [PATCH] feat: add version display, cache clearing on upgrade, exclude data dir - Show app version (v0.4.0) in sidebar bottom - Clear Electron web cache when version changes to prevent stale JS - Exclude data/ directory from packaged app Co-Authored-By: Claude Opus 4.6 --- electron-builder.yml | 1 + next.config.ts | 7 +++++++ src/components/layout/ChatListPanel.tsx | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/electron-builder.yml b/electron-builder.yml index 404f00d..7377a15 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -12,6 +12,7 @@ files: - "!scripts" - "!docs" - "!release" + - "!data" extraResources: - from: .next/standalone/ to: standalone/ diff --git a/next.config.ts b/next.config.ts index 4d3e2af..f9e67bc 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,8 +1,15 @@ import type { NextConfig } from "next"; +import { createRequire } from "module"; + +const require = createRequire(import.meta.url); +const pkg = require("./package.json"); const nextConfig: NextConfig = { output: 'standalone', serverExternalPackages: ['better-sqlite3'], + env: { + NEXT_PUBLIC_APP_VERSION: pkg.version, + }, }; export default nextConfig; diff --git a/src/components/layout/ChatListPanel.tsx b/src/components/layout/ChatListPanel.tsx index 99794e5..96a76ba 100644 --- a/src/components/layout/ChatListPanel.tsx +++ b/src/components/layout/ChatListPanel.tsx @@ -282,6 +282,13 @@ export function ChatListPanel({ open }: ChatListPanelProps) { )} + + {/* Version */} +
+ + v{process.env.NEXT_PUBLIC_APP_VERSION} + +
); }