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:
@@ -927,10 +927,14 @@ void RenderSendConfirmPopup(App* app) {
|
||||
s_memo[0] = '\0';
|
||||
s_send_max = false;
|
||||
} else {
|
||||
s_tx_status = std::string(TR("send_error_prefix")) + result;
|
||||
// Show a friendly cause in the toast; keep the raw backend text below it in
|
||||
// the overlay (copyable) so the detail isn't lost for diagnostics.
|
||||
const std::string friendly = util::friendlyRpcError(result);
|
||||
s_tx_status = std::string(TR("send_error_prefix")) + friendly +
|
||||
(friendly != result ? "\n\n" + result : std::string());
|
||||
s_result_txid.clear();
|
||||
s_status_success = false;
|
||||
Notifications::instance().error(std::string(TR("send_tx_failed")) + result);
|
||||
Notifications::instance().error(std::string(TR("send_tx_failed")) + friendly);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user