Files
learnharness/app/layout.tsx
T
amosblomqvist fe88fa87ec Tree panel mode lives in the root layout: no open-then-close on session open
The persisted mode (lh:tree-panel-mode) was read inside TreePanel — a
per-page component that remounts on every session navigation. First
paint rendered the SSR-safe "list" default, then the mount effect
applied the stored mode: with the animated frame, opening a session
visibly opened the panel and then closed it. The mode now lives in a
root-layout provider (the SidebarProvider pattern) and survives
navigations untouched — the panel mounts already in the right mode.
The default stays "list" so SSR and first client render agree; the
stored preference applies once, on provider mount.
2026-09-02 02:43:28 +03:00

25 lines
742 B
TypeScript

import type { Metadata } from "next";
import "katex/dist/katex.min.css";
import "./globals.css";
import { AppShell, SidebarProvider } from "@/components/sidebar";
import { TreePanelModeProvider } from "@/components/tree-panel";
export const metadata: Metadata = {
title: "Learning Harness",
description: "A teacher agent with a memory — sessions, quizzes, and a knowledge graph of what you know.",
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" className="dark">
<body className="min-h-dvh antialiased">
<SidebarProvider>
<TreePanelModeProvider>
<AppShell>{children}</AppShell>
</TreePanelModeProvider>
</SidebarProvider>
</body>
</html>
);
}