diff --git a/src/app.cpp b/src/app.cpp index 359614b..205f8be 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -3243,9 +3243,10 @@ void App::renderStatusBar() ImGui::EndGroup(); if (ImGui::IsItemHovered()) { ImGui::SetMouseCursor(ImGuiMouseCursor_Hand); - if (!p.stopping) { - if (const char* k = services::runWaitKey(p.wait)) ui::material::Tooltip("%s", TR(k)); - } + // Always explain the chip; append the pause reason when there is one. (F031) + const char* waitKey = p.stopping ? nullptr : services::runWaitKey(p.wait); + if (waitKey) ui::material::Tooltip("%s\n%s", TR("merge_chip_tip"), TR(waitKey)); + else ui::material::Tooltip("%s", TR("merge_chip_tip")); } if (ImGui::IsItemClicked()) ui::ShieldDialog::showConsolidate(); // reopens the run view } diff --git a/src/app_network.cpp b/src/app_network.cpp index 229a62c..c99ea71 100644 --- a/src/app_network.cpp +++ b/src/app_network.cpp @@ -6538,7 +6538,7 @@ void App::compactWallet() compaction_salvage_expected_.store(true); // this salvage is a compaction, not a recovery — don't alarm restartDaemon(); // does its own full-node / busy / lifecycle guards and will refuse if the node is busy if (daemon_restarting_.load()) { - n.info(TR("compact_started")); + n.info(TR("compact_started"), 20.0f); // sticky-ish: the rescan runs a while; "don't close" (F072) } else { daemon_controller_->setSalvageOnNextStart(false); // the restart was refused — disarm the stray salvage compaction_salvage_expected_.store(false); diff --git a/src/ui/pages/settings_page.cpp b/src/ui/pages/settings_page.cpp index 36fdbfb..3dc324a 100644 --- a/src/ui/pages/settings_page.cpp +++ b/src/ui/pages/settings_page.cpp @@ -3630,6 +3630,10 @@ void RenderSettingsPage(App* app) { ImGui::Spacing(); ImGui::TextColored(material::SuccessVec4(), "%s", TR("confirm_compact_wallet_safe")); ImGui::Spacing(); + ImGui::PushStyleColor(ImGuiCol_Text, material::OnSurfaceMedium()); + ImGui::TextWrapped("%s", TR("confirm_compact_time_hint")); // F072 + ImGui::PopStyleColor(); + ImGui::Spacing(); ImGui::Separator(); ImGui::Spacing(); @@ -3745,5 +3749,12 @@ void SweepOpenDebugGate(bool open) { } } +// Open the Node tab and raise the compact-wallet confirm — used by the shield/consolidate Done screen's +// "Compact wallet…" shortcut so the compaction goes through the same confirm as Settings. (F071) +void OpenCompactWalletConfirm() { + s_settingsState.current_tab = TAB_NODE; + s_settingsState.confirm_compact_wallet = true; +} + } // namespace ui } // namespace dragonx diff --git a/src/ui/pages/settings_page.h b/src/ui/pages/settings_page.h index 912861e..b4bbde1 100644 --- a/src/ui/pages/settings_page.h +++ b/src/ui/pages/settings_page.h @@ -18,6 +18,8 @@ void RenderSettingsPage(App* app); // Sweep-only: force the debug-options confirmation gate open/closed so the offline UI sweep can // capture it (it is otherwise opened only by clicking the DEBUG OPTIONS header). void SweepOpenDebugGate(bool open); +// Open Settings → Node and raise the compact-wallet confirm (used by the consolidate Done screen). (F071) +void OpenCompactWalletConfirm(); } // namespace ui } // namespace dragonx diff --git a/src/ui/windows/shield_dialog.cpp b/src/ui/windows/shield_dialog.cpp index 8fd3e26..bb33886 100644 --- a/src/ui/windows/shield_dialog.cpp +++ b/src/ui/windows/shield_dialog.cpp @@ -11,6 +11,8 @@ #include "../../services/note_consolidation.h" #include "../../util/i18n.h" #include "../notifications.h" +#include "../sidebar.h" // NavPage — "Compact wallet…" shortcut (F071) +#include "../pages/settings_page.h" // OpenCompactWalletConfirm (F071) #include "../schema/ui_schema.h" #include "../material/draw_helpers.h" #include "imgui.h" @@ -853,6 +855,18 @@ void ShieldDialog::render(App* app) ImGui::Spacing(); wrappedCaption(endCol, endLine.c_str()); } + // F071: after a clean consolidate run, the file won't shrink until compacted — offer the shortcut. + if (s_consolidate && services::runVerdict(sum) == services::RunVerdict::Clean && + app->supportsFullNodeLifecycleActions()) { + ImGui::Spacing(); + wrappedCaption(material::OnSurfaceMedium(), TR("merge_compact_hint")); + std::string compactLbl = std::string(TR("merge_compact_btn")) + "##MergeCompact"; + if (material::TactileButton(compactLbl.c_str(), ImVec2(0, 0), S.resolveFont(cancelBtn.font))) { + s_open = false; + app->setCurrentPage(ui::NavPage::Settings); + OpenCompactWalletConfirm(); + } + } } ImGui::Spacing(); } diff --git a/src/util/i18n.cpp b/src/util/i18n.cpp index fb9377a..c99d088 100644 --- a/src/util/i18n.cpp +++ b/src/util/i18n.cpp @@ -886,8 +886,9 @@ void I18n::loadBuiltinEnglish() strings_["wallet_size_consolidate"] = "Consolidate notes\xE2\x80\xA6"; strings_["wallet_size_compact"] = "Compact wallet\xE2\x80\xA6"; strings_["tt_wallet_size_compact"] = "Reclaim the disk space freed by consolidating. Berkeley DB can't shrink the file in place, so this rewrites wallet.dat into a smaller file and restarts the node with a full rescan (can take a while). A backup of the current wallet is kept."; - strings_["compact_started"] = "Compacting wallet \xE2\x80\x94 the node is restarting and will re-scan the chain."; - strings_["compact_done"] = "Wallet compacted \xE2\x80\x94 the file was rewritten and the freed space reclaimed. The node is re-scanning to rebuild your transaction view."; + strings_["compact_started"] = "Compacting wallet \xE2\x80\x94 re-scanning the chain. Don't close the wallet; this can take a few minutes."; + strings_["compact_done"] = "Compaction finished \xE2\x80\x94 wallet.dat was rewritten and the freed space reclaimed. The node is re-scanning to rebuild your transaction view."; + strings_["confirm_compact_time_hint"] = "Afterwards the node re-scans the chain, which can take several minutes on a large wallet."; strings_["confirm_compact_wallet_title"] = "Compact wallet"; strings_["confirm_compact_wallet_msg"] = "Consolidating merged your notes, but the wallet file can't shrink on its own \xE2\x80\x94 the node has to rewrite it to reclaim the freed space. This restarts the node and re-scans the blockchain, which can take a while on a large wallet."; strings_["confirm_compact_wallet_safe"] = "Your funds and balance are safe \xE2\x80\x94 a timestamped backup of the current wallet is kept."; @@ -2928,6 +2929,9 @@ void I18n::loadBuiltinEnglish() strings_["merge_addr_created"] = "Shielded address created."; strings_["merge_confirm_fmt"] = "Consolidate ~%s DRGX from %d input(s) into %s?"; strings_["merge_confirm_all_fmt"] = "Consolidate ~%s DRGX from %d %s into %s? Network fee: %s DRGX."; + strings_["merge_chip_tip"] = "Consolidating notes in the background \xE2\x80\x94 click to view or stop"; + strings_["merge_compact_hint"] = "Consolidation freed space inside the wallet file, but it won't shrink on disk until you compact it."; + strings_["merge_compact_btn"] = "Compact wallet\xE2\x80\xA6"; strings_["merge_confirm_batch_fmt"] = "This batch merges %d of %d inputs into %s (fee %s DRGX). Run again for the rest."; strings_["merge_confirm_btn"] = "Confirm"; strings_["merge_back"] = "Back";