Add a visible toast stack, fix presentError double-notify, wire density and auto-refresh settings, gate destructive confirms, improve empty/skeleton/search on resource lists, and enable browser history plus keyboard palette navigation.
This commit is contained in:
+6
-14
@@ -91,24 +91,16 @@ function stripPrefix(message) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Present error via toast + optional notification.
|
||||
* Present error via toast (showAlert already writes the notification tray).
|
||||
* Do not call notificationManager.add a second time — wrong signature and double noise.
|
||||
*/
|
||||
export function presentError(err, method, { showAlert, notificationManager } = {}) {
|
||||
export function presentError(err, method, { showAlert } = {}) {
|
||||
const info = explainError(err, method)
|
||||
const text = `${info.title}: ${info.message}${info.recovery ? ` — ${info.recovery}` : ''}`
|
||||
if (typeof showAlert === 'function') {
|
||||
showAlert(info.severity === 'warning' ? 'warning' : 'danger', text)
|
||||
}
|
||||
if (notificationManager?.add) {
|
||||
try {
|
||||
notificationManager.add({
|
||||
type: info.severity === 'warning' ? 'warning' : 'error',
|
||||
title: info.title,
|
||||
message: info.message,
|
||||
})
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
showAlert(info.severity === 'warning' ? 'warning' : 'danger', text, {
|
||||
duration: 7000,
|
||||
})
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user