Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

fix(web): resolve hydration mismatch and font preload warnings (v7.0.3)

Beenu565936fbd326
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a6ff9ddfe..0650667cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,25 @@ All notable changes to AiSOC will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [7.0.3] — 2026-05-10
+
+### Fixed — Hydration mismatch, font preload warnings
+
+#### Web app (`apps/web/`)
+
+- **`src/components/layout/AppShell.tsx`**: Wrapped `<DemoBanner />` in a new
+ `<ClientOnly>` boundary so the banner (which reads `NEXT_PUBLIC_DEMO_MODE`)
+ is never server-rendered. This eliminates React hydration error #418 caused by
+ stale env-var inlining producing a structural tree mismatch (server saw
+ `<button>` from Sidebar, client expected `<div>` from DemoBanner).
+- **`src/app/layout.tsx`**: Added `preload: false` to the `JetBrains_Mono`
+ `next/font/google` config. The monospace font is only used in code blocks and
+ is not needed on the initial paint of most pages, causing Chrome to log
+ "preloaded but not used within a few seconds" warnings. Lazy-loading the font
+ eliminates these warnings without any visible FOUT.
+
+---
+
## [7.0.2] — 2026-05-10
### Fixed — Version alignment, landing-page footer, documentation
diff --git a/README.md b/README.md
index 64f55c86c..c53e88cdf 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ An open-source, self-hostable AI SOC. The agent's prompts, tool calls, and ratio
[![License: MIT](https://img.shields.io/badge/License-MIT-22c55e.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![Public eval harness: CI-gated](https://img.shields.io/badge/eval%20harness-CI--gated-2563eb?style=flat-square)](apps/docs/docs/benchmark.md)
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-8b5cf6?style=flat-square)](CONTRIBUTING.md)
-[![Version](https://img.shields.io/badge/version-7.0.2-f59e0b?style=flat-square)](CHANGELOG.md)
+[![Version](https://img.shields.io/badge/version-7.0.3-f59e0b?style=flat-square)](CHANGELOG.md)
[Live demo](https://tryaisoc.com) · [How AiSOC compares](#how-aisoc-compares) · [Public eval harness](apps/docs/docs/benchmark.md) · [Deploy in 60 seconds](#deploy-in-60-seconds) · [Deployment options](#deployment-options) · [Architecture](#architecture) · [Docs](apps/docs/)
diff --git a/apps/web/package.json b/apps/web/package.json
index c5cf40794..f03c9a5bd 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -1,6 +1,6 @@
{
"name": "@aisoc/web",
- "version": "7.0.2",
+ "version": "7.0.3",
"private": true,
"description": "AiSOC SOC Console - Next.js 14 Frontend",
"license": "MIT",
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx
index d2c8fe6cf..6e0b74cd9 100644
--- a/apps/web/src/app/layout.tsx
+++ b/apps/web/src/app/layout.tsx
@@ -17,6 +17,9 @@ const jetbrainsMono = JetBrains_Mono({
subsets: ['latin'],
variable: '--font-mono',
display: 'swap',
+ // Only load on demand — monospace font is used in code blocks, not every page,
+ // so preloading eagerly causes "preloaded but unused" browser warnings.
+ preload: false,
});
const siteUrl = getPublicSiteUrl();
diff --git a/apps/web/src/components/layout/AppShell.tsx b/apps/web/src/components/layout/AppShell.tsx
index 822ea3d21..a962846e6 100644
--- a/apps/web/src/components/layout/AppShell.tsx
+++ b/apps/web/src/components/layout/AppShell.tsx
@@ -38,7 +38,16 @@ export function AppShell({ children }: AppShellProps) {
*/}
<DemoAutoLogin />
<div className="min-h-screen bg-surface-base">
- <DemoBanner />
+ {/*
+ DemoBanner reads `NEXT_PUBLIC_DEMO_MODE`, a build-time env var.
+ In development the client bundle can have a stale inlined value that
+ differs from the SSR process.env read, producing React hydration
+ error #418. Wrapping in ClientOnly defers the banner to after mount
+ so both paints see the same value (client-only, post-hydration).
+ */}
+ <ClientOnly>
+ <DemoBanner />
+ </ClientOnly>
<Sidebar />
<div className="md:ml-60">
<TopBar demoOffset={demo} />