From 3e1cdd15f3fcefad74ff8c13719c2d158527a61b Mon Sep 17 00:00:00 2001 From: DanS Date: Thu, 2 Jul 2026 21:53:08 -0500 Subject: [PATCH] fix(market): portfolio editor address checklist was collapsing to zero height MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Manage portfolio" editor renders its address checklist inside the overlay dialog's content child, which is ImGuiChildFlags_AutoResizeY (the dialog sizes to its content). The checklist used a negative "fill remaining space" height (-GetFrameHeightWithSpacing()*1.5f), which is meaningless in an auto-resizing parent — there is no fixed height to subtract from — so ImGui collapsed the child to ~0 and no addresses were visible, even with state.addresses fully populated. Size the list to its rows instead, capped at 40% of the viewport height so a large wallet scrolls rather than running off-screen. Pre-existing bug from when the editor was added; distinct from the earlier state.addresses population fix. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/windows/market_tab.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ui/windows/market_tab.cpp b/src/ui/windows/market_tab.cpp index 6b34914..05bb63d 100644 --- a/src/ui/windows/market_tab.cpp +++ b/src/ui/windows/market_tab.cpp @@ -182,8 +182,14 @@ static void RenderPortfolioEditor(App* app) Type().textColored(TypeStyle::Caption, OnSurfaceMedium(), selc); ImGui::Dummy(ImVec2(0, Layout::spacingXs())); - // Address checklist. - ImGui::BeginChild("##pfAddrList", ImVec2(0, -ImGui::GetFrameHeightWithSpacing() * 1.5f), true); + // Address checklist. The overlay dialog auto-resizes to its content + // (ImGuiChildFlags_AutoResizeY), so a negative "fill-remaining" height collapses to ~0 + // here — size the list to its rows instead, capped at 40% of the viewport so a large + // wallet scrolls rather than running off-screen. + float pfRowH = ImGui::GetFrameHeightWithSpacing(); + int pfRows = std::max(1, (int)state.addresses.size()); + float pfListH = std::min(pfRows * pfRowH, ImGui::GetMainViewport()->Size.y * 0.4f); + ImGui::BeginChild("##pfAddrList", ImVec2(0, pfListH), true); for (const auto& a : state.addresses) { bool inSet = data::PortfolioEntryContains(s_pf_addrs, a.address); char line[192];