fix(ui): clamp tooltips to a comfortable width instead of spanning the screen

Audited every tooltip. The shared helper material::Tooltip wrapped ImGui's
SetTooltip with no width limit, so a long tooltip laid out on one line and
stretched across the whole display — most visible on the newly reworded
note/consolidation tooltips. 258 call sites go through this helper, so the fix is
central:

- material::Tooltip / BeginTooltip now push a text wrap position (420 logical px,
  DPI-scaled) so long text wraps to a comfortable column; short text is
  unaffected (it's already narrower). A caller that pushes its own wrap pos nests
  cleanly. Also fixes a latent style-stack leak when ImGui::BeginTooltip returns
  false (the pushed style is now popped).

Six sites bypassed the helper with raw ImGui tooltips. The two that actually
stretched are migrated to material::Tooltip: the alert/bell toast-hover showing a
full (now ~250-char) message, and the wallets dialog's folder-path hover. The
chat over-cap tooltip is migrated too for consistency. The remaining three
(two wallet-recovery dialog tips, the chat composer's parts tooltip) already
clamp via their own PushTextWrapPos and are left as-is.

Build + tests + hygiene green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 14:45:39 -05:00
co-authored by Claude Opus 4.8
parent d83169c963
commit fc9f8d52c3
4 changed files with 38 additions and 11 deletions
+2 -1
View File
@@ -39,6 +39,7 @@
#include "../layout.h"
#include "../material/colors.h"
#include "../material/draw_helpers.h"
#include "../material/tooltip_style.h" // material::Tooltip (width-clamped)
#include "../material/type.h"
#include "folder_picker.h"
@@ -557,7 +558,7 @@ public:
ImGui::AlignTextToFramePadding();
const float textW = listW - bh2 - 2.0f * Layout::spacingSm();
Type().textColored(TypeStyle::Caption, OnSurface(), elideFront(folder, textW).c_str());
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", folder.c_str());
if (ImGui::IsItemHovered()) material::Tooltip("%s", folder.c_str()); // wrapped: long paths
ImGui::PopID();
}
if (!toRemove.empty()) {