From 03a178a718ae8c869f6ef40476731df16af55875 Mon Sep 17 00:00:00 2001 From: nntrivi2001 Date: Tue, 25 Aug 2026 13:34:42 +0700 Subject: [PATCH] feat(dashboard): default to Analytics tab; fix(test): unbreak jsdom localStorage under Node 22+ Dashboard now opens on the Analytics tab for first-time visitors (localStorage still wins once a user picks a tab). Also unbreaks the client test suite in this environment: Node 22+'s built-in --experimental-webstorage localStorage stub was shadowing jsdom's working one, failing every test that touches localStorage. Disabled via a Node-major-gated poolOptions.forks.execArgv so Node 20/21 test runs are unaffected. --- client/src/pages/Dashboard.tsx | 2 +- .../screens.snapshot.test.tsx.snap | 2280 +++++++++++++++-- client/vitest.config.ts | 16 + 3 files changed, 2026 insertions(+), 272 deletions(-) diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index eae23680..916a21b9 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -2330,7 +2330,7 @@ export function Dashboard() { // Persistent Tab State const [activeTab, setActiveTab] = useState<"monitor" | "analytics" | "health">(() => { return ( - (localStorage.getItem("dashboard_tab") as "monitor" | "analytics" | "health") || "monitor" + (localStorage.getItem("dashboard_tab") as "monitor" | "analytics" | "health") || "analytics" ); }); diff --git a/client/src/pages/__tests__/__snapshots__/screens.snapshot.test.tsx.snap b/client/src/pages/__tests__/__snapshots__/screens.snapshot.test.tsx.snap index 346b05e5..b44e4349 100644 --- a/client/src/pages/__tests__/__snapshots__/screens.snapshot.test.tsx.snap +++ b/client/src/pages/__tests__/__snapshots__/screens.snapshot.test.tsx.snap @@ -2558,7 +2558,7 @@ exports[`screen snapshots > Dashboard 1`] = ` class="flex bg-surface-2 rounded-lg p-0.5 border border-border" > + + + +
Total Sessions Dashboard 1`] = ` />
-
- - 0 - + 0 - - 0 active - -
+

+

+ 0 active +

- Active Agents + Total Agents Dashboard 1`] = ` />
-
- - 0 - -
-
-
-
- - Active Subagents - - - - - - - -
-
- - 0 - - - 0 in active sessions - -
-
-
-
- - Events Today - - - - -
-
- - 0 - + 0 -
+

+

+ 0 active +

- Total Events + Total Tokens Dashboard 1`] = ` width="24" xmlns="http://www.w3.org/2000/svg" > + + + + + + + + +
-
- - 0 - + 0 -
+

+

+ 0% cache hit rate +

Total Cost Dashboard 1`] = ` />
-
- - $0.00 - + $0.00 +

+

+ 0 Model +

+
+
+
+ + Total Events + + + +
+

+ + 0 + +

+

+ ~0 per session +

-
-

- Active Agents -

-
+ Event Activity - Last 52 Weeks +
- - - - - - - - +
+
+ Jun +
+
+ Jul +
+
+ Aug +
+
+ Sep +
+
+ Oct +
+
+ Nov +
+
+ Dec +
+
+ Jan +
+
+ Feb +
+
+ Mar +
+
+ Apr +
+
+ May +
+
+ Jun +
+
+
+
+
+ Sun +
+
+
+ Tue +
+
+
+ Thu +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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