feat(ui): clamp recent-activity lists to the 4 most recent
The overview "Recent Transactions" and the send tab "Recent Sends" lists showed every matching transaction in a scroll region. Cap them at the 4 most recent (state.transactions is sorted newest-first, so a simple head-limit). The receive "Recent Received" list gets the same clamp in the Tier-1 robustness commit (same file as the QR fix). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -786,7 +786,7 @@ void RenderSharedRecentTx(App* app, float recentH, float availW, float hs, float
|
|||||||
ImGuiWindowFlags_NoBackground);
|
ImGuiWindowFlags_NoBackground);
|
||||||
|
|
||||||
const auto& txs = state.transactions;
|
const auto& txs = state.transactions;
|
||||||
int count = (int)txs.size();
|
int count = std::min(4, (int)txs.size()); // show only the 4 most recent (state.transactions is newest-first)
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
Type().textColored(TypeStyle::Caption, OnSurfaceDisabled(), TR("no_transactions_yet"));
|
Type().textColored(TypeStyle::Caption, OnSurfaceDisabled(), TR("no_transactions_yet"));
|
||||||
|
|||||||
@@ -1025,6 +1025,7 @@ static void RenderRecentSends(const WalletState& state, float width, ImFont* cap
|
|||||||
if (tx.type != "send" && tx.type != "shield") continue;
|
if (tx.type != "send" && tx.type != "shield") continue;
|
||||||
sends.push_back(&tx);
|
sends.push_back(&tx);
|
||||||
}
|
}
|
||||||
|
if (sends.size() > 4) sends.resize(4); // show only the 4 most recent (newest-first)
|
||||||
|
|
||||||
float listH = std::max(rowH, ImGui::GetContentRegionAvail().y);
|
float listH = std::max(rowH, ImGui::GetContentRegionAvail().y);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user