diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 52a5693..db3798e 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -61,6 +61,12 @@ agent or engineer to remove them without reconstructing context from chat. - 2026-06-13: `PLT-006` was narrowed again. macOS cursor visibility now routes through the Apple service boundary instead of the catch-all legacy adapter; the Apple path still owns the OS-specific cursor toggle. +- 2026-06-13: `PLT-007` was narrowed again. macOS UI-state saving now routes + through the Apple service boundary instead of the catch-all legacy adapter; + the Apple path still owns the OS-specific UI-state save call. +- 2026-06-13: `PLT-007` was narrowed again. macOS UI-state saving now routes + through `src/platform_apple/apple_platform_services.*` instead of the + catch-all legacy adapter; the Apple path still owns the OS-specific save call. - 2026-06-13: `DEBT-0036` was narrowed again. `NodeStrokePreview::draw_stroke_immediate()` now routes final composite execution and preview copy-back through a retained local wrapper, leaving the call site with only sequence wiring. diff --git a/docs/modernization/tasks.md b/docs/modernization/tasks.md index 97a268b..2b1e026 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -1362,6 +1362,40 @@ Completed Task Log: | --- | --- | ---: | --- | --- | | 2026-06-13 | PLT-006 | +1 platform alignment and package parity | `ctest --preset desktop-fast --build-config Debug -R pp_platform_api_tests --output-on-failure`; `cmake --build --preset windows-msvc-default --config Debug --target pp_platform_api_tests` | `fc4f5e40` | +### PLT-007 - Split Mac UI State Saving From Legacy Platform Adapter + +Status: Done +Score: +1 platform alignment and package parity +Debt: `DEBT-0017`, `DEBT-0052` +Scope: `src/platform_legacy/legacy_platform_services.cpp`, +`src/platform_apple/apple_platform_services.*` + +Goal: + +Move macOS UI-state saving out of the catch-all legacy platform adapter into +the Apple platform service boundary. Preserve current macOS UI-state saving +behavior and keep non-macOS behavior unchanged. + +Done Checks: + +- `src/platform_legacy/legacy_platform_services.cpp` no longer owns the macOS + UI-state save branch. +- macOS UI-state saving still dispatches through the Apple service path. +- The debt log records the reduced macOS platform tail. + +Validation: + +```powershell +ctest --preset desktop-fast --build-config Debug -R pp_platform_api_tests --output-on-failure +cmake --build --preset windows-msvc-default --config Debug --target pp_platform_api_tests +``` + +Completed Task Log: + +| Date | Task | Score | Validation | Commit | +| --- | --- | ---: | --- | --- | +| 2026-06-13 | PLT-007 | +1 platform alignment and package parity | `ctest --preset desktop-fast --build-config Debug -R pp_platform_api_tests --output-on-failure`; `cmake --build --preset windows-msvc-default --config Debug --target pp_platform_api_tests` | `pending` | + ### STR-010 - Extract Remaining Draw Merge Composite Orchestration Status: Done diff --git a/src/platform_apple/apple_platform_services.cpp b/src/platform_apple/apple_platform_services.cpp index 157978c..0244c5c 100644 --- a/src/platform_apple/apple_platform_services.cpp +++ b/src/platform_apple/apple_platform_services.cpp @@ -169,4 +169,11 @@ void AppleDocumentPlatformServices::set_cursor_visible(bool visible) const #endif } +void AppleDocumentPlatformServices::save_ui_state() const +{ +#if defined(__OSX__) + [App::I->osx_app save_ui_state]; +#endif +} + } diff --git a/src/platform_apple/apple_platform_services.h b/src/platform_apple/apple_platform_services.h index bcde797..d238b66 100644 --- a/src/platform_apple/apple_platform_services.h +++ b/src/platform_apple/apple_platform_services.h @@ -38,6 +38,7 @@ public: void display_file(std::string_view path) const; void share_file(std::string_view path) const; void set_cursor_visible(bool visible) const; + void save_ui_state() const; private: PlatformFamily family_; diff --git a/src/platform_legacy/legacy_platform_services.cpp b/src/platform_legacy/legacy_platform_services.cpp index b4899bd..2f54764 100644 --- a/src/platform_legacy/legacy_platform_services.cpp +++ b/src/platform_legacy/legacy_platform_services.cpp @@ -451,9 +451,7 @@ public: { if (!pp::platform::platform_saves_native_ui_state(pp::platform::current_platform_family())) return; -#ifdef __OSX__ - [App::I->osx_app save_ui_state]; -#endif + active_apple_document_platform_services().save_ui_state(); } [[nodiscard]] bool enables_live_asset_reloading() override