feat: enhance canvas and node components with error handling and retry logic

- Integrated retry logic for AI image generation to handle transient errors and improve user experience.
- Updated error categorization to provide more informative feedback based on different failure scenarios.
- Enhanced node components to display retry attempts and error messages, improving visibility during image generation failures.
- Refactored canvas and node components to include retry count in status updates, ensuring accurate tracking of generation attempts.
This commit is contained in:
Matthias
2026-03-27 11:35:18 +01:00
parent 99a359f330
commit 5da0204163
28 changed files with 1180 additions and 35 deletions

40
app/global-error.tsx Normal file
View File

@@ -0,0 +1,40 @@
"use client";
import { Button } from "@/components/ui/button";
type GlobalErrorProps = {
error: Error & { digest?: string };
unstable_retry: () => void;
};
export default function GlobalError({
error,
unstable_retry,
}: GlobalErrorProps) {
return (
<html lang="de" className="h-full antialiased font-sans">
<body className="min-h-full bg-background text-foreground">
<main className="flex min-h-screen items-center justify-center px-4">
<div className="w-full max-w-md space-y-4 rounded-xl border bg-card p-6 shadow-sm">
<div className="space-y-1 text-center">
<h1 className="text-xl font-semibold">Schwerer Fehler</h1>
<p className="text-sm text-muted-foreground">
Die Anwendung konnte nicht dargestellt werden. Lade den Bereich
neu, um fortzufahren.
</p>
{error.digest ? (
<p className="text-xs text-muted-foreground/80">
Fehler-ID: {error.digest}
</p>
) : null}
</div>
<Button className="w-full" onClick={() => unstable_retry()}>
Erneut laden
</Button>
</div>
</main>
</body>
</html>
);
}