Merged
Conversation
Plugins declare a typed PluginConfigSchema and receive persisted values via OnConfigChanged. The host stores per-plugin JSON under %LocalAppData%/SharpFM/plugin-config/ and renders a generic settings dialog from the schema in the Plugin Manager. Plugins with an empty schema incur zero overhead and show a disabled Configure button. Closes #183
IPluginHost requires SelectedClipChanged, ClipContentChanged, and ClipCollectionChanged, but test mocks don't need to raise them. Scope the suppression tightly with #pragma so it doesn't mask real issues.
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.
Adds a configuration API so plugins can declare user-tunable settings and the host handles persistence + UI.
PluginConfigSchema+PluginConfigFieldtypes inSharpFM.Plugin(String, MultilineString, Bool, Int, Double, Enum).IPluginmembers:ConfigSchemaandOnConfigChanged. Plugins without config returnPluginConfigSchema.Emptyand a no-op handler.PluginConfigServicepersists per-plugin JSON at%LocalAppData%/SharpFM/plugin-config/{id}.json, with type coercion, default fallback for missing/invalid/drifted fields, and filename sanitization to prevent path traversal.PluginServicecallsPluginConfigService.Applyright afterInitializeso plugins receive persisted values at startup; exceptions fromOnConfigChangedare caught and logged.ClipInspectorPlugingets two demo bool fields (show element count, show XML size) so the feature is exercisable end-to-end in the shipped sample.PluginConfigSchemaTests,PluginConfigServiceTests— 38 cases covering round-trip for every field type, malformed JSON fallback, missing/wrong-type/unknown-key handling, enum validation, pluginId sanitization, and the lifecycle (Initialize→OnConfigChanged, empty-schema no-op, exception containment, fresh-service reload). Full suite: 1155 passed.Closes #183