From 776b8e410d9bb7212a6daa0feaee656f4e129261 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Fri, 20 Feb 2026 11:52:27 +0100 Subject: [PATCH] Refactored terminology --- .../Settings/SettingsPanelApp.razor.cs | 12 ++-- app/MindWork AI Studio/Settings/ConfigMeta.cs | 56 +++++++++---------- .../Settings/ManagedConfiguration.Parsing.cs | 26 ++++----- .../Settings/ManagedConfiguration.cs | 48 ++++++++-------- .../Tools/PluginSystem/PluginConfiguration.cs | 4 +- .../PluginSystem/PluginFactory.Loading.cs | 3 +- 6 files changed, 75 insertions(+), 74 deletions(-) diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs index d79bbbc5..d0166e40 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs @@ -28,14 +28,14 @@ public partial class SettingsPanelApp : SettingsPanelBase { this.SettingsManager.ConfigurationData.App.PreviewVisibility = previewVisibility; var filtered = previewVisibility.FilterPreviewFeatures(this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures); - filtered.UnionWith(this.GetManagedPreviewFeatures()); + filtered.UnionWith(this.GetPluginContributedPreviewFeatures()); this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = filtered; } - private HashSet GetManagedPreviewFeatures() + private HashSet GetPluginContributedPreviewFeatures() { - if (ManagedConfiguration.TryGet(x => x.App, x => x.EnabledPreviewFeatures, out var meta) && meta.HasManagedValue) - return meta.ManagedValue.Where(x => !x.IsReleased()).ToHashSet(); + if (ManagedConfiguration.TryGet(x => x.App, x => x.EnabledPreviewFeatures, out var meta) && meta.HasPluginContribution) + return meta.PluginContribution.Where(x => !x.IsReleased()).ToHashSet(); return []; } @@ -43,13 +43,13 @@ public partial class SettingsPanelApp : SettingsPanelBase private HashSet GetSelectedPreviewFeatures() { var enabled = this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures.Where(x => !x.IsReleased()).ToHashSet(); - enabled.UnionWith(this.GetManagedPreviewFeatures()); + enabled.UnionWith(this.GetPluginContributedPreviewFeatures()); return enabled; } private void UpdateEnabledPreviewFeatures(HashSet selectedFeatures) { - selectedFeatures.UnionWith(this.GetManagedPreviewFeatures()); + selectedFeatures.UnionWith(this.GetPluginContributedPreviewFeatures()); this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = selectedFeatures; } diff --git a/app/MindWork AI Studio/Settings/ConfigMeta.cs b/app/MindWork AI Studio/Settings/ConfigMeta.cs index aaea985e..6b81c3e8 100644 --- a/app/MindWork AI Studio/Settings/ConfigMeta.cs +++ b/app/MindWork AI Studio/Settings/ConfigMeta.cs @@ -28,14 +28,14 @@ public record ConfigMeta : ConfigMetaBase private Expression> PropertyExpression { get; } /// - /// Indicates whether the configuration is managed by a plugin and is therefore locked. + /// Indicates whether the configuration is locked by a configuration plugin. /// public bool IsLocked { get; private set; } /// - /// The ID of the plugin that manages this configuration. This is set when the configuration is locked. + /// The ID of the plugin that locked this configuration. /// - public Guid MangedByConfigPluginId { get; private set; } + public Guid LockedByConfigPluginId { get; private set; } /// /// The default value for the configuration property. This is used when resetting the property to its default state. @@ -43,68 +43,68 @@ public record ConfigMeta : ConfigMetaBase public required TValue Default { get; init; } /// - /// Indicates whether a managed value is available. + /// Indicates whether a plugin contribution is available. /// - public bool HasManagedValue { get; private set; } + public bool HasPluginContribution { get; private set; } /// - /// The managed value provided by a configuration plugin. + /// The additive value contribution provided by a configuration plugin. /// - public TValue ManagedValue { get; private set; } = default!; + public TValue PluginContribution { get; private set; } = default!; /// - /// The ID of the plugin that provided the managed value. + /// The ID of the plugin that provided the additive value contribution. /// - public Guid ManagedValueByConfigPluginId { get; private set; } + public Guid PluginContributionByConfigPluginId { get; private set; } /// - /// Locks the configuration state, indicating that it is managed by a specific plugin. + /// Locks the configuration state, indicating that it is controlled by a specific plugin. /// - /// The ID of the plugin that is managing this configuration. - public void LockManagedState(Guid pluginId) + /// The ID of the plugin that is locking this configuration. + public void LockConfiguration(Guid pluginId) { this.IsLocked = true; - this.MangedByConfigPluginId = pluginId; + this.LockedByConfigPluginId = pluginId; } /// - /// Resets the managed state of the configuration, allowing it to be modified again. + /// Resets the locked state of the configuration, allowing it to be modified again. /// This will also reset the property to its default value. /// - public void ResetManagedState() + public void ResetLockedConfiguration() { this.IsLocked = false; - this.MangedByConfigPluginId = Guid.Empty; + this.LockedByConfigPluginId = Guid.Empty; this.Reset(); } /// /// Unlocks the configuration state without changing the current value. /// - public void UnlockManagedState() + public void UnlockConfiguration() { this.IsLocked = false; - this.MangedByConfigPluginId = Guid.Empty; + this.LockedByConfigPluginId = Guid.Empty; } /// - /// Stores a managed value provided by a configuration plugin. + /// Stores an additive plugin contribution. /// - public void SetManagedValue(TValue value, Guid pluginId) + public void SetPluginContribution(TValue value, Guid pluginId) { - this.ManagedValue = value; - this.ManagedValueByConfigPluginId = pluginId; - this.HasManagedValue = true; + this.PluginContribution = value; + this.PluginContributionByConfigPluginId = pluginId; + this.HasPluginContribution = true; } /// - /// Clears the managed value without changing the current value. + /// Clears the additive plugin contribution without changing the current value. /// - public void ClearManagedValue() + public void ClearPluginContribution() { - this.ManagedValue = default!; - this.ManagedValueByConfigPluginId = Guid.Empty; - this.HasManagedValue = false; + this.PluginContribution = default!; + this.PluginContributionByConfigPluginId = Guid.Empty; + this.HasPluginContribution = false; } /// diff --git a/app/MindWork AI Studio/Settings/ManagedConfiguration.Parsing.cs b/app/MindWork AI Studio/Settings/ManagedConfiguration.Parsing.cs index 64d94e5b..e4cf5f2e 100644 --- a/app/MindWork AI Studio/Settings/ManagedConfiguration.Parsing.cs +++ b/app/MindWork AI Studio/Settings/ManagedConfiguration.Parsing.cs @@ -583,8 +583,8 @@ public static partial class ManagedConfiguration } /// - /// Attempts to process the configuration settings from a Lua table for enum set types. - /// The configured values are merged into the existing set, and the setting is left unlocked + /// Attempts to process additive plugin contributions for enum set settings from a Lua table. + /// The contributed values are merged into the existing set, and the setting remains unlocked /// so users can add additional values. /// /// The ID of the related configuration plugin. @@ -596,7 +596,7 @@ public static partial class ManagedConfiguration /// The type of the property within the configuration class. It is also the type of the set /// elements, which must be an enum. /// True when the configuration was successfully processed, otherwise false. - public static bool TryProcessConfigurationAdditive( + public static bool TryProcessConfigurationWithPluginContribution( Expression> configSelection, Expression>> propertyExpression, Guid configPluginId, @@ -653,15 +653,15 @@ public static partial class ManagedConfiguration var merged = new HashSet(currentValue); merged.UnionWith(configuredValue); configMeta.SetValue(merged); - configMeta.SetManagedValue(new HashSet(configuredValue), configPluginId); + configMeta.SetPluginContribution(new HashSet(configuredValue), configPluginId); } - else if (configMeta.HasManagedValue && configMeta.ManagedValueByConfigPluginId == configPluginId) + else if (configMeta.HasPluginContribution && configMeta.PluginContributionByConfigPluginId == configPluginId) { - configMeta.ClearManagedValue(); + configMeta.ClearPluginContribution(); } - if (configMeta.IsLocked && configMeta.MangedByConfigPluginId == configPluginId) - configMeta.UnlockManagedState(); + if (configMeta.IsLocked && configMeta.LockedByConfigPluginId == configPluginId) + configMeta.UnlockConfiguration(); return successful; } @@ -828,12 +828,12 @@ public static partial class ManagedConfiguration // Case: the setting was configured, and we could read the value successfully. // - // Set the configured value and lock the managed state: + // Set the configured value and lock the configuration: configMeta.SetValue(configuredValue); - configMeta.LockManagedState(configPluginId); + configMeta.LockConfiguration(configPluginId); break; - case false when configMeta.IsLocked && configMeta.MangedByConfigPluginId == configPluginId: + case false when configMeta.IsLocked && configMeta.LockedByConfigPluginId == configPluginId: // // Case: the setting was configured previously, but we could not read the value successfully. // This happens when the setting was removed from the configuration plugin. We handle that @@ -841,10 +841,10 @@ public static partial class ManagedConfiguration // // The other case, when the setting was locked and managed by a different configuration plugin, // is handled by the IsConfigurationLeftOver method, which checks if the configuration plugin - // is still available. If it is not available, it resets the managed state of the + // is still available. If it is not available, it resets the locked state of the // configuration setting, allowing it to be reconfigured by a different plugin or left unchanged. // - configMeta.ResetManagedState(); + configMeta.ResetLockedConfiguration(); break; case false: diff --git a/app/MindWork AI Studio/Settings/ManagedConfiguration.cs b/app/MindWork AI Studio/Settings/ManagedConfiguration.cs index fb9c64b9..363cccc1 100644 --- a/app/MindWork AI Studio/Settings/ManagedConfiguration.cs +++ b/app/MindWork AI Studio/Settings/ManagedConfiguration.cs @@ -252,13 +252,13 @@ public static partial class ManagedConfiguration if (!TryGet(configSelection, propertyExpression, out var configMeta)) return false; - if (configMeta.MangedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) + if (configMeta.LockedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) return false; - var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.MangedByConfigPluginId); + var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.LockedByConfigPluginId); if (plugin is null) { - configMeta.ResetManagedState(); + configMeta.ResetLockedConfiguration(); return true; } @@ -273,13 +273,13 @@ public static partial class ManagedConfiguration if (!TryGet(configSelection, propertyExpression, out var configMeta)) return false; - if (configMeta.MangedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) + if (configMeta.LockedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) return false; - var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.MangedByConfigPluginId); + var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.LockedByConfigPluginId); if (plugin is null) { - configMeta.ResetManagedState(); + configMeta.ResetLockedConfiguration(); return true; } @@ -297,13 +297,13 @@ public static partial class ManagedConfiguration if (!TryGet(configSelection, propertyExpression, out var configMeta)) return false; - if (configMeta.MangedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) + if (configMeta.LockedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) return false; - var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.MangedByConfigPluginId); + var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.LockedByConfigPluginId); if (plugin is null) { - configMeta.ResetManagedState(); + configMeta.ResetLockedConfiguration(); return true; } @@ -320,13 +320,13 @@ public static partial class ManagedConfiguration if (!TryGet(configSelection, propertyExpression, out var configMeta)) return false; - if (configMeta.MangedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) + if (configMeta.LockedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) return false; - var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.MangedByConfigPluginId); + var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.LockedByConfigPluginId); if (plugin is null) { - configMeta.ResetManagedState(); + configMeta.ResetLockedConfiguration(); return true; } @@ -341,13 +341,13 @@ public static partial class ManagedConfiguration if (!TryGet(configSelection, propertyExpression, out var configMeta)) return false; - if (configMeta.MangedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) + if (configMeta.LockedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) return false; - var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.MangedByConfigPluginId); + var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.LockedByConfigPluginId); if (plugin is null) { - configMeta.ResetManagedState(); + configMeta.ResetLockedConfiguration(); return true; } @@ -355,10 +355,10 @@ public static partial class ManagedConfiguration } /// - /// Checks if a managed value is left over from a configuration plugin that is no longer available. - /// If so, it clears the managed value and returns true. + /// Checks if a plugin contribution is left over from a configuration plugin that is no longer available. + /// If so, it clears the contribution and returns true. /// - public static bool IsManagedValueLeftOver( + public static bool IsPluginContributionLeftOver( Expression> configSelection, Expression>> propertyExpression, IEnumerable availablePlugins) @@ -366,13 +366,13 @@ public static partial class ManagedConfiguration if (!TryGet(configSelection, propertyExpression, out var configMeta)) return false; - if (!configMeta.HasManagedValue || configMeta.ManagedValueByConfigPluginId == Guid.Empty) + if (!configMeta.HasPluginContribution || configMeta.PluginContributionByConfigPluginId == Guid.Empty) return false; - var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.ManagedValueByConfigPluginId); + var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.PluginContributionByConfigPluginId); if (plugin is null) { - configMeta.ClearManagedValue(); + configMeta.ClearPluginContribution(); return true; } @@ -387,13 +387,13 @@ public static partial class ManagedConfiguration if (!TryGet(configSelection, propertyExpression, out var configMeta)) return false; - if (configMeta.MangedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) + if (configMeta.LockedByConfigPluginId == Guid.Empty || !configMeta.IsLocked) return false; - var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.MangedByConfigPluginId); + var plugin = availablePlugins.FirstOrDefault(x => x.Id == configMeta.LockedByConfigPluginId); if (plugin is null) { - configMeta.ResetManagedState(); + configMeta.ResetLockedConfiguration(); return true; } diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs index aff000fe..b4007b9d 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs @@ -121,8 +121,8 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT // Config: preview features visibility ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.PreviewVisibility, this.Id, settingsTable, dryRun); - // Config: enabled preview features (additive; users can enable additional features) - ManagedConfiguration.TryProcessConfigurationAdditive(x => x.App, x => x.EnabledPreviewFeatures, this.Id, settingsTable, dryRun); + // Config: enabled preview features (plugin contribution; users can enable additional features) + ManagedConfiguration.TryProcessConfigurationWithPluginContribution(x => x.App, x => x.EnabledPreviewFeatures, this.Id, settingsTable, dryRun); // Config: hide some assistants? ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.HiddenAssistants, this.Id, settingsTable, dryRun); diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs index ce994c4e..be6de578 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs @@ -218,7 +218,8 @@ public static partial class PluginFactory // Check for enabled preview features: if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.EnabledPreviewFeatures, AVAILABLE_PLUGINS)) wasConfigurationChanged = true; - if(ManagedConfiguration.IsManagedValueLeftOver(x => x.App, x => x.EnabledPreviewFeatures, AVAILABLE_PLUGINS)) + + if(ManagedConfiguration.IsPluginContributionLeftOver(x => x.App, x => x.EnabledPreviewFeatures, AVAILABLE_PLUGINS)) wasConfigurationChanged = true; // Check for the transcription provider: