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) <noreply@anthropic.com>
This commit is contained in:
2026-07-03 23:27:16 -05:00
parent 7db6564a0e
commit 4411cb45e2

View File

@@ -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;
}