feat(frontend): error banners persist until manually dismissed

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 00:04:03 +02:00
parent a394bbb770
commit a2f24273ce

View File

@@ -6,6 +6,8 @@ export interface BannerEntry {
message: string; message: string;
} }
// Non-error banners clean themselves up; errors stay until the user
// dismisses them, so a failure can't silently vanish before it's read.
const DISMISS_AFTER_MS = 8000; const DISMISS_AFTER_MS = 8000;
let banners: BannerEntry[] = []; let banners: BannerEntry[] = [];
@@ -25,7 +27,9 @@ function show(severity: BannerSeverity, message: string): void {
const id = nextId++; const id = nextId++;
banners = [{ id, severity, message }, ...banners]; banners = [{ id, severity, message }, ...banners];
notify(); notify();
setTimeout(() => dismiss(id), DISMISS_AFTER_MS); if (severity !== "error") {
setTimeout(() => dismiss(id), DISMISS_AFTER_MS);
}
} }
export function showError(message: string): void { export function showError(message: string): void {