fix(market): portfolio editor address checklist was collapsing to zero height
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user