Add dedicated draw settings store and draw_images export folder#860
Merged
multiplex55 merged 7 commits intodrawingfrom Feb 15, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
draw_imagesand introduce a dedicated per-executable draw settings file to centralize persistence and enable clearer migration from legacy plugin payloads.runtime().apply_settings(...)whenever settings are loaded or persisted.settings.jsonplugin_settings["draw"]payload when the dedicated file is absent.Description
DRAW_EXPORT_SUBDIR = "draw_images"while preserving exe-relative resolution and folder auto-creation insrc/draw/save.rsand added a test asserting the new folder name.src/draw/settings_store.rsthat resolvesdraw_settings.jsonnext to the executable and implementsload/savehelpers plusload_from_path/save_to_pathwith parent-folder creation, contextual errors, and sanitization; theloadpath will migrate from legacysettings.jsonplugin payload when the dedicated file is missing.src/draw/mod.rsand updatedsrc/gui/draw_settings_dialog.rsto usesettings_store::load(...)andsettings_store::save(...)for dialog load/save flows while still writing through toSettings::plugin_settingsfor transitional compatibility and callingruntime().apply_settings(...).src/plugins/draw.rsso plugin initialization prefers the dedicated store,apply_settingschecks the dedicated store first (then falls back to the provided plugin payload), andpersist_settingswrites the dedicated store as well as producing the plugin UI payload; also adjustedsettings_uito use the plugin's in-memory settings.src/draw/save.rs(folder name assertion),src/draw/settings_store.rs(path resolution, round-trip serialization, legacy migration), GUI tests insrc/gui/mod.rs(dedicated-file persistence and migration), and plugin tests insrc/plugins/draw.rs(dedicated-store preference and legacy migration).Testing
cargo fmtsuccessfully to format changes.alsa-sys/ missingalsa.pcforpkg-config), which causedcargo testto abort during crate compilation, so added tests were not fully executed here.draw::save::tests::export_folder_name_matches_draw_images_contract,draw::settings_store::tests::settings_path_is_resolved_next_to_executable,draw::settings_store::tests::dedicated_store_roundtrip_serialization,draw::settings_store::tests::load_migrates_legacy_plugin_settings_when_dedicated_file_is_missing, GUI tests ingui::testsfor dedicated-file persistence and migration, and plugin testsplugins::draw::tests::apply_settings_prefers_dedicated_store_when_presentandplugins::draw::tests::apply_settings_migrates_from_legacy_plugin_settings_when_dedicated_missing, which should pass when run in an environment with required system libraries installed.Codex Task