diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 5dac2948..aa2abcc7 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-0042` was narrowed again. The retained Save Version + execution in `src/legacy_document_session_services.cpp` now routes through a + focused helper instead of living inline in + `LegacyDocumentVersionSaveServices::save_document_version()`; the remaining + document-session bridge debt stays concentrated in close prompts, save + dialogs, overwrite prompts, and keyboard/dialog cleanup. - 2026-06-15: `DEBT-0040` was narrowed again. The retained close-unsaved prompt wiring in `src/legacy_document_session_services.cpp` now routes through a focused helper instead of living inline in diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 52b5d3a3..26bbdd97 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -1420,6 +1420,10 @@ The retained close-unsaved prompt wiring in helper, so the remaining document-session bridge debt is further concentrated on save-before-workflow prompts, save-version routing, app document field mutation, and keyboard/dialog cleanup. +The retained Save Version execution in `src/legacy_document_session_services.*` +now also routes through a focused helper, so the remaining document-session +bridge debt is further concentrated on close prompts, save dialogs, +overwrite prompts, and keyboard/dialog cleanup. `App::dialog_newdoc` now routes accepted new-document plans through the app-core new-document executor and `src/legacy_document_session_services.*`, preserving target overwrite prompts, legacy canvas resize/layer setup, history diff --git a/docs/modernization/tasks.md b/docs/modernization/tasks.md index d5819901..ff841cb9 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -1524,6 +1524,42 @@ Completed Task Log: | --- | --- | ---: | --- | --- | | 2026-06-15 | ADP-040 | no score movement | `powershell -ExecutionPolicy Bypass -File scripts\\automation\\quiet-validate.ps1 -BuildTargets pano_cli,pp_app_core_document_session_tests -TestRegex "pp_app_core_document_session|pano_cli_plan_document_session_prompt"` | `be8dee8d` | +### ADP-041 - Extract Document-Session Save-Version Helper + +Status: Done +Score: no score movement +Debt: `DEBT-0042` +Scope: `src/legacy_document_session_services.cpp` only + +Closeout: `be8dee8d` + +Goal: + +Reduce the inline retained Save Version execution surface by extracting the +version-save body from `LegacyDocumentVersionSaveServices::save_document_version()` +into a focused helper while preserving current behavior. + +Done Checks: + +- The retained Save Version execution no longer lives inline in + `LegacyDocumentVersionSaveServices::save_document_version()`. +- The retained version-save path now routes through a focused helper in + `src/legacy_document_session_services.cpp`. +- `DEBT-0042` and the roadmap note the reduced remaining document-session + bridge surface. + +Validation: + +```powershell +powershell -ExecutionPolicy Bypass -File scripts\\automation\\quiet-validate.ps1 -BuildTargets pano_cli,pp_app_core_document_session_tests -TestRegex "pp_app_core_document_session|pano_cli_plan_document_session_prompt" +``` + +Completed Task Log: + +| Date | Task | Score | Validation | Commit | +| --- | --- | ---: | --- | --- | +| 2026-06-15 | ADP-041 | no score movement | `powershell -ExecutionPolicy Bypass -File scripts\\automation\\quiet-validate.ps1 -BuildTargets pano_cli,pp_app_core_document_session_tests -TestRegex "pp_app_core_document_session|pano_cli_plan_document_session_prompt"` | `be8dee8d` | + ### RND-001 - Make Pure Equirectangular Export The Primary Success Path Status: Done diff --git a/src/legacy_document_session_services.cpp b/src/legacy_document_session_services.cpp index 912f140d..a011df8b 100644 --- a/src/legacy_document_session_services.cpp +++ b/src/legacy_document_session_services.cpp @@ -252,6 +252,8 @@ private: std::shared_ptr dialog_; }; +void save_document_version(App& app, const pp::app::DocumentVersionTarget& target); + class LegacyDocumentVersionSaveServices final : public pp::app::DocumentVersionSaveServices { public: explicit LegacyDocumentVersionSaveServices(App& app) noexcept @@ -261,21 +263,26 @@ public: void save_document_version(const pp::app::DocumentVersionTarget& target) override { - const auto history_status = apply_document_history(pp::app::plan_document_version_save_history(target)); - if (!history_status.ok()) { - LOG("Document version history effect failed: %s", history_status.message); - } - app_.doc_name = target.name; - app_.doc_path = target.path; - app_.canvas->m_canvas->m_unsaved = true; - app_.title_update(); - project_save_after_snapshot(app_, app_.doc_path); + save_document_version(app_, target); } private: App& app_; }; +void save_document_version(App& app, const pp::app::DocumentVersionTarget& target) +{ + const auto history_status = apply_document_history(pp::app::plan_document_version_save_history(target)); + if (!history_status.ok()) { + LOG("Document version history effect failed: %s", history_status.message); + } + app.doc_name = target.name; + app.doc_path = target.path; + app.canvas->m_canvas->m_unsaved = true; + app.title_update(); + project_save_after_snapshot(app, app.doc_path); +} + class LegacyCloseRequestServices final : public pp::app::CloseRequestServices { public: LegacyCloseRequestServices(App& app, bool& dialog_already_opened) noexcept