feat(overview): migrate the Transfer-funds modal to the reference design

Presentation-only migration of AddressTransferDialog::render (drag-one-address-
onto-another transfer) — a fund-moving modal:
- struct-form BeginOverlayDialog(OverlayDialogSpec{BlurFloat, cardWidth 620,
  idSuffix addrtransfer}) replacing the legacy positional overload
- the top-of-dialog deshielding warning -> material::DialogWarningHeader; the green
  shielding notice stays colored text (it's a positive notice, not a warning)
- remove the footer divider and drop its "+1.0f" footerH reserve term (keep the
  form->result-preview divider)
- reuse the existing shield_operation_id key for the "Operation ID: %s" label (no
  new i18n key)

The fund path is byte-for-byte unchanged: the amountValid guard, totalDeduct/
newFromBal/newToBal math, maxSendableAmount, the Max button, s_app->sendTransaction
+ its ok/fail callback, and the BeginDisabled(!amountValid || s_sending) gate.

Verified: build + ctest + hygiene clean; a 2-lens adversarial review returned zero
findings, proving the fund path diffs byte-for-byte identical to HEAD.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 18:17:13 -05:00
parent ca65aa8bf7
commit d29283a9b7

View File

@@ -59,7 +59,11 @@ public:
using namespace material; using namespace material;
if (BeginOverlayDialog(TR("transfer_funds"), &s_open, 620.0f, 0.94f)) { OverlayDialogSpec ov;
ov.title = TR("transfer_funds"); ov.p_open = &s_open;
ov.style = OverlayStyle::BlurFloat;
ov.cardWidth = 620.0f; ov.idSuffix = "addrtransfer";
if (BeginOverlayDialog(ov)) {
float dp = Layout::dpiScale(); float dp = Layout::dpiScale();
ImDrawList* dl = ImGui::GetWindowDrawList(); ImDrawList* dl = ImGui::GetWindowDrawList();
@@ -72,9 +76,7 @@ public:
// Shielding / deshielding warning // Shielding / deshielding warning
if (s_info.fromIsZ && !s_info.toIsZ) { if (s_info.fromIsZ && !s_info.toIsZ) {
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(Warning())); DialogWarningHeader(TR("deshielding_warning"));
ImGui::TextWrapped("%s", TR("deshielding_warning"));
ImGui::PopStyleColor();
ImGui::Spacing(); ImGui::Spacing();
} else if (!s_info.fromIsZ && s_info.toIsZ) { } else if (!s_info.fromIsZ && s_info.toIsZ) {
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(Success())); ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(Success()));
@@ -188,7 +190,7 @@ public:
buttonFont->CalcTextSizeA(buttonFontSize, 1000.0f, 0.0f, sendingLabel).x); buttonFont->CalcTextSizeA(buttonFontSize, 1000.0f, 0.0f, sendingLabel).x);
float confirmW = std::max(confirmMinW, confirmTextW + buttonPadW); float confirmW = std::max(confirmMinW, confirmTextW + buttonPadW);
float totalW = cancelW + confirmW + Layout::spacingMd(); float totalW = cancelW + confirmW + Layout::spacingMd();
float footerH = ImGui::GetFrameHeight() + ImGui::GetStyle().ItemSpacing.y * 3.0f + 1.0f; float footerH = ImGui::GetFrameHeight() + ImGui::GetStyle().ItemSpacing.y * 3.0f; // footer divider removed
ImGuiViewport* vp = ImGui::GetMainViewport(); ImGuiViewport* vp = ImGui::GetMainViewport();
float cardBottomY = vp->Pos.y + vp->Size.y * 0.85f; float cardBottomY = vp->Pos.y + vp->Size.y * 0.85f;
float footerTopY = cardBottomY - 24.0f * dp - footerH; float footerTopY = cardBottomY - 24.0f * dp - footerH;
@@ -199,7 +201,6 @@ public:
ImGui::Spacing(); ImGui::Spacing();
} }
ImGui::Separator();
ImGui::Spacing(); ImGui::Spacing();
float rowStartX = ImGui::GetCursorPosX(); float rowStartX = ImGui::GetCursorPosX();
@@ -300,7 +301,7 @@ private:
ImGui::Spacing(); ImGui::Spacing();
{ {
char buf[128]; char buf[128];
snprintf(buf, sizeof(buf), "Operation ID: %s", snprintf(buf, sizeof(buf), TR("shield_operation_id"),
s_resultMsg.size() > 40 s_resultMsg.size() > 40
? (s_resultMsg.substr(0, 20) + "..." + s_resultMsg.substr(s_resultMsg.size() - 10)).c_str() ? (s_resultMsg.substr(0, 20) + "..." + s_resultMsg.substr(s_resultMsg.size() - 10)).c_str()
: s_resultMsg.c_str()); : s_resultMsg.c_str());