This commit is contained in:
Oleg Maslov
2026-09-02 10:14:22 +02:00
parent 0c3e2ead3b
commit b20b138fe4
771 changed files with 161561 additions and 9027 deletions

View File

@@ -0,0 +1,23 @@
import { createRoot } from 'react-dom/client';
import { flushSync } from 'react-dom';
import App from './App.tsx';
import './index.css';
import { applyStoredThemeEarly } from '@/providers/ThemeProvider';
export function mountApp(): void {
// Apply the persisted theme before first paint to avoid a flash of the wrong
// theme (warm graphite/dark default; warm paper for light).
applyStoredThemeEarly();
const rootElement = document.getElementById('root');
if (!rootElement) throw new Error('Waggle root element is missing');
flushSync(() => {
createRoot(rootElement).render(<App />);
});
rootElement.dataset.waggleUiReady = 'ready';
// Initialize PostHog cloud analytics (DAY0-04). Keep it off the startup path.
void import('@/lib/posthog')
.then(({ initPostHog }) => initPostHog())
.catch(() => {});
}