From 88018f6c692ecb1e0022d57de72178992661626e Mon Sep 17 00:00:00 2001 From: omigamedev Date: Mon, 15 Jun 2026 21:27:15 +0200 Subject: [PATCH] Extract cloud download thread launcher --- docs/modernization/debt.md | 6 ++++++ docs/modernization/roadmap.md | 5 +++++ docs/modernization/tasks.md | 34 ++++++++++++++++++++++++++++++++++ src/legacy_cloud_services.cpp | 14 ++++++++++---- 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 4c3d1415..4997bc69 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 + thread launch in `LegacyCloudServices::start_download()` now routes through + a focused helper in `src/legacy_cloud_services.cpp` instead of living + inline in the retained service method; 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 browser dialog creation path in `LegacyCloudServices::show_browser()` now routes through a focused helper in `src/legacy_cloud_services.cpp` instead of diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 9ea17cc9..6f6f1eb4 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -177,6 +177,11 @@ The retained cloud browser dialog creation path in 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 thread launch in +`LegacyCloudServices::start_download()` 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 a1980bcb..5f59e112 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -1016,6 +1016,40 @@ Completed Task Log: | Date | Task | Score | Validation | Commit | | --- | --- | ---: | --- | --- | | 2026-06-15 | ADP-026 | no score movement | `MSBuild.exe out\build\windows-msvc-default\panopainter_app.vcxproj /p:Configuration=Debug /p:Platform=x64`; `ctest --preset desktop-fast --build-config Debug -R "pp_app_core_document_cloud" --output-on-failure` | `2e520709` | + +### ADP-027 - Extract Cloud Download Thread Launcher + +Status: Done +Score: no score movement +Debt: `DEBT-0038` +Scope: `src/legacy_cloud_services.cpp` only + +Goal: + +Reduce the inline retained cloud download thread-launch surface by extracting +the launch path from `LegacyCloudServices::start_download()` into a focused +helper while preserving current behavior. + +Done Checks: + +- The retained cloud download thread launch path no longer lives inline in + `LegacyCloudServices::start_download()`. +- The retained cloud download thread launch path 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 +& 'C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe' out\build\windows-msvc-default\panopainter_app.vcxproj /p:Configuration=Debug /p:Platform=x64 +ctest --preset desktop-fast --build-config Debug -R "pp_app_core_document_cloud" --output-on-failure +``` + +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 dfbaf70a..b639be6d 100644 --- a/src/legacy_cloud_services.cpp +++ b/src/legacy_cloud_services.cpp @@ -176,6 +176,15 @@ void execute_cloud_download_thread( pp::panopainter::close_legacy_dialog_node(*m); } +void launch_cloud_download_thread( + App& app, + const pp::app::CloudDownloadRequest& request) +{ + std::thread([app = &app, request] { + execute_cloud_download_thread(*app, request); + }).detach(); +} + void execute_cloud_publish_worker(App& app, bool save_before_upload) { BT_SetTerminate(); @@ -318,10 +327,7 @@ public: void start_download(const pp::app::CloudDownloadRequest& request) override { - auto* app = &app_; - std::thread([app, request] { - execute_cloud_download_thread(*app, request); - }).detach(); + launch_cloud_download_thread(app_, request); } private: