Result box: color-code by result type + rewrite error messages in plain user language #105
Notifications
Total Time Spent: 50 seconds
poslop
50 seconds
No due date set.
Dependencies
No dependencies set.
Reference: poslop/palette#105
Reference in New Issue
Block a user
Two improvements to the result box on the new page:
COLOR BY TYPE: the result box should use the semantic status colors (already defined: --ok, --err, --warn from #16). Success = --ok border/text tint, validation errors = --err, soft warnings = --warn. Currently it's monochrome regardless of outcome.
HUMAN-FRIENDLY ERROR MESSAGES: rewrite all user-facing validation errors from developer-speak to plain guidance, and map them client-side where the backend message is technical. Examples of the desired tone:
Implementation: keep technical detail in API responses for API consumers, but the new-page JS translates known backend error patterns into the friendly strings above (a small error-message map, fallback to a generic 'Something went wrong. Please try again.' for unknown errors). Result box gets an icon or colored left border matching the status color.
Audit ALL backend validation messages (main.go, cans.go, internal/api) and either rewrite them plainly or add a machine-readable error code the UI can map (preferred: error code like 'slug_taken' + human message). Update docs/API.md error section.