feat(web): Base UI toast region + global mutation feedback wiring (#47)
Add a module-scope Base UI toast manager bridged to the QueryClient so every mutation can give consistent feedback. A MutationCache (extracted into a makeQueryClient() factory for test reuse) emits a catch-all, type-aware error toast (unless meta.suppressErrorToast) and an opt-in success toast (meta.successMessage), reading mutation.meta + i18n.t outside React. meta is type-checked via a react-query Register augmentation. ToastRegion is mounted app-wide in main.tsx. Adds a toast i18n namespace (en/sv parity) and a validated story. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,5 +59,14 @@
|
||||
"gateError": "Can't publish — required fields are missing.",
|
||||
"editLink": "Edit the record",
|
||||
"illegalError": "That visibility change isn't allowed."
|
||||
},
|
||||
"toast": {
|
||||
"created": "Created",
|
||||
"saved": "Saved",
|
||||
"updated": "Updated",
|
||||
"deleted": "Deleted",
|
||||
"renamed": "Renamed",
|
||||
"published": "Visibility updated",
|
||||
"error": "Something went wrong"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,5 +59,14 @@
|
||||
"gateError": "Kan inte publicera — obligatoriska fält saknas.",
|
||||
"editLink": "Redigera posten",
|
||||
"illegalError": "Den synlighetsändringen är inte tillåten."
|
||||
},
|
||||
"toast": {
|
||||
"created": "Skapat",
|
||||
"saved": "Sparat",
|
||||
"updated": "Uppdaterat",
|
||||
"deleted": "Borttaget",
|
||||
"renamed": "Namn ändrat",
|
||||
"published": "Synlighet uppdaterad",
|
||||
"error": "Något gick fel"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user