Extract cloud publish prompt wiring helper

This commit is contained in:
2026-06-15 21:03:46 +02:00
parent 87e1307d12
commit a3c7af716d
4 changed files with 60 additions and 7 deletions

View File

@@ -18,6 +18,12 @@ agent or engineer to remove them without reconstructing context from chat.
## Recent Reductions ## Recent Reductions
- 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
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 - 2026-06-15: `DEBT-0038` was narrowed again. The retained cloud-publish
worker body in `LegacyCloudServices::prompt_publish()` now routes through a worker body in `LegacyCloudServices::prompt_publish()` now routes through a
focused helper in `src/legacy_cloud_services.cpp` instead of living inline focused helper in `src/legacy_cloud_services.cpp` instead of living inline

View File

@@ -139,6 +139,11 @@ The retained cloud-publish worker body in
helper in `src/legacy_cloud_services.cpp`, so the remaining cloud bridge debt helper in `src/legacy_cloud_services.cpp`, so the remaining cloud bridge debt
is further concentrated on retained prompt/progress lifetime, OpenGL context is further concentrated on retained prompt/progress lifetime, OpenGL context
guarding, and the still-retained transfer-thread execution model. guarding, and the still-retained transfer-thread execution model.
The retained cloud-publish prompt button wiring in
`LegacyCloudServices::prompt_publish()` 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: Recent 2026-06-13 retained preview reductions continue to narrow DEBT-0036:
`NodeStrokePreview::draw_stroke_immediate()` now also routes `NodeStrokePreview::draw_stroke_immediate()` now also routes

View File

@@ -766,6 +766,41 @@ Completed Task Log:
| --- | --- | ---: | --- | --- | | --- | --- | ---: | --- | --- |
| 2026-06-15 | ADP-019 | 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` | `34e9789f` | | 2026-06-15 | ADP-019 | 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` | `34e9789f` |
### ADP-020 - Extract Cloud Publish Prompt Wiring Helper
Status: Done
Score: no score movement
Debt: `DEBT-0038`
Scope: `src/legacy_cloud_services.cpp` only
Goal:
Reduce the inline retained cloud-publish prompt surface by extracting the
OK/cancel button wiring built inside `LegacyCloudServices::prompt_publish()`
into a focused helper while preserving current behavior.
Done Checks:
- The retained cloud-publish prompt button wiring no longer lives inline in
`LegacyCloudServices::prompt_publish()`.
- The retained publish prompt lifetime 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-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` | `(pending)` |
Completed Task Log: Completed Task Log:
| Date | Task | Score | Validation | Commit | | Date | Task | Score | Validation | Commit |

View File

@@ -191,6 +191,19 @@ void execute_cloud_publish_worker(App& app, bool save_before_upload)
const auto success_plan = pp::app::plan_cloud_upload_success_prompt(); const auto success_plan = pp::app::plan_cloud_upload_success_prompt();
app.message_box(success_plan.title, success_plan.message, success_plan.show_cancel); app.message_box(success_plan.title, success_plan.message, success_plan.show_cancel);
} }
void wire_cloud_publish_prompt_buttons(
const std::shared_ptr<NodeMessageBox>& dialog,
std::function<void()> upload_thread)
{
dialog->btn_ok->on_click = [dialog, upload_thread](Node*) {
std::thread(upload_thread).detach();
pp::panopainter::close_legacy_dialog_node(*dialog);
};
dialog->btn_cancel->on_click = [dialog](Node*) {
pp::panopainter::close_legacy_dialog_node(*dialog);
};
}
#endif //WITH_CURL #endif //WITH_CURL
class LegacyCloudServices final : public pp::app::CloudServices { class LegacyCloudServices final : public pp::app::CloudServices {
@@ -215,13 +228,7 @@ public:
const auto prompt_plan = pp::app::plan_cloud_publish_prompt(); const auto prompt_plan = pp::app::plan_cloud_publish_prompt();
auto m = app_.message_box(prompt_plan.title, prompt_plan.message, prompt_plan.show_cancel); auto m = app_.message_box(prompt_plan.title, prompt_plan.message, prompt_plan.show_cancel);
m->btn_ok->on_click = [m, upload_thread](Node*) { wire_cloud_publish_prompt_buttons(m, upload_thread);
std::thread(upload_thread).detach();
pp::panopainter::close_legacy_dialog_node(*m);
};
m->btn_cancel->on_click = [m](Node*) {
pp::panopainter::close_legacy_dialog_node(*m);
};
} }
void begin_bulk_upload(int progress_total, bool show_progress) override void begin_bulk_upload(int progress_total, bool show_progress) override