From 1d3a919ac614cf17c3813739e7cebe38b024b648 Mon Sep 17 00:00:00 2001 From: DanS Date: Sat, 11 Jul 2026 16:49:05 -0500 Subject: [PATCH] feat(wallets): pin the active wallet to the top of the list Make "is the active wallet" the primary sort key so the current wallet always stays at the top regardless of the chosen sort/direction; the remaining wallets sort by the selected key underneath it. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/windows/wallets_dialog.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/windows/wallets_dialog.h b/src/ui/windows/wallets_dialog.h index af36472..9666759 100644 --- a/src/ui/windows/wallets_dialog.h +++ b/src/ui/windows/wallets_dialog.h @@ -155,7 +155,10 @@ public: default: sortVal[k] = pr.createdEpoch; break; // 0 = date created } } + auto isActive = [&](std::size_t i) { return s_rows[i].inDatadir && s_rows[i].fileName == active; }; std::stable_sort(s_order.begin(), s_order.end(), [&](std::size_t a, std::size_t b) { + const bool aa = isActive(a), ba = isActive(b); + if (aa != ba) return aa; // the active wallet is always pinned to the top return s_sortDesc ? sortVal[a] > sortVal[b] : sortVal[a] < sortVal[b]; }); }