import { createRoot } from 'react-dom/client'; import { App } from './app/App'; import { initPanes, wirePanes } from './app/orchestration/panes'; import { initPreviewFitMode, wirePreviewFitMode } from './app/orchestration/preferences'; import { initSettings, wireSettings } from './app/orchestration/settings'; import { initApp } from './app/orchestration/startup'; import { initTheme, wireTheme } from './app/orchestration/theme'; import '../styles/base.css'; // Hydrate the persisted theme onto before first paint (no // FOUC), then keep store โ†” DOM โ†” localStorage in sync. Store stays DOM-free; // all browser access funnels through the orchestration + adapter. initTheme(); wireTheme(); // Hydrate + persist the small UI preferences (preview fit mode, pane widths) the // same way. Pane widths hydrate before render so the layout opens as left. initPreviewFitMode(); wirePreviewFitMode(); initPanes(); wirePanes(); // Hydrate + persist the full UserSettings record (editor / performance / // formatting) before render, so the editor, preview, and library read the user's // settings from the first paint (spec ยง07 โ†’ Startup load). initSettings(); wireSettings(); // Load the library from IndexedDB (seeding a sample on first run) and wire // persistence. Fire-and-forget: the UI renders immediately and fills in when // hydration resolves. void initApp(); createRoot(document.getElementById('app')!).render();