feat(market): flag a stale price instead of showing it as a fresh green number

The aggregate price is deliberately kept on a failed or old refresh (it's never
cleared), so the hero number could be hours out of date while still drawn in the
"live" green. It now turns amber with an "as of N min/h ago" caption and a hover
tooltip carrying the friendly fetch error, when the last refresh failed or the
aggregate is >=5 min old (only when the hero is the aggregate, not an exchange
pair with its own feed). The hardcoded "Price fetch failed" default is now i18n.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-10-18 09:42:34 -05:00
co-authored by Claude Opus 4.8
parent a792a1ec0c
commit a80be443d1
3 changed files with 42 additions and 2 deletions
+4
View File
@@ -2222,6 +2222,10 @@ void I18n::loadBuiltinEnglish()
strings_["market_24h_change"] = "24h";
strings_["market_price_loading"] = "Loading price data...";
strings_["market_price_unavailable"] = "Price data unavailable";
strings_["market_price_fetch_failed"] = "Price fetch failed";
strings_["market_price_stale_min"] = "as of %d min ago";
strings_["market_price_stale_hour"] = "as of %dh ago";
strings_["market_price_stale_tip"] = "Showing the last known price. The latest refresh failed: %s";
strings_["market_refresh_price"] = "Refresh price data";
strings_["market_trade_on"] = "Trade on %s";