diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 5c77c03..16b0abf 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -517,6 +517,10 @@ agent or engineer to remove them without reconstructing context from chat. settings, and user-manual close buttons now bind retained destroy-on-click behavior through `src/legacy_ui_overlay_services.*` instead of per-dialog lambdas. Broader checked-handle and scoped-callback adoption remains open. +- 2026-06-12: DEBT-0063/DEBT-0058 were narrowed again. Message-box + submit/cancel and input-box cancel destroy callbacks now use retained close + helpers from `src/legacy_ui_overlay_services.*`. Dialog lifetime still uses + raw `Node` callbacks until checked handles and scoped connections land. - 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 8e6b1a7..c25a224 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -498,6 +498,8 @@ outside-click close handling now shares the same retained release/remove/ callback helper. About, changelog, settings, and user-manual close buttons now share retained destroy-on-click binding through the same overlay service. +Message-box submit/cancel and input-box cancel destroy callbacks now use the +same retained close binding helpers. 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_ui_overlay_services.h b/src/legacy_ui_overlay_services.h index 50c8236..5b7f2ce 100644 --- a/src/legacy_ui_overlay_services.h +++ b/src/legacy_ui_overlay_services.h @@ -82,4 +82,11 @@ void bind_legacy_click_destroys_node(ButtonT& button, Node& target) noexcept }; } +inline std::function legacy_destroy_node_callback(Node& target) +{ + return [&target](Node*) { + target.destroy(); + }; +} + } // namespace pp::panopainter diff --git a/src/node_input_box.cpp b/src/node_input_box.cpp index f501cb5..d951ff7 100644 --- a/src/node_input_box.cpp +++ b/src/node_input_box.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "log.h" +#include "legacy_ui_overlay_services.h" #include "node_input_box.h" #include "layout.h" @@ -24,7 +25,7 @@ void NodeInputBox::init() on_submit(this, m_field_text->m_text); }; btn_cancel = find("btn-cancel"); - btn_cancel->on_click = [&](Node*) { destroy(); }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); m_capture_children = false; // don't capture children events on mouse_capture } diff --git a/src/node_message_box.cpp b/src/node_message_box.cpp index a185e90..496c414 100644 --- a/src/node_message_box.cpp +++ b/src/node_message_box.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "log.h" +#include "legacy_ui_overlay_services.h" #include "node_message_box.h" #include "layout.h" @@ -23,7 +24,7 @@ void NodeMessageBox::init() on_submit(this); }; btn_cancel = find("btn-cancel"); - on_submit = btn_cancel->on_click = [&](Node*) { destroy(); }; + on_submit = btn_cancel->on_click = pp::panopainter::legacy_destroy_node_callback(*this); m_capture_children = false; // don't capture children events on mouse_capture }