From 07f3ca81f081256eada738f5e5f85eaab25c6f7a Mon Sep 17 00:00:00 2001 From: omigamedev Date: Mon, 15 Jun 2026 21:42:25 +0200 Subject: [PATCH] Extract cloud publish transfer helper --- docs/modernization/debt.md | 6 ++++++ docs/modernization/roadmap.md | 5 +++++ docs/modernization/tasks.md | 33 ++++++++++++++++++++++++++++++ src/legacy_cloud_services.cpp | 38 ++++++++++++++++++++--------------- 4 files changed, 66 insertions(+), 16 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 9d7f47b9..4bd46bb2 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -18,6 +18,12 @@ agent or engineer to remove them without reconstructing context from chat. ## Recent Reductions +- 2026-06-15: `DEBT-0038` was narrowed again. The retained cloud publish + transfer-and-success body in `execute_cloud_publish_worker()` now routes + through a focused helper in `src/legacy_cloud_services.cpp` instead of + living inline in the retained worker body; 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 download flow in `execute_cloud_download_thread()` 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 92e059d5..728ea6b6 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -202,6 +202,11 @@ The retained cloud download flow in `src/legacy_cloud_services.cpp`, so the remaining cloud bridge debt is further concentrated on retained prompt/progress lifetime, OpenGL context guarding, and the still-retained transfer-thread execution model. +The retained cloud publish transfer-and-success body in +`execute_cloud_publish_worker()` now also routes through a focused helper in +`src/legacy_cloud_services.cpp`, so the remaining cloud bridge debt is +further concentrated on retained prompt/progress lifetime, OpenGL context +guarding, and the still-retained transfer-thread execution model. Recent 2026-06-13 retained preview reductions continue to narrow DEBT-0036: `NodeStrokePreview::draw_stroke_immediate()` now also routes diff --git a/docs/modernization/tasks.md b/docs/modernization/tasks.md index 90516fd5..a1dc98d4 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -1198,6 +1198,39 @@ Completed Task Log: | Date | Task | Score | Validation | Commit | | --- | --- | ---: | --- | --- | | 2026-06-15 | ADP-031 | no score movement | `powershell -ExecutionPolicy Bypass -File scripts\\automation\\quiet-validate.ps1 -BuildTargets pano_cli -TestRegex "pp_app_core_document_cloud"` | `7850d90e` | + +### ADP-032 - Extract Cloud Publish Transfer Helper + +Status: Done +Score: no score movement +Debt: `DEBT-0038` +Scope: `src/legacy_cloud_services.cpp` only + +Goal: + +Reduce the inline retained cloud publish transfer-and-success surface by +extracting the worker body from `execute_cloud_publish_worker()` into a +focused helper while preserving current behavior. + +Done Checks: + +- The retained cloud publish transfer-and-success body no longer lives inline + in `execute_cloud_publish_worker()`. +- The retained cloud publish transfer-and-success body now routes through a + focused helper in `src/legacy_cloud_services.cpp`. +- `DEBT-0038` and the roadmap note the reduced remaining cloud bridge + surface. + +Validation: + +```powershell +powershell -ExecutionPolicy Bypass -File scripts\automation\quiet-validate.ps1 -BuildTargets pano_cli -TestRegex "pp_app_core_document_cloud" +``` + +Completed Task Log: + +| Date | Task | Score | Validation | Commit | +| --- | --- | ---: | --- | --- | | 2026-06-15 | ADP-007 | +1 legacy adapter retirement | `ctest --preset desktop-fast --build-config Debug -R "pp_app_core_app_dialog\|pp_ui_core_node_lifetime\|pp_ui_core_overlay_lifetime" --output-on-failure`; `ctest --preset desktop-fast --build-config Debug -R "pp_app_core_main_toolbar" --output-on-failure`; `MSBuild.exe out\build\windows-msvc-default\tests\pp_app_core_main_toolbar_tests.vcxproj /p:Configuration=Debug /p:Platform=x64`; `MSBuild.exe out\build\windows-msvc-default\panopainter_app.vcxproj /p:Configuration=Debug /p:Platform=x64` | `8db859cb` | ### RND-001 - Make Pure Equirectangular Export The Primary Success Path diff --git a/src/legacy_cloud_services.cpp b/src/legacy_cloud_services.cpp index 644a8234..1cadae39 100644 --- a/src/legacy_cloud_services.cpp +++ b/src/legacy_cloud_services.cpp @@ -204,6 +204,27 @@ void execute_cloud_upload_transfer( } } +void execute_cloud_publish_transfer_and_success_prompt( + App& app, + bool save_before_upload) +{ + if (save_before_upload) + { + execute_legacy_document_save_before_cloud_upload(app); + } + + const auto progress_plan = pp::app::plan_cloud_upload_progress_dialog(); + auto pb = app.show_progress(progress_plan.title, progress_plan.total); + + execute_cloud_upload_transfer(app, app.doc_path, app.doc_filename, [pb](float p) { + pb->set_progress(p); + }); + + pp::panopainter::close_legacy_dialog_node(*pb); + const auto success_plan = pp::app::plan_cloud_upload_success_prompt(); + app.message_box(success_plan.title, success_plan.message, success_plan.show_cancel); +} + void execute_cloud_download_thread( App& app, const pp::app::CloudDownloadRequest& request) @@ -224,22 +245,7 @@ void launch_cloud_download_thread( void execute_cloud_publish_worker(App& app, bool save_before_upload) { BT_SetTerminate(); - - if (save_before_upload) - { - execute_legacy_document_save_before_cloud_upload(app); - } - - const auto progress_plan = pp::app::plan_cloud_upload_progress_dialog(); - auto pb = app.show_progress(progress_plan.title, progress_plan.total); - - execute_cloud_upload_transfer(app, app.doc_path, app.doc_filename, [pb](float p) { - pb->set_progress(p); - }); - - pp::panopainter::close_legacy_dialog_node(*pb); - const auto success_plan = pp::app::plan_cloud_upload_success_prompt(); - app.message_box(success_plan.title, success_plan.message, success_plan.show_cancel); + execute_cloud_publish_transfer_and_success_prompt(app, save_before_upload); } void wire_cloud_publish_prompt_buttons(