From de7964426336cda49463a0aec97aa1f4a5ecee4c Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 24 Feb 2026 14:01:55 +0000 Subject: [PATCH] story-kit: merge 144_story_add_build_timestamp_and_persist_chat_history_across_rebuilds --- frontend/src/components/ChatHeader.test.tsx | 5 +++++ frontend/src/components/ChatHeader.tsx | 22 +++++++++++++++++++++ frontend/src/vite-env.d.ts | 4 ++++ frontend/vite.config.ts | 1 + frontend/vitest.config.ts | 3 +++ 5 files changed, 35 insertions(+) diff --git a/frontend/src/components/ChatHeader.test.tsx b/frontend/src/components/ChatHeader.test.tsx index 454afc9..72f6f98 100644 --- a/frontend/src/components/ChatHeader.test.tsx +++ b/frontend/src/components/ChatHeader.test.tsx @@ -131,6 +131,11 @@ describe("ChatHeader", () => { expect(onToggleTools).toHaveBeenCalled(); }); + it("displays the build timestamp in human-readable format", () => { + render(); + expect(screen.getByText("Built: 2026-01-01 00:00")).toBeInTheDocument(); + }); + it("shows disabled placeholder when claudeModels is empty and no API key", () => { render(
+
+ {formatBuildTime(__BUILD_TIME__)} +
+
+declare global { + const __BUILD_TIME__: string; +} + declare module "react" { interface InputHTMLAttributes { webkitdirectory?: string; diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 37e2e17..8d968f9 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -8,6 +8,7 @@ export default defineConfig(() => { plugins: [react()], define: { __STORYKIT_PORT__: JSON.stringify(String(backendPort)), + __BUILD_TIME__: JSON.stringify(new Date().toISOString()), }, server: { port: backendPort + 2172, diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts index 633dc71..3cfc5ab 100644 --- a/frontend/vitest.config.ts +++ b/frontend/vitest.config.ts @@ -3,6 +3,9 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ plugins: [react()], + define: { + __BUILD_TIME__: JSON.stringify("2026-01-01T00:00:00.000Z"), + }, test: { environment: "jsdom", globals: true,