From 52f9339917948063f508d08e1c95f2f6301f05ac Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:13:56 +0330 Subject: [PATCH] Import source: src/App Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- src/App.tsx | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/App.tsx diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..2189409 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,71 @@ +import { useEffect, useState } from "react"; +import TitleBar from "./components/TitleBar"; +import { getWorkspaceMeta, updateWorkspaceMeta } from "./db"; +import { applyTheme, useUi } from "./store/ui"; + +export default function App() { + const { theme, sidebarWidth, sidebarCollapsed } = useUi(); + const [dbStatus, setDbStatus] = useState("connecting…"); + + // Theme handling (system-aware) + useEffect(() => { + applyTheme(theme); + const mq = window.matchMedia("(prefers-color-scheme: dark)"); + const onChange = () => applyTheme(theme); + mq.addEventListener("change", onChange); + return () => mq.removeEventListener("change", onChange); + }, [theme]); + + // M0 smoke test: SQLite round-trip through the migration-created table + useEffect(() => { + (async () => { + try { + const meta = await getWorkspaceMeta(); + await updateWorkspaceMeta({ name: meta.name }); // write round-trip + setDbStatus( + `SQLite OK — workspace “${meta.name}”, onboarded=${meta.onboarded}`, + ); + } catch (e) { + setDbStatus(`SQLite ERROR: ${String(e)}`); + } + })(); + }, []); + + return ( +
+ +
+ {/* Sidebar (placeholder — page tree lands in Milestone 1) */} + {!sidebarCollapsed && ( + + )} + + {/* Content area */} +
+
+

+ Notara +

+

+ Milestone 0 shell — Tauri v2 · React · SQLite · Notion tokens. +

+

{dbStatus}

+
+
+
+
+ ); +}