import { Component, type ReactNode, type ErrorInfo } from 'react'; import { RotateCcw, AlertOctagon, Trash2 } from 'lucide-react'; interface RootErrorBoundaryProps { children: ReactNode; } interface RootErrorBoundaryState { hasError: boolean; error: Error | null; } export default class RootErrorBoundary extends Component< RootErrorBoundaryProps, RootErrorBoundaryState > { constructor(props: RootErrorBoundaryProps) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error: Error): RootErrorBoundaryState { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error('[RootErrorBoundary] Fatal system error caught at OS root:', error, errorInfo); } handleReboot = () => { window.location.reload(); }; handleHardReset = () => { try { localStorage.clear(); sessionStorage.clear(); } catch (_) {} window.location.reload(); }; render() { if (this.state.hasError) { return (
STOP: 0x000000D1 • DESKTOP_THREAD_EXCEPTION
A recoverable exception occurred in the primary desktop shell. Your local data and progress records are safely preserved in storage.
{/* Action Bar */}