From 69603ed6c98b6b05642aae49e531994251645d66 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Mon, 15 Jun 2026 21:51:17 +0200 Subject: [PATCH] Extract downloaded project reconcile helper --- docs/modernization/debt.md | 7 +++++++ docs/modernization/roadmap.md | 5 +++++ src/legacy_document_open_services.cpp | 11 ++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 60a13f29..dcf15b11 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -18,6 +18,13 @@ agent or engineer to remove them without reconstructing context from chat. ## Recent Reductions +- 2026-06-15: `DEBT-0038` was narrowed again. The retained cloud downloaded- + project open, layer refresh, and action-history reset in + `execute_legacy_downloaded_project_open()` now route through a focused + helper in `src/legacy_document_open_services.cpp` instead of living inline + in the document-open bridge; the remaining cloud bridge debt stays + concentrated in retained prompt/progress lifetime, OpenGL context guarding, + and the still-retained transfer-thread execution model. - 2026-06-15: `DEBT-0038` was narrowed again. The retained cloud publish prompt setup in `show_cloud_publish_prompt()` now routes through a focused helper in `src/legacy_cloud_services.cpp` instead of living inline in the diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 72fc8838..6a9ea36e 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -104,6 +104,11 @@ Retained save-before-upload execution now also routes through directly, so the remaining cloud debt is further concentrated on prompt/progress lifetime, OpenGL context guarding, downloaded-project open, layer refresh, and action-history reset. +Retained cloud downloaded-project open, layer refresh, and action-history +reset in `execute_legacy_downloaded_project_open()` now also route through a +focused helper in `src/legacy_document_open_services.*`, so the remaining +cloud bridge debt is further concentrated on prompt/progress lifetime, OpenGL +context guarding, and the still-retained transfer-thread execution model. Retained cloud downloaded-project post-open reconciliation now also routes through `src/legacy_document_open_services.*` instead of living inline in `src/legacy_cloud_services.cpp`, so the remaining cloud bridge debt is further diff --git a/src/legacy_document_open_services.cpp b/src/legacy_document_open_services.cpp index 6c0d3fdc..16acaf1e 100644 --- a/src/legacy_document_open_services.cpp +++ b/src/legacy_document_open_services.cpp @@ -71,6 +71,13 @@ void open_legacy_project(App& app, const pp::app::DocumentOpenRoute& route) } } +void reconcile_downloaded_project_open(App& app) +{ + for (auto& layer : app.canvas->m_canvas->m_layers) + app.layers->add_layer(layer->m_name.c_str(), false); + ActionManager::clear(); +} + class LegacyDocumentOpenServices final : public pp::app::DocumentOpenServices { public: explicit LegacyDocumentOpenServices(App& app) noexcept @@ -155,9 +162,7 @@ void execute_legacy_downloaded_project_open( app.doc_name = std::string(name); app.title_update(); - for (auto& layer : app.canvas->m_canvas->m_layers) - app.layers->add_layer(layer->m_name.c_str(), false); - ActionManager::clear(); + reconcile_downloaded_project_open(app); } } // namespace pp::panopainter