From d8cc1e9ee6e44cb0ecb1f8dfdd292b20e808f5f1 Mon Sep 17 00:00:00 2001 From: DanS Date: Thu, 9 Jul 2026 22:17:44 -0500 Subject: [PATCH] fix(wallets): stop the modal bottom section sliding off-screen after a monitor move MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Wallets modal used the auto-height BeginOverlayDialog overload, whose content child is AutoResizeY. It sized its table with `tableH = GetContentRegionAvail().y - 130*dp` INSIDE that child — but on an AutoResizeY child GetContentRegionAvail().y derives from the child's Size.y, carried over from the previous frame's content height. That makes tableH self-referential: a fixed point on one monitor, but a monitor move jumps dpiScale() (the 130*dp reserve + table column/row sizes switch to new units while the child's Size.y is still old units), knocking it off equilibrium. With only a lower clamp and no upper bound, the excursion runs unbounded and pushes the create/folder/footer rows off the bottom. Give the dialog a FIXED cardHeight (620) via the spec form — the pattern Manage Portfolio already uses. The content child is then fixed-height (not AutoResizeY), so GetContentRegionAvail().y is a stable, DPI-current "space left in the card", tableH stops feeding back, and the fixed-height path already clamps the card to the viewport (min(cardHeight*dp, vp_size.y-32)). Root-caused via a multi-agent audit against the ImGui internals. Verified via the headless sweep at 100% and font_scale 1.5 (150%): the table absorbs the slack and the create/folder inputs + footer stay on-screen. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/windows/wallets_dialog.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ui/windows/wallets_dialog.h b/src/ui/windows/wallets_dialog.h index ec55991..80bbb11 100644 --- a/src/ui/windows/wallets_dialog.h +++ b/src/ui/windows/wallets_dialog.h @@ -51,7 +51,19 @@ public: if (s_needScan) { scan(); s_needScan = false; } - if (BeginOverlayDialog(TR("wallets_title"), &s_open, 780.0f, 0.94f)) { + // FIXED cardHeight (not the auto-height overload): the table below sizes itself from + // GetContentRegionAvail().y, which is only stable when the dialog's content child is + // fixed-height. Auto-height makes that read self-referential and it diverges across a + // monitor move (dpiScale jump), sliding the create/footer rows off-screen. See Manage + // Portfolio (market_tab.cpp) for the same fixed-height pattern. + OverlayDialogSpec ov; + ov.title = TR("wallets_title"); + ov.p_open = &s_open; + ov.style = OverlayStyle::BlurFloat; + ov.cardWidth = 780.0f; + ov.cardHeight = 620.0f; + ov.idSuffix = "wallets"; + if (BeginOverlayDialog(ov)) { Type().textColored(TypeStyle::Caption, OnSurfaceMedium(), TR("wallets_intro")); ImGui::Dummy(ImVec2(0, Layout::spacingSm()));