Route cloud download reconcile through document open services

This commit is contained in:
2026-06-15 20:31:17 +02:00
parent fdf2e56182
commit 80533fae5b
6 changed files with 75 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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 post-open reconciliation now also routes
through `src/legacy_document_open_services.*` instead of living inline in
`src/legacy_cloud_services.cpp`, so the remaining cloud bridge debt is further
concentrated on prompt/progress lifetime, OpenGL context guarding,
`NodeDialogCloud`, and transfer-thread execution.
Recent 2026-06-13 retained preview reductions continue to narrow DEBT-0036:
`NodeStrokePreview::draw_stroke_immediate()` now also routes

View File

@@ -518,6 +518,42 @@ Completed Task Log:
| --- | --- | ---: | --- | --- |
| 2026-06-15 | ADP-012 | no score movement | `ctest --preset desktop-fast --build-config Debug -R "pp_app_core_document_cloud" --output-on-failure`; `MSBuild.exe out\build\windows-msvc-default\panopainter_app.vcxproj /p:Configuration=Debug /p:Platform=x64` | `3e0a6b2c` |
### ADP-013 - Route Cloud Downloaded-Project Reconciliation Through Document Open Services
Status: Done
Score: no score movement
Debt: `DEBT-0038`
Scope: `src/legacy_cloud_services.cpp`,
`src/legacy_document_open_services.*`
Goal:
Move the retained downloaded-project post-open reconciliation used by cloud
download out of `src/legacy_cloud_services.cpp` and behind a focused legacy
document-open helper so the cloud bridge no longer owns inline camera reset,
layer refresh, title update, and history-clear behavior.
Done Checks:
- `LegacyCloudServices::start_download(...)` no longer owns inline
downloaded-project post-open reconciliation.
- Retained cloud downloaded-project open, layer refresh, and action-history
reset now route through `src/legacy_document_open_services.*`.
- `DEBT-0038` and the roadmap note the reduced remaining cloud bridge surface.
Validation:
```powershell
ctest --preset desktop-fast --build-config Debug -R "pp_app_core_document_cloud" --output-on-failure
& '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
```
Completed Task Log:
| Date | Task | Score | Validation | Commit |
| --- | --- | ---: | --- | --- |
| 2026-06-15 | ADP-013 | no score movement | `ctest --preset desktop-fast --build-config Debug -R "pp_app_core_document_cloud" --output-on-failure`; `MSBuild.exe out\build\windows-msvc-default\panopainter_app.vcxproj /p:Configuration=Debug /p:Platform=x64` | `(pending)` |
Completed Task Log:
| Date | Task | Score | Validation | Commit |

View File

@@ -7,6 +7,7 @@
#include "legacy_app_dialog_services.h"
#include "legacy_canvas_view_services.h"
#include "legacy_document_session_services.h"
#include "legacy_document_open_services.h"
#include "legacy_ui_overlay_services.h"
#include "node_dialog_cloud.h"
#include "node_progress_bar.h"
@@ -259,18 +260,7 @@ public:
m->m_message->set_text(progress.c_str());
});
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();
app->canvas->m_canvas->project_open_thread(request.selected_path);
app->doc_name = request.selected_name;
app->title_update();
for (auto& l : app->canvas->m_canvas->m_layers)
app->layers->add_layer(l->m_name.c_str(), false);
ActionManager::clear();
execute_legacy_downloaded_project_open(*app, request.selected_path, request.selected_name);
pp::panopainter::close_legacy_dialog_node(*m);
}).detach();
}

View File

@@ -141,4 +141,23 @@ pp::foundation::Status execute_legacy_document_open_plan(
return pp::app::execute_document_open_plan(action, route, services);
}
void execute_legacy_downloaded_project_open(
App& app,
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();
app.canvas->m_canvas->project_open_thread(std::string(path));
app.doc_name = std::string(name);
app.title_update();
for (auto& layer : app.canvas->m_canvas->m_layers)
app.layers->add_layer(layer->m_name.c_str(), false);
ActionManager::clear();
}
} // namespace pp::panopainter

View File

@@ -3,6 +3,8 @@
#include "app_core/document_session.h"
#include "foundation/result.h"
#include <string_view>
class App;
namespace pp::panopainter {
@@ -12,4 +14,9 @@ namespace pp::panopainter {
pp::app::DocumentOpenPlanAction action,
const pp::app::DocumentOpenRoute& route);
void execute_legacy_downloaded_project_open(
App& app,
std::string_view path,
std::string_view name);
} // namespace pp::panopainter