feat(ui): friendly RPC errors + pause-on-hover/ellipsis toasts
Two of the systemic error-surfacing foundations from the UX audit: - util::friendlyRpcError() maps the common raw daemon/JSON-RPC errors (warming up / -28, locked / -13, method-not-found / -32601, insufficient funds, unreachable node) to short translated guidance with a next step, falling back to the trimmed raw text. Wired into the send (money) path: the toast shows the friendly cause, the overlay keeps the raw text below it for diagnostics. The helper is reusable for the remaining raw-error sites. - Toasts now pause their auto-dismiss while hovered and ellipsize over-long text with the full message in a hover tooltip, instead of hard-clipping it mid-word (durations were already lengthened earlier). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -79,6 +79,16 @@ inline const char* tr(const char* key) {
|
||||
return I18n::instance().translate(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Map a raw daemon / JSON-RPC error string to a short, friendly, TRANSLATED explanation.
|
||||
*
|
||||
* Recognizes the common cases a user actually hits — a warming-up node, a locked wallet, an RPC the
|
||||
* daemon is too old to have, insufficient funds, and an unreachable node — and returns plain guidance
|
||||
* with a next step. Falls back to the raw text (trimmed) when nothing matches, so detail is never lost.
|
||||
* Keep the raw text available elsewhere (a Details view / the console) for diagnostics.
|
||||
*/
|
||||
std::string friendlyRpcError(const std::string& raw);
|
||||
|
||||
} // namespace util
|
||||
} // namespace dragonx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user