Route prepared export policy through platform services
This commit is contained in:
@@ -546,7 +546,8 @@ Known local toolchain state:
|
|||||||
flushing, document browse roots, native UI/window state saving, live
|
flushing, document browse roots, native UI/window state saving, live
|
||||||
asset/layout reload policy, diagnostic stacktrace/crash hooks,
|
asset/layout reload policy, diagnostic stacktrace/crash hooks,
|
||||||
prepared-file writable target selection, and prepared-file save/download
|
prepared-file writable target selection, and prepared-file save/download
|
||||||
handoff;
|
handoff; PPBR and MP4 export dialogs consume the same prepared-file policy
|
||||||
|
at runtime instead of spelling mobile/Web branches locally;
|
||||||
Windows
|
Windows
|
||||||
live app execution now uses injected
|
live app execution now uses injected
|
||||||
`WindowsPlatformServices` from
|
`WindowsPlatformServices` from
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ agent or engineer to remove them without reconstructing context from chat.
|
|||||||
| DEBT-0050 | Open | Modernization | iOS exported-image photo-library publishing and WebGL persistent-storage flushing now dispatch through `PlatformServices`, but non-Windows execution still lives in `src/platform_legacy/legacy_platform_services.*` and forwards to retained `save_image_library`/`webgl_sync` bridges | Preserve current iOS/Web export and save behavior while the Apple/Web platform shells are extracted incrementally | `pp_platform_api_tests`; `ctest --preset desktop-fast --build-config Debug`; platform package smoke once Apple/Web root builds exist | Exported-image publishing and persistent-storage flushing are owned by injected Apple/Web `pp_platform_*` services with no legacy adapter branch |
|
| DEBT-0050 | Open | Modernization | iOS exported-image photo-library publishing and WebGL persistent-storage flushing now dispatch through `PlatformServices`, but non-Windows execution still lives in `src/platform_legacy/legacy_platform_services.*` and forwards to retained `save_image_library`/`webgl_sync` bridges | Preserve current iOS/Web export and save behavior while the Apple/Web platform shells are extracted incrementally | `pp_platform_api_tests`; `ctest --preset desktop-fast --build-config Debug`; platform package smoke once Apple/Web root builds exist | Exported-image publishing and persistent-storage flushing are owned by injected Apple/Web `pp_platform_*` services with no legacy adapter branch |
|
||||||
| DEBT-0051 | Open | Modernization | Document browser search roots now dispatch through `PlatformServices`, but iOS `Inbox` inclusion still lives in `src/platform_legacy/legacy_platform_services.*` | Preserve current iOS document import/browse behavior while Apple platform shells are extracted incrementally | `pp_platform_api_tests`; `ctest --preset desktop-fast --build-config Debug`; Apple package smoke once root Apple builds exist | Document browse roots are owned by injected Apple and desktop `pp_platform_*` services with no legacy adapter branch |
|
| DEBT-0051 | Open | Modernization | Document browser search roots now dispatch through `PlatformServices`, but iOS `Inbox` inclusion still lives in `src/platform_legacy/legacy_platform_services.*` | Preserve current iOS document import/browse behavior while Apple platform shells are extracted incrementally | `pp_platform_api_tests`; `ctest --preset desktop-fast --build-config Debug`; Apple package smoke once root Apple builds exist | Document browse roots are owned by injected Apple and desktop `pp_platform_*` services with no legacy adapter branch |
|
||||||
| DEBT-0052 | Open | Modernization | Native UI/window state saving now dispatches through `PlatformServices`, but macOS execution still lives in `src/platform_legacy/legacy_platform_services.*` and forwards to the retained Objective-C app bridge | Preserve current Windows/macOS UI persistence while platform shells are extracted incrementally | `pp_platform_api_tests`; `ctest --preset desktop-fast --build-config Debug`; Windows app build; Apple package smoke once root Apple builds exist | UI/window state persistence is owned by injected platform services with no legacy adapter branch |
|
| DEBT-0052 | Open | Modernization | Native UI/window state saving now dispatches through `PlatformServices`, but macOS execution still lives in `src/platform_legacy/legacy_platform_services.*` and forwards to the retained Objective-C app bridge | Preserve current Windows/macOS UI persistence while platform shells are extracted incrementally | `pp_platform_api_tests`; `ctest --preset desktop-fast --build-config Debug`; Windows app build; Apple package smoke once root Apple builds exist | UI/window state persistence is owned by injected platform services with no legacy adapter branch |
|
||||||
| DEBT-0053 | Open | Modernization | Prepared-file writable target selection now dispatches through `PlatformServices`, but iOS/Web target selection still lives in `src/platform_legacy/legacy_platform_services.*` | Preserve mobile/Web export handoff behavior while platform shells are extracted incrementally | `pp_platform_api_tests`; `ctest --preset desktop-fast --build-config Debug`; Windows app build; Apple/Web package smoke once root package builds exist | Prepared-file target selection and save/download handoff are owned by injected platform services with no legacy adapter branch |
|
| DEBT-0053 | Open | Modernization | Prepared-file writable target selection and prepared-file export-dialog policy now dispatch through `PlatformServices`, but iOS/Web target selection still lives in `src/platform_legacy/legacy_platform_services.*` | Preserve mobile/Web export handoff behavior while platform shells are extracted incrementally | `pp_platform_api_tests`; `ctest --preset desktop-fast --build-config Debug`; Windows app build; Apple/Web package smoke once root package builds exist | Prepared-file target selection, export-dialog policy, and save/download handoff are owned by injected platform services with no legacy adapter branch |
|
||||||
|
|
||||||
## Closed Debt
|
## Closed Debt
|
||||||
|
|
||||||
|
|||||||
@@ -643,6 +643,9 @@ Prepared-file writable target selection now also dispatches through
|
|||||||
`PlatformServices`, preserving the existing iOS temporary background-write path
|
`PlatformServices`, preserving the existing iOS temporary background-write path
|
||||||
and Web data-path synchronous write path while removing those platform branches
|
and Web data-path synchronous write path while removing those platform branches
|
||||||
from `App::pick_file_save`.
|
from `App::pick_file_save`.
|
||||||
|
PPBR and MP4 export dialogs now ask `PlatformServices` whether prepared-file
|
||||||
|
writes are used, so those dialog flows no longer spell local `__IOS__ ||
|
||||||
|
__WEB__` branches for mobile/Web export handoff.
|
||||||
Canvas image export publishing and explicit persistent-storage flushes now
|
Canvas image export publishing and explicit persistent-storage flushes now
|
||||||
dispatch through `PlatformServices` too, preserving iOS photo-library export
|
dispatch through `PlatformServices` too, preserving iOS photo-library export
|
||||||
publication and WebGL filesystem sync behavior in the legacy adapter while
|
publication and WebGL filesystem sync behavior in the legacy adapter while
|
||||||
@@ -1697,7 +1700,7 @@ Results:
|
|||||||
recording cleanup dispatch, exported-image publish dispatch, persistent
|
recording cleanup dispatch, exported-image publish dispatch, persistent
|
||||||
storage flush dispatch, document browse-root dispatch,
|
storage flush dispatch, document browse-root dispatch,
|
||||||
native UI/window state save dispatch, prepared-file writable target dispatch,
|
native UI/window state save dispatch, prepared-file writable target dispatch,
|
||||||
live asset/layout reload policy dispatch,
|
prepared-file export-dialog policy dispatch, live asset/layout reload policy dispatch,
|
||||||
diagnostic hook dispatch, per-frame platform hook dispatch, picker callback
|
diagnostic hook dispatch, per-frame platform hook dispatch, picker callback
|
||||||
dispatch, and prepared-file save/download callback dispatch. The live Windows
|
dispatch, and prepared-file save/download callback dispatch. The live Windows
|
||||||
app now
|
app now
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ public:
|
|||||||
void pick_file_save(const std::string& type, const std::string& default_name,
|
void pick_file_save(const std::string& type, const std::string& default_name,
|
||||||
std::function<void(std::string path)> writer, std::function<void(const std::string& path, bool saved)> callback);
|
std::function<void(std::string path)> writer, std::function<void(const std::string& path, bool saved)> callback);
|
||||||
void pick_file_save(std::vector<std::string> types, std::function<void(std::string path)> callback);
|
void pick_file_save(std::vector<std::string> types, std::function<void(std::string path)> callback);
|
||||||
|
[[nodiscard]] bool uses_prepared_file_writes() const;
|
||||||
void pick_dir(std::function<void(std::string path)> callback);
|
void pick_dir(std::function<void(std::string path)> callback);
|
||||||
void display_file(std::string path);
|
void display_file(std::string path);
|
||||||
void share_file(std::string path);
|
void share_file(std::string path);
|
||||||
|
|||||||
@@ -515,8 +515,10 @@ void App::dialog_ppbr_export()
|
|||||||
auto dialog = root->add_child_ref<NodeDialogExportPPBR>();
|
auto dialog = root->add_child_ref<NodeDialogExportPPBR>();
|
||||||
dialog->btn_ok->on_click = [this, dialog] (Node*) {
|
dialog->btn_ok->on_click = [this, dialog] (Node*) {
|
||||||
const auto request = pp::panopainter::make_legacy_brush_package_export_request(*dialog);
|
const auto request = pp::panopainter::make_legacy_brush_package_export_request(*dialog);
|
||||||
#if __IOS__ || __WEB__
|
|
||||||
App::I->pick_file_save("ppbr", "exported-brushes",
|
if (uses_prepared_file_writes())
|
||||||
|
{
|
||||||
|
pick_file_save("ppbr", "exported-brushes",
|
||||||
[this, dialog, request] (std::string path) {
|
[this, dialog, request] (std::string path) {
|
||||||
const auto status = pp::panopainter::execute_legacy_brush_package_export(
|
const auto status = pp::panopainter::execute_legacy_brush_package_export(
|
||||||
*this,
|
*this,
|
||||||
@@ -532,8 +534,10 @@ void App::dialog_ppbr_export()
|
|||||||
pp::panopainter::complete_legacy_brush_package_export(*dialog, saved);
|
pp::panopainter::complete_legacy_brush_package_export(*dialog, saved);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
#else
|
return;
|
||||||
App::I->pick_file_save({ "ppbr" }, [this, dialog, request] (std::string path) {
|
}
|
||||||
|
|
||||||
|
pick_file_save({ "ppbr" }, [this, dialog, request] (std::string path) {
|
||||||
const auto status = pp::panopainter::execute_legacy_brush_package_export(
|
const auto status = pp::panopainter::execute_legacy_brush_package_export(
|
||||||
*this,
|
*this,
|
||||||
*dialog,
|
*dialog,
|
||||||
@@ -543,7 +547,6 @@ void App::dialog_ppbr_export()
|
|||||||
if (!status.ok())
|
if (!status.ok())
|
||||||
LOG("PPBR export failed: %s", status.message);
|
LOG("PPBR export failed: %s", status.message);
|
||||||
});
|
});
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -552,7 +555,8 @@ void App::dialog_timelapse_export()
|
|||||||
if (!can_start_document_export(*this, false))
|
if (!can_start_document_export(*this, false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if __IOS__ || __WEB__
|
if (uses_prepared_file_writes())
|
||||||
|
{
|
||||||
const auto target = pp::app::make_document_export_suggested_name(doc_name, "-timelapse");
|
const auto target = pp::app::make_document_export_suggested_name(doc_name, "-timelapse");
|
||||||
if (!target) {
|
if (!target) {
|
||||||
message_box("Export Timelapse", target.status().message);
|
message_box("Export Timelapse", target.status().message);
|
||||||
@@ -574,7 +578,9 @@ void App::dialog_timelapse_export()
|
|||||||
(void)saved;
|
(void)saved;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
#else
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pick_file_save({ "mp4" }, [this](std::string path) {
|
pick_file_save({ "mp4" }, [this](std::string path) {
|
||||||
const auto status = pp::panopainter::execute_legacy_document_video_export(
|
const auto status = pp::panopainter::execute_legacy_document_video_export(
|
||||||
*this,
|
*this,
|
||||||
@@ -584,7 +590,6 @@ void App::dialog_timelapse_export()
|
|||||||
if (!status.ok())
|
if (!status.ok())
|
||||||
LOG("Document timelapse export failed: %s", status.message);
|
LOG("Document timelapse export failed: %s", status.message);
|
||||||
});
|
});
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::dialog_export_mp4()
|
void App::dialog_export_mp4()
|
||||||
@@ -592,7 +597,8 @@ void App::dialog_export_mp4()
|
|||||||
if (!can_start_document_export(*this, false))
|
if (!can_start_document_export(*this, false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if __IOS__ || __WEB__
|
if (uses_prepared_file_writes())
|
||||||
|
{
|
||||||
const auto target = pp::app::make_document_export_suggested_name(doc_name, "-animation");
|
const auto target = pp::app::make_document_export_suggested_name(doc_name, "-animation");
|
||||||
if (!target) {
|
if (!target) {
|
||||||
message_box("Export Animation", target.status().message);
|
message_box("Export Animation", target.status().message);
|
||||||
@@ -614,7 +620,9 @@ void App::dialog_export_mp4()
|
|||||||
(void)saved;
|
(void)saved;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
#else
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pick_file_save({ "mp4" }, [this](std::string path) {
|
pick_file_save({ "mp4" }, [this](std::string path) {
|
||||||
const auto status = pp::panopainter::execute_legacy_document_video_export(
|
const auto status = pp::panopainter::execute_legacy_document_video_export(
|
||||||
*this,
|
*this,
|
||||||
@@ -624,7 +632,6 @@ void App::dialog_export_mp4()
|
|||||||
if (!status.ok())
|
if (!status.ok())
|
||||||
LOG("Document animation export failed: %s", status.message);
|
LOG("Document animation export failed: %s", status.message);
|
||||||
});
|
});
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::dialog_whatsnew(bool force_show)
|
void App::dialog_whatsnew(bool force_show)
|
||||||
|
|||||||
@@ -181,6 +181,11 @@ void App::pick_file_save(std::vector<std::string> types, std::function<void(std:
|
|||||||
active_platform_services().pick_save_file(std::move(types), std::move(callback));
|
active_platform_services().pick_save_file(std::move(types), std::move(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool App::uses_prepared_file_writes() const
|
||||||
|
{
|
||||||
|
return active_platform_services().uses_prepared_file_writes();
|
||||||
|
}
|
||||||
|
|
||||||
void App::pick_dir(std::function<void(std::string path)> callback)
|
void App::pick_dir(std::function<void(std::string path)> callback)
|
||||||
{
|
{
|
||||||
redraw = true;
|
redraw = true;
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public:
|
|||||||
virtual void pick_file(std::vector<std::string> file_types, PickedPathCallback callback) = 0;
|
virtual void pick_file(std::vector<std::string> file_types, PickedPathCallback callback) = 0;
|
||||||
virtual void pick_save_file(std::vector<std::string> file_types, PickedPathCallback callback) = 0;
|
virtual void pick_save_file(std::vector<std::string> file_types, PickedPathCallback callback) = 0;
|
||||||
virtual void pick_directory(PickedPathCallback callback) = 0;
|
virtual void pick_directory(PickedPathCallback callback) = 0;
|
||||||
|
[[nodiscard]] virtual bool uses_prepared_file_writes() = 0;
|
||||||
[[nodiscard]] virtual PreparedFileTarget prepare_writable_file(
|
[[nodiscard]] virtual PreparedFileTarget prepare_writable_file(
|
||||||
std::string_view type,
|
std::string_view type,
|
||||||
std::string_view default_name,
|
std::string_view default_name,
|
||||||
|
|||||||
@@ -431,6 +431,15 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] bool uses_prepared_file_writes() override
|
||||||
|
{
|
||||||
|
#if __IOS__ || __WEB__
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
||||||
std::string_view type,
|
std::string_view type,
|
||||||
std::string_view default_name,
|
std::string_view default_name,
|
||||||
|
|||||||
@@ -448,6 +448,11 @@ public:
|
|||||||
invoke_selected_path(path, callback);
|
invoke_selected_path(path, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] bool uses_prepared_file_writes() override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
||||||
std::string_view type,
|
std::string_view type,
|
||||||
std::string_view default_name,
|
std::string_view default_name,
|
||||||
|
|||||||
@@ -210,6 +210,12 @@ public:
|
|||||||
callback(directory_path);
|
callback(directory_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] bool uses_prepared_file_writes() override
|
||||||
|
{
|
||||||
|
++prepared_file_write_policy_checks;
|
||||||
|
return prepared_file_writes;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
||||||
std::string_view type,
|
std::string_view type,
|
||||||
std::string_view default_name,
|
std::string_view default_name,
|
||||||
@@ -269,11 +275,13 @@ public:
|
|||||||
int pick_file_requests = 0;
|
int pick_file_requests = 0;
|
||||||
int pick_save_file_requests = 0;
|
int pick_save_file_requests = 0;
|
||||||
int pick_directory_requests = 0;
|
int pick_directory_requests = 0;
|
||||||
|
int prepared_file_write_policy_checks = 0;
|
||||||
int prepare_writable_file_requests = 0;
|
int prepare_writable_file_requests = 0;
|
||||||
int save_prepared_file_requests = 0;
|
int save_prepared_file_requests = 0;
|
||||||
bool cursor_visible = false;
|
bool cursor_visible = false;
|
||||||
bool keyboard_visible = false;
|
bool keyboard_visible = false;
|
||||||
bool prepared_file_saved = true;
|
bool prepared_file_saved = true;
|
||||||
|
bool prepared_file_writes = true;
|
||||||
bool deletes_recorded_files = true;
|
bool deletes_recorded_files = true;
|
||||||
bool live_asset_reloading = true;
|
bool live_asset_reloading = true;
|
||||||
float last_platform_delta = 0.0f;
|
float last_platform_delta = 0.0f;
|
||||||
@@ -571,8 +579,14 @@ void platform_services_dispatch_writable_file_target(pp::tests::Harness& harness
|
|||||||
FakePlatformServices fake("unused");
|
FakePlatformServices fake("unused");
|
||||||
pp::platform::PlatformServices& services = fake;
|
pp::platform::PlatformServices& services = fake;
|
||||||
|
|
||||||
|
PP_EXPECT(harness, services.uses_prepared_file_writes());
|
||||||
|
fake.prepared_file_writes = false;
|
||||||
|
PP_EXPECT(harness, !services.uses_prepared_file_writes());
|
||||||
|
fake.prepared_file_writes = true;
|
||||||
|
|
||||||
const auto target = services.prepare_writable_file("mp4", "export", "D:/Paint", "D:/Paint/tmp");
|
const auto target = services.prepare_writable_file("mp4", "export", "D:/Paint", "D:/Paint/tmp");
|
||||||
|
|
||||||
|
PP_EXPECT(harness, fake.prepared_file_write_policy_checks == 2);
|
||||||
PP_EXPECT(harness, fake.prepare_writable_file_requests == 1);
|
PP_EXPECT(harness, fake.prepare_writable_file_requests == 1);
|
||||||
PP_EXPECT(harness, fake.writable_file_type == "mp4");
|
PP_EXPECT(harness, fake.writable_file_type == "mp4");
|
||||||
PP_EXPECT(harness, fake.writable_file_default_name == "export");
|
PP_EXPECT(harness, fake.writable_file_default_name == "export");
|
||||||
|
|||||||
Reference in New Issue
Block a user