Files
platform/src/apps/officer-web/frontend.tsx
T
pastilhasandClaude Opus 5 f3538cde25 delete the toaster that could never show a toast, and title the system settings page
`ui/toaster.tsx` was mounted in frontend.tsx and rendered a permanently empty
list: nothing anywhere imports `useToast`/`toast` from `ui/use-toast.ts`. The
app's real toaster is sonner, which is mounted beside it and has four callers.

`@radix-ui/react-toast` stays declared in the two package.json files on
purpose — installs are frozen, and dropping it means a deliberate
`bun install --no-frozen-lockfile` and a read of the lockfile diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 12:58:21 +00:00

48 lines
1.5 KiB
TypeScript

import './lib/console-buffer';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { App } from './App';
import { seedAppRegistry, seedWidgetRegistry } from 'officerdev';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ColorModeProvider } from '@/components/ui/ThemeProvider';
import { I18nBridge } from '@/lib/I18nBridge';
import { Toaster as Sonner } from 'sonner';
import { TooltipProvider } from '@/components/ui/tooltip';
import './styles/index.css';
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
},
},
});
// Before the first render, not from a component inside it: a panel that renders before its registry is
// populated draws an empty box, and `useGlobal`'s initialData gives no second chance to fill it.
seedAppRegistry(queryClient);
seedWidgetRegistry(queryClient);
const elem = document.getElementById('root')!;
const app = (
<StrictMode>
<QueryClientProvider client={queryClient}>
<ColorModeProvider>
<I18nBridge>
<TooltipProvider>
<Sonner position="top-center" toastOptions={{ style: { padding: '16px 20px', fontSize: '16px' } }} />
<App />
</TooltipProvider>
</I18nBridge>
</ColorModeProvider>
</QueryClientProvider>
</StrictMode>
);
if (import.meta.hot) {
const root = (import.meta.hot.data.root ??= createRoot(elem));
root.render(app);
} else {
createRoot(elem).render(app);
}