Allow plugins to specify their settings in IViewer?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 24.7k
- Forks
- 1.3k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 1
Description
It looks like currently, the plugin developers must manually tell the users in a README which settings are available for the plugin, and users have to modify a config file.
I propose to add in IViewer an optional property to implement that gives information about all the available settings for the plugin.
Example:
In IViewer.cs:
/// <summary>
/// Get metadata about the settings available for this plugin.
/// This is used by the settings UI to display and manage plugin-specific settings.
/// </summary>
/// <returns>An array of setting metadata objects describing each available setting</returns>
PluginSettingMetadata[] GetSettings() => [];
public class PluginSettingMetadata
{
public string SettingId { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public Type SettingType { get; set; }
public object DefaultValue { get; set; }
public object[] PossibleValues { get; set; } // Optional: for settings that have a fixed set of possible values
}
However, there seems to be a problem that we can't specify optional implementations. The code editor will give an error:
Target runtime doesn't support default interface implementation.
I believe we would have to upgrade to .NET 5, or figure out a workaround.
If implemented, this would enable the creation of a user-friendly settings interface. It could display the installed plugins, allowing you to click on one to easily view and modify all its available settings.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing IViewer.cs and the target runtime constraints around optional interface implementations. Trace how the settings UI currently obtains plugin settings, then determine an agreed metadata API and compatibility approach. Done means plugin-specific settings can be described and displayed without requiring unsupported default interface implementations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100