From 7850d90efecb66a955a9084ff13688a693d0a364 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Mon, 15 Jun 2026 21:39:45 +0200 Subject: [PATCH] Extract cloud download flow helper --- docs/modernization/debt.md | 6 ++++++ docs/modernization/roadmap.md | 5 +++++ docs/modernization/tasks.md | 33 +++++++++++++++++++++++++++++++++ src/legacy_cloud_services.cpp | 18 ++++++++++++++---- 4 files changed, 58 insertions(+), 4 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 2affc984..9d7f47b9 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 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 + 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 post-transfer open/close sequence in `execute_cloud_download_thread()` now routes through a focused helper in `src/legacy_cloud_services.cpp` instead diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 24b98400..92e059d5 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -197,6 +197,11 @@ The retained cloud download post-transfer open/close sequence 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 download flow in +`execute_cloud_download_thread()` 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 7250e3bf..0e54106a 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -1162,6 +1162,39 @@ Completed Task Log: | Date | Task | Score | Validation | Commit | | --- | --- | ---: | --- | --- | | 2026-06-15 | ADP-030 | no score movement | `powershell -ExecutionPolicy Bypass -File scripts\\automation\\quiet-validate.ps1 -BuildTargets pano_cli -TestRegex "pp_app_core_document_cloud"` | `2b8c11bf` | + +### ADP-031 - Extract Cloud Download Flow Helper + +Status: Done +Score: no score movement +Debt: `DEBT-0038` +Scope: `src/legacy_cloud_services.cpp` only + +Goal: + +Reduce the inline retained cloud download worker body by extracting the +remaining flow path from `execute_cloud_download_thread()` into a focused +helper while preserving current behavior. + +Done Checks: + +- The retained cloud download worker body no longer lives inline in + `execute_cloud_download_thread()`. +- The retained cloud download worker 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 7b4b2615..644a8234 100644 --- a/src/legacy_cloud_services.cpp +++ b/src/legacy_cloud_services.cpp @@ -76,6 +76,10 @@ void execute_cloud_download_transfer( std::string dest_filepath, std::function progress); +void execute_cloud_download_flow( + App& app, + const pp::app::CloudDownloadRequest& request); + std::shared_ptr create_cloud_download_progress_dialog(App& app) { return pp::panopainter::create_legacy_app_message_dialog( @@ -147,6 +151,15 @@ void open_downloaded_project_and_close_dialog( pp::panopainter::close_legacy_dialog_node(*dialog); } +void execute_cloud_download_flow( + App& app, + const pp::app::CloudDownloadRequest& request) +{ + auto m = create_cloud_download_progress_dialog(app); + execute_cloud_download_transfer_with_progress_dialog(app, request, m); + open_downloaded_project_and_close_dialog(app, request, m); +} + void execute_cloud_upload_transfer( App& app, std::string filename, @@ -196,10 +209,7 @@ void execute_cloud_download_thread( const pp::app::CloudDownloadRequest& request) { BT_SetTerminate(); - - auto m = create_cloud_download_progress_dialog(app); - execute_cloud_download_transfer_with_progress_dialog(app, request, m); - open_downloaded_project_and_close_dialog(app, request, m); + execute_cloud_download_flow(app, request); } void launch_cloud_download_thread(