From 4411cb45e20a5a83bbf6d42dcf45b91251637a2c Mon Sep 17 00:00:00 2001 From: DanS Date: Fri, 3 Jul 2026 23:27:16 -0500 Subject: [PATCH] feat(market): Esc / outside-click discard portfolio edits; only Close saves Complete the explicit-save model: leaving the Manage-portfolio modal via Esc or an outside-click now discards the current group's uncommitted edits (matching the discard-on-switch behavior), while the Close button still commits. Only the Save and Close buttons persist; every other exit path is a cancel. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/windows/market_tab.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ui/windows/market_tab.cpp b/src/ui/windows/market_tab.cpp index ed70044..ce90b55 100644 --- a/src/ui/windows/market_tab.cpp +++ b/src/ui/windows/market_tab.cpp @@ -1170,11 +1170,10 @@ static void RenderPortfolioEditor(App* app) if (!popupOpen && !ImGui::IsWindowAppearing() && ImGui::IsMouseClicked(ImGuiMouseButton_Left) && !ImGui::IsMouseHoveringRect(cardMin, cardMax)) s_portfolio_editor_open = false; - // Commit named edits on any close path (Esc / outside-click / Close); unnamed drafts are dropped. - // Also invalidate the acrylic capture so the background (not the last live capture) is re-captured - // for the other glass panels once the overlay is gone, and arm a fresh capture for the next open. + // Esc / outside-click discard uncommitted edits (only the Close button above commits explicitly). + // Invalidate the acrylic capture so the background (not the last live capture) is re-captured for + // the other glass panels once the overlay is gone, and arm a fresh capture for the next open. if (!s_portfolio_editor_open) { - commitIfNeeded(); effects::ImGuiAcrylic::InvalidateCapture(); s_pf_was_open = false; }