From e89d882022029f5e470368ba47289b92d12860a3 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Fri, 12 Jun 2026 16:39:29 +0200 Subject: [PATCH] Centralize service adapter dialog closing --- docs/modernization/debt.md | 4 ++++ docs/modernization/roadmap.md | 2 ++ src/legacy_brush_package_export_services.cpp | 5 +++-- src/legacy_document_open_services.cpp | 7 ++++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index eeb3169..c4bbeec 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -580,6 +580,10 @@ agent or engineer to remove them without reconstructing context from chat. color-wheel, color-quad, and canvas gesture-end capture release now route through `src/legacy_ui_overlay_services.*`. The controls still own raw event callback targets and public `Node` capture state. +- 2026-06-12: DEBT-0063/DEBT-0058 were narrowed again. Legacy document-open + import/discard prompts and brush-package export completion now route retained + dialog closing through `src/legacy_ui_overlay_services.*` instead of direct + `destroy()` calls from service adapters. - 2026-06-05: DEBT-0011 was narrowed. The Windows app package smoke target now passes the configure-time CMake executable into `package-smoke.ps1`, so VS 2026 generator validation does not depend on an older `cmake` on PATH, and diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 3f47e3d..56ecec7 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -533,6 +533,8 @@ Canvas mode mouse-capture release for camera, paint, line, grid, mask, and fill interactions now routes through the retained capture-release helper. Button, slider, scroll, color-wheel, color-quad, and canvas gesture-end capture release now route through that same helper. +Legacy document-open import/discard prompts and brush-package export completion +now route retained dialog closing through the same helper. Raw popup callback captures and full close/capture ownership remain part of `DEBT-0063`. `pano_cli inspect-image` exposes PNG IHDR metadata as JSON, diff --git a/src/legacy_brush_package_export_services.cpp b/src/legacy_brush_package_export_services.cpp index e6bc2d6..f3285a1 100644 --- a/src/legacy_brush_package_export_services.cpp +++ b/src/legacy_brush_package_export_services.cpp @@ -3,6 +3,7 @@ #include "legacy_brush_package_export_services.h" #include "app.h" +#include "legacy_ui_overlay_services.h" #include "node_dialog_export_ppbr.h" #include "node_panel_brush.h" @@ -49,7 +50,7 @@ public: std::thread([app, dialog, path_string, info] { BT_SetTerminate(); app->presets->export_ppbr(path_string, info); - dialog->destroy(); + pp::panopainter::close_legacy_dialog_node(*dialog); const auto plan = pp::app::plan_brush_package_export_success_dialog(path_string); app->message_box(plan.title, plan.message, plan.show_cancel); }).detach(); @@ -94,7 +95,7 @@ pp::foundation::Status execute_legacy_brush_package_export( void complete_legacy_brush_package_export(NodeDialogExportPPBR& dialog, bool saved) { if (saved) { - dialog.destroy(); + pp::panopainter::close_legacy_dialog_node(dialog); } } diff --git a/src/legacy_document_open_services.cpp b/src/legacy_document_open_services.cpp index ddbe399..8d15cf3 100644 --- a/src/legacy_document_open_services.cpp +++ b/src/legacy_document_open_services.cpp @@ -6,6 +6,7 @@ #include "legacy_brush_package_import_services.h" #include "legacy_canvas_view_services.h" #include "legacy_history_services.h" +#include "legacy_ui_overlay_services.h" #include "log.h" #include "node_panel_brush.h" #include "node_panel_layer.h" @@ -61,7 +62,7 @@ public: path); if (!status.ok()) LOG("ABR import failed: %s", status.message); - target->destroy(); + pp::panopainter::close_legacy_dialog_node(*target); }; } @@ -76,7 +77,7 @@ public: path); if (!status.ok()) LOG("PPBR import failed: %s", status.message); - target->destroy(); + pp::panopainter::close_legacy_dialog_node(*target); }; } @@ -94,7 +95,7 @@ public: true); mb->on_submit = [app, route](Node* target) { open_legacy_project(*app, route); - target->destroy(); + pp::panopainter::close_legacy_dialog_node(*target); }; }