Split apple clipboard dispatch

This commit is contained in:
2026-06-13 19:33:17 +02:00
parent 2daec76f02
commit 2ec4896578
5 changed files with 77 additions and 10 deletions

View File

@@ -67,6 +67,13 @@ agent or engineer to remove them without reconstructing context from chat.
- 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: `PLT-008` was narrowed again. Apple clipboard get/set now routes
through `src/platform_apple/apple_platform_services.*` instead of the
catch-all legacy adapter; the Apple path still owns the OS-specific clipboard
calls.
- 2026-06-13: `PLT-008` was narrowed again. Apple clipboard get/set now routes
through the Apple service boundary instead of the catch-all legacy adapter;
the Apple path still owns the OS-specific clipboard calls.
- 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.

View File

@@ -1396,6 +1396,40 @@ Completed Task Log:
| --- | --- | ---: | --- | --- |
| 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` | `623fdc67` |
### PLT-008 - Split Apple Clipboard Dispatch From Legacy Platform Adapter
Status: Done
Score: +1 platform alignment and package parity
Debt: `DEBT-0016`, `DEBT-0017`, `DEBT-0051`
Scope: `src/platform_legacy/legacy_platform_services.cpp`,
`src/platform_apple/apple_platform_services.*`
Goal:
Move Apple clipboard get/set dispatch out of the catch-all legacy platform
adapter into the Apple platform service boundary. Preserve clipboard behavior
and keep non-Apple behavior unchanged.
Done Checks:
- `src/platform_legacy/legacy_platform_services.cpp` no longer owns the Apple
clipboard get/set branches.
- Apple clipboard get/set still dispatches through the Apple service path.
- The debt log records the reduced Apple 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-008 | +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

View File

@@ -130,6 +130,31 @@ std::string AppleDocumentPlatformServices::format_working_directory_path(std::st
return std::string(path);
}
std::string AppleDocumentPlatformServices::clipboard_text() const
{
const std::string empty;
#if defined(__IOS__)
return [App::I->ios_view clipboard_get_string];
#elif defined(__OSX__)
return [App::I->osx_view clipboard_get_string];
#else
return empty;
#endif
}
bool AppleDocumentPlatformServices::set_clipboard_text(std::string_view text) const
{
const std::string value(text);
#if defined(__IOS__)
return [App::I->ios_view clipboard_set_string:value];
#elif defined(__OSX__)
return [App::I->osx_view clipboard_set_string:value];
#else
(void)value;
return false;
#endif
}
void AppleDocumentPlatformServices::display_file(std::string_view path) const
{
const std::string value(path);

View File

@@ -35,6 +35,8 @@ public:
[[nodiscard]] bool supports_working_directory_picker() const;
[[nodiscard]] std::string format_working_directory_path(std::string_view path) const;
[[nodiscard]] std::string clipboard_text() const;
[[nodiscard]] bool set_clipboard_text(std::string_view text) const;
void display_file(std::string_view path) const;
void share_file(std::string_view path) const;
void set_cursor_visible(bool visible) const;

View File

@@ -249,11 +249,10 @@ public:
[[nodiscard]] std::string clipboard_text() override
{
#if __IOS__
return [App::I->ios_view clipboard_get_string];
#elif __OSX__
return [App::I->osx_view clipboard_get_string];
#elif __ANDROID__
const auto family = pp::platform::current_platform_family();
if (family == pp::platform::PlatformFamily::ios || family == pp::platform::PlatformFamily::macos)
return active_apple_document_platform_services().clipboard_text();
#ifdef __ANDROID__
return android_get_clipboard();
#else
return {};
@@ -262,14 +261,14 @@ public:
[[nodiscard]] bool set_clipboard_text(std::string_view text) override
{
const auto family = pp::platform::current_platform_family();
if (family == pp::platform::PlatformFamily::ios || family == pp::platform::PlatformFamily::macos)
return active_apple_document_platform_services().set_clipboard_text(text);
const std::string value(text);
#if __IOS__
return [App::I->ios_view clipboard_set_string:value];
#elif __OSX__
return [App::I->osx_view clipboard_set_string:value];
#elif __ANDROID__
#ifdef __ANDROID__
return android_set_clipboard(value);
#else
(void)value;
return false;
#endif
}