feat(transactions): detail dialog — dropped/stale badges, themed colors, shield label (F016/F033/F015)
UX audit, transaction detail dialog: - F016: the confirmations badge now shows "Dropped" (red) for a conflicted/ reorged tx (conf < 0) and "Expired?" (amber) for a long-stale 0-conf, mirroring the list, instead of a green "-1 confirmations". - F033: type colors use theme tokens (Secondary / Primary / OnSurfaceMedium) instead of raw ImVec4 literals, and tiny USD amounts show ~$0.00xx (tiered). - F015: a "shield" tx renders a "Shielded (moved to your own z-address)" label. New string (English). Build + tests green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -64,13 +64,16 @@ void TransactionDetailsDialog::render(App* app)
|
||||
type_color = material::ErrorVec4();
|
||||
type_display = TR("tx_sent");
|
||||
} else if (tx.type == "generate" || tx.type == "mined") {
|
||||
type_color = ImVec4(0.3f, 0.6f, 0.9f, 1.0f);
|
||||
type_color = material::SecondaryVec4(); // themed, not a raw literal (F033)
|
||||
type_display = TR("tx_mined");
|
||||
} else if (tx.type == "immature") {
|
||||
type_color = material::WarningVec4();
|
||||
type_display = TR("tx_immature");
|
||||
} else if (tx.type == "shield") {
|
||||
type_color = ImGui::ColorConvertU32ToFloat4(material::Primary());
|
||||
type_display = TR("tx_shielded_detail"); // "Shielded (moved to your own z-address)" (F015)
|
||||
} else {
|
||||
type_color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f);
|
||||
type_color = ImGui::ColorConvertU32ToFloat4(material::OnSurfaceMedium()); // themed (F033)
|
||||
type_display = tx.type;
|
||||
}
|
||||
|
||||
@@ -78,7 +81,12 @@ void TransactionDetailsDialog::render(App* app)
|
||||
ImGui::SameLine(ImGui::GetWindowWidth() - confLbl.position);
|
||||
|
||||
// Confirmations badge
|
||||
if (tx.confirmations == 0) {
|
||||
if (tx.confirmations < 0) { // conflicted / double-spent / reorged out (F016)
|
||||
ImGui::TextColored(material::ErrorVec4(), "%s", TR("tx_dropped"));
|
||||
} else if (tx.confirmations == 0 && tx.timestamp > 0 &&
|
||||
static_cast<int64_t>(std::time(nullptr)) - tx.timestamp > 3600) {
|
||||
ImGui::TextColored(material::WarningVec4(), "%s", TR("tx_stale_pending"));
|
||||
} else if (tx.confirmations == 0) {
|
||||
ImGui::TextColored(material::WarningVec4(), "%s", TR("pending"));
|
||||
} else if (tx.confirmations < 10) {
|
||||
ImGui::TextColored(material::WarningVec4(), TR("tx_confirmations"), tx.confirmations);
|
||||
@@ -103,7 +111,9 @@ void TransactionDetailsDialog::render(App* app)
|
||||
double price_usd = app->state().market.price_usd;
|
||||
if (price_usd > 0) {
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled("(~$%.2f USD)", std::abs(tx.amount) * price_usd);
|
||||
double usd = std::abs(tx.amount) * price_usd;
|
||||
if (usd > 0.0 && usd < 0.01) ImGui::TextDisabled("(~$%.4f USD)", usd); // tiered for tiny amounts (F033)
|
||||
else ImGui::TextDisabled("(~$%.2f USD)", usd);
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
@@ -1350,6 +1350,7 @@ void I18n::loadBuiltinEnglish()
|
||||
strings_["no_matching"] = "No matching transactions";
|
||||
strings_["clear_filters"] = "Clear filters";
|
||||
strings_["tx_immature"] = "Immature (%d/100)";
|
||||
strings_["tx_shielded_detail"] = "Shielded (moved to your own z-address)";
|
||||
strings_["transaction_id"] = "TRANSACTION ID";
|
||||
strings_["search_placeholder"] = "Search...";
|
||||
strings_["all_filter"] = "All";
|
||||
|
||||
Reference in New Issue
Block a user