fix(ui): cut-off/clipping — recent-tx collisions, updater note wrap, request-payment URI, console filter, icon-grid scroll

Fixes the cut-off/clipping bugs from the layout audit (all visible at the default
1280/1024 window sizes):

- Receive "Recent Received" rows: the amount collided with the relative-time
  ("+15.7500 DRGX14 days ago") and the type label touched the address at narrow
  widths. Use the shared short time format (formatTimeAgoShort, matching Overview),
  chain the amount's right edge off the measured time width, and start the address
  after the measured type-label width — so neither pair can collide.
- Daemon & xmrig updater verify-note: drawn unwrapped and clipped at the card's right
  edge; wrap it (PushTextWrapPos) within the already-reserved height.
- Request Payment: the three footer buttons shared one fixed width (clipping "Copy
  Full Address"); size each to its own label. The Payment URI overflowed a plain
  field; render it in a bordered read-only box (bounded, un-chunked).
- Console: the filter input shrank below its own placeholder (gone entirely at 1024);
  give it a min width >= the placeholder and drop the "N lines" count when the row
  can't fit both.
- Address-label "Choose Icon" grid: had NoScrollbar hiding most of the catalog with
  no cue; give it a real scrollbar.
- Overview "Recent Transactions": drop the 4th row at 1024 (it clipped off-screen) by
  capping to rows that fully fit the reserved height.
- Sidebar: reserve the unread-badge width in the nav-label centering so History/Chat
  labels no longer collide with their badge.

Verified at 1024 and 1280 across full-node + Lite + Windows (ctest green) and an
adversarial diff review (clean). Skipped the legacy settings_window overlay footer
(dead code / removal candidate).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-19 10:11:55 -05:00
co-authored by Claude Opus 4.8
parent 9205addf55
commit a598217975
8 changed files with 128 additions and 53 deletions
+42 -16
View File
@@ -9,6 +9,7 @@
#include "../notifications.h"
#include "../schema/ui_schema.h"
#include "../widgets/qr_code.h"
#include "../widgets/copy_field.h"
#include "../material/draw_helpers.h"
#include "imgui.h"
@@ -198,33 +199,58 @@ void RequestPaymentDialog::render(App* app)
// Payment URI display
if (!s_payment_uri.empty()) {
// Use a selectable text area for the URI
char uri_buf[1024];
strncpy(uri_buf, s_payment_uri.c_str(), sizeof(uri_buf) - 1);
material::LabeledInput(TR("request_payment_uri"), "##URI", uri_buf, sizeof(uri_buf),
-1.0f, nullptr, ImGuiInputTextFlags_ReadOnly);
ImGui::Text("%s", TR("request_payment_uri"));
// Bordered read-only field: bounds the raw drgx: URI within a box (it horizontal-scrolls if
// long) rather than 4-char-chunking it like an address or letting a plain field overflow.
// The "Copy URI" button below copies the full value.
{
char uriBuf[2048];
snprintf(uriBuf, sizeof(uriBuf), "%s", s_payment_uri.c_str());
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
ImGui::InputText("##URI", uriBuf, sizeof(uriBuf), ImGuiInputTextFlags_ReadOnly);
}
ImGui::Spacing();
// Copy button
if (material::TactileButton(TR("request_copy_uri"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) {
// Footer buttons: size each to ITS OWN label (action-button.width is a floor, not the size)
// so "Copy Full Address" never clips its final letter — mirrors qr_popup_dialog's per-label
// sizing. Font metrics are already DPI-scaled, so don't multiply by dpiScale() here.
ImFont* btnFont = S.resolveFont(actionBtn.font);
ImGui::PushFont(btnFont);
const float btnPad = ImGui::GetStyle().FramePadding.x * 2.0f + 12.0f; // small margin
float w_uri = ImGui::CalcTextSize(TR("request_copy_uri")).x + btnPad;
float w_addr = ImGui::CalcTextSize(TR("copy_address")).x + btnPad;
ImGui::PopFont();
if (w_uri < actionBtn.width) w_uri = actionBtn.width;
if (w_addr < actionBtn.width) w_addr = actionBtn.width;
// Copy URI button
if (material::TactileButton(TR("request_copy_uri"), ImVec2(w_uri, 0), btnFont)) {
ImGui::SetClipboardText(s_payment_uri.c_str());
Notifications::instance().success(TR("request_uri_copied"));
}
ImGui::SameLine();
if (material::TactileButton(TR("copy_address"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) {
if (material::TactileButton(TR("copy_address"), ImVec2(w_addr, 0), btnFont)) {
ImGui::SetClipboardText(s_address);
Notifications::instance().success(TR("address_copied"));
}
}
ImGui::Spacing();
// Close button
if (material::TactileButton(TR("close"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) {
s_open = false;
// Close button — sized to its own label with the same floor.
{
ImFont* btnFont = S.resolveFont(actionBtn.font);
ImGui::PushFont(btnFont);
const float btnPad = ImGui::GetStyle().FramePadding.x * 2.0f + 12.0f;
float w_close = ImGui::CalcTextSize(TR("close")).x + btnPad;
ImGui::PopFont();
if (w_close < actionBtn.width) w_close = actionBtn.width;
if (material::TactileButton(TR("close"), ImVec2(w_close, 0), btnFont)) {
s_open = false;
}
}
material::EndOverlayDialog();
}