94444f4dcb
- Fix: 'Interaktives Terminal' im Cockpit führte ins Leere (#terminal) → Konsole - Mobile: Off-Canvas-Sidebar mit Hamburger unter md, Inhalt volle Breite (vorher: 240px starre Sidebar, 135px Rest mit Quer-Scroll auf dem Handy) - Dead Weight raus: src/mc3/ (verworfener Prototyp), DashboardView (alte Zentrale) + 6 nur dort genutzte Karten, 8 ungenutzte npm-Pakete (three, three-vrm, react-three fiber/drei, sigma, graphology ×2, @types/three) - Code-Splitting: alle Views außer Cockpit per React.lazy → Haupt-Bundle 983 → 739 KB, jede View ein eigenes Chunk - Fonts lokal (@fontsource) statt Google-CDN → UI offline identisch - Polling harmonisiert: EINE Takt-Tabelle in queries.ts (Graphen 3s, Rest 8-60s), keine Override-Intervalle mehr in Komponenten; Updates-Check (apt/git!) von 4s auf 60s - CSS-Hack-Layer aufgelöst: !important-Klassen-Sniffing → explizite .mc-card/.mc-card-sm/.nav-active-Klassen (Look identisch, ungeschichtete Regeln statt Utility-Raten); totes .light-Theme raus; Scrollbars 1× definiert - Aurora: animierte Fullscreen-Blur-Filter → statische radial-gradients (gleicher Look, keine Dauer-GPU-Last) - Sicherheit: Sudo-Passwort/HF-Token nur noch bei mutierenden Requests, nicht mehr auf jedem GET-Poll - Strg+K statt ⌘K auf Windows; dist neu gebaut Live gegen die Box verifiziert: alle 10 Views + Mobile-Flow, 0 Konsolen-Fehler. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import React from "react"
|
|
|
|
// Globale Error Boundary (Review F4): Ein JS-Fehler in einer View riss vorher die komplette
|
|
// App in einen weißen Screen. Hier: Fehler anzeigen + Neu-laden-Knopf, Rest bleibt bedienbar
|
|
// nach Reload. (GraphView hat zusätzlich seine eigene Boundary für Canvas-Crashes.)
|
|
interface State { error: Error | null }
|
|
|
|
export class AppErrorBoundary extends React.Component<React.PropsWithChildren, State> {
|
|
state: State = { error: null }
|
|
|
|
static getDerivedStateFromError(error: Error): State {
|
|
return { error }
|
|
}
|
|
|
|
componentDidCatch(error: Error, info: React.ErrorInfo) {
|
|
console.error("Unbehandelter UI-Fehler:", error, info.componentStack)
|
|
}
|
|
|
|
render() {
|
|
if (!this.state.error) return this.props.children
|
|
return (
|
|
<div className="min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8">
|
|
<div className="max-w-lg space-y-4 text-center">
|
|
<div className="text-2xl">Da ist etwas schiefgelaufen.</div>
|
|
<div className="text-sm text-neutral-400 break-all">
|
|
{this.state.error.message}
|
|
</div>
|
|
<button
|
|
className="px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700"
|
|
onClick={() => window.location.reload()}
|
|
>
|
|
Neu laden
|
|
</button>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
}
|