feat(frontend): error banners persist until manually dismissed
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,8 @@ export interface BannerEntry {
|
||||
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;
|
||||
|
||||
let banners: BannerEntry[] = [];
|
||||
@@ -25,7 +27,9 @@ function show(severity: BannerSeverity, message: string): void {
|
||||
const id = nextId++;
|
||||
banners = [{ id, severity, message }, ...banners];
|
||||
notify();
|
||||
setTimeout(() => dismiss(id), DISMISS_AFTER_MS);
|
||||
if (severity !== "error") {
|
||||
setTimeout(() => dismiss(id), DISMISS_AFTER_MS);
|
||||
}
|
||||
}
|
||||
|
||||
export function showError(message: string): void {
|
||||
|
||||
Reference in New Issue
Block a user