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.
This commit is contained in:
2026-08-25 13:34:42 +07:00
parent 8ce20e8163
commit 03a178a718
3 changed files with 2026 additions and 272 deletions
+1 -1
View File
@@ -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"
);
});
File diff suppressed because it is too large Load Diff