feat(shield/compact): always-on chip tooltip, compact shortcut on Done, clearer compact feedback (F031/F071/F072)

UX audit, Shield/Consolidate surface (batch 3):

- F031: the status-bar consolidation chip always shows a tooltip ("Consolidating notes
  in the background — click to view or stop"), with the pause reason appended when any.
- F071: after a clean consolidate run, the Done screen notes the file won't shrink until
  compacted and offers a "Compact wallet…" shortcut (full-node) that opens the same
  confirm as Settings, via a new OpenCompactWalletConfirm() cross-module hook. Choice a.
- F072: the compact "started" toast is sticky and reworded ("don't close … a few
  minutes"), compact_done leads with "Compaction finished", and the confirm dialog notes
  the post-compaction rescan can take several minutes. Choice a.

New strings (English). Build + tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 15:46:57 -06:00
co-authored by Claude Opus 4.8
parent 3434679afe
commit fc6b854a00
6 changed files with 38 additions and 6 deletions
+4 -3
View File
@@ -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
}
+1 -1
View File
@@ -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);
+11
View File
@@ -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
+2
View File
@@ -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
+14
View File
@@ -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();
}
+6 -2
View File
@@ -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";