diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index c5ca75d5..73bca3ed 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-browser + OK-button wiring in `LegacyCloudServices::show_browser()` 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-publish prompt button wiring in `LegacyCloudServices::prompt_publish()` 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 ec4ecde8..d4d6f108 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -144,6 +144,11 @@ The retained cloud-publish prompt button wiring in 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. +The retained cloud-browser OK-button wiring in +`LegacyCloudServices::show_browser()` 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 e7663e4a..6106669d 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -801,6 +801,41 @@ Completed Task Log: | --- | --- | ---: | --- | --- | | 2026-06-15 | ADP-020 | 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` | `a3c7af71` | +### ADP-021 - Extract Cloud Browser OK Wiring Helper + +Status: Done +Score: no score movement +Debt: `DEBT-0038` +Scope: `src/legacy_cloud_services.cpp` only + +Goal: + +Reduce the inline retained cloud-browser dialog surface by extracting the +OK-button wiring built inside `LegacyCloudServices::show_browser()` into a +focused helper while preserving current behavior. + +Done Checks: + +- The retained cloud-browser OK-button wiring no longer lives inline in + `LegacyCloudServices::show_browser()`. +- The retained browser action-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-021 | 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` | `(pending)` | + Completed Task Log: | Date | Task | Score | Validation | Commit | diff --git a/src/legacy_cloud_services.cpp b/src/legacy_cloud_services.cpp index d6799a1e..d9e97e66 100644 --- a/src/legacy_cloud_services.cpp +++ b/src/legacy_cloud_services.cpp @@ -14,6 +14,11 @@ #include "util.h" namespace pp::panopainter { +pp::foundation::Status execute_legacy_cloud_download_selection_action( + App& app, + pp::app::CloudDownloadSelectionAction action, + NodeDialogCloud& dialog); + namespace { #if WITH_CURL @@ -206,6 +211,18 @@ void wire_cloud_publish_prompt_buttons( } #endif //WITH_CURL +void wire_cloud_browser_ok_button( + const std::shared_ptr& dialog, + App* app) +{ + dialog->btn_ok->on_click = [app, dialog](Node*) { + const auto selection_plan = pp::app::plan_cloud_download_selection(dialog->selected_file); + const auto status = execute_legacy_cloud_download_selection_action(*app, selection_plan, *dialog); + if (!status.ok()) + LOG("Cloud download selection action failed: %s", status.message); + }; +} + class LegacyCloudServices final : public pp::app::CloudServices { public: explicit LegacyCloudServices(App& app) noexcept @@ -266,14 +283,7 @@ public: void show_browser() override { auto dialog = pp::panopainter::create_legacy_cloud_browser_dialog_overlay(app_); - - auto* app = &app_; - dialog->btn_ok->on_click = [app, dialog](Node*) { - const auto selection_plan = pp::app::plan_cloud_download_selection(dialog->selected_file); - const auto status = execute_legacy_cloud_download_selection_action(*app, selection_plan, *dialog); - if (!status.ok()) - LOG("Cloud download selection action failed: %s", status.message); - }; + wire_cloud_browser_ok_button(dialog, &app_); } void start_download(const pp::app::CloudDownloadRequest& request) override