feat(security): add global error boundary for defense in depth

- Adds `ErrorBoundary` component to catch unhandled React exceptions
- Prevents UI crashes (White Screen of Death)
- Ensures stack traces are not leaked to the user (Security Enhancement)
- Wraps `App` in `main.tsx`
- Adds tests verifying fallback UI and absence of error details in DOM

Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot]
2026-02-06 02:00:05 +00:00
parent 2587b9dd29
commit 0591157e35
5 changed files with 121 additions and 1 deletions

View File

@@ -1,9 +1,12 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { App } from './App';
import { ErrorBoundary } from './components/layout';
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
<ErrorBoundary>
<App />
</ErrorBoundary>
</StrictMode>
);