diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index dcf15b11..00b52956 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 camera reset and layer-clear setup in + `execute_legacy_downloaded_project_open()` now routes 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 downloaded- project open, layer refresh, and action-history reset in `execute_legacy_downloaded_project_open()` now route through a focused diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 6a9ea36e..e5499d0f 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 camera reset and layer-clear setup in +`execute_legacy_downloaded_project_open()` now also routes 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 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 diff --git a/docs/modernization/tasks.md b/docs/modernization/tasks.md index f8c16daa..ecb91430 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -1344,6 +1344,43 @@ Completed Task Log: | --- | --- | ---: | --- | --- | | 2026-06-15 | ADP-035 | no score movement | `powershell -ExecutionPolicy Bypass -File scripts\\automation\\quiet-validate.ps1 -BuildTargets pano_cli -TestRegex "pp_app_core_document_cloud"` | `69603ed6` | +### ADP-036 - Extract Downloaded Project Open Prep Helper + +Status: Done +Score: no score movement +Debt: `DEBT-0038` +Scope: `src/legacy_document_open_services.*` only + +Closeout: `69603ed6` + +Goal: + +Reduce the inline retained downloaded-project open setup surface by +extracting the camera reset and layer-clear path from +`execute_legacy_downloaded_project_open()` into a focused helper while +preserving current behavior. + +Done Checks: + +- The retained downloaded-project camera reset and layer-clear setup no + longer lives inline in `execute_legacy_downloaded_project_open()`. +- The retained downloaded-project open setup now routes through a focused + helper in `src/legacy_document_open_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-036 | no score movement | `powershell -ExecutionPolicy Bypass -File scripts\\automation\\quiet-validate.ps1 -BuildTargets pano_cli -TestRegex "pp_app_core_document_cloud"` | `69603ed6` | + ### RND-001 - Make Pure Equirectangular Export The Primary Success Path Status: Done diff --git a/src/legacy_document_open_services.cpp b/src/legacy_document_open_services.cpp index 16acaf1e..291f9e7b 100644 --- a/src/legacy_document_open_services.cpp +++ b/src/legacy_document_open_services.cpp @@ -78,6 +78,14 @@ void reconcile_downloaded_project_open(App& app) ActionManager::clear(); } +void prepare_downloaded_project_open(App& app) +{ + const auto reset_status = execute_legacy_canvas_camera_reset(app); + if (!reset_status.ok()) + LOG("Cloud download camera reset failed: %s", reset_status.message); + app.layers->clear(); +} + class LegacyDocumentOpenServices final : public pp::app::DocumentOpenServices { public: explicit LegacyDocumentOpenServices(App& app) noexcept @@ -153,11 +161,7 @@ void execute_legacy_downloaded_project_open( std::string_view path, std::string_view name) { - const auto reset_status = execute_legacy_canvas_camera_reset(app); - if (!reset_status.ok()) - LOG("Cloud download camera reset failed: %s", reset_status.message); - app.layers->clear(); - + prepare_downloaded_project_open(app); app.canvas->m_canvas->project_open_thread(std::string(path)); app.doc_name = std::string(name);