Skip to content

Conversation

@jtreminio
Copy link
Contributor

@jtreminio jtreminio commented Feb 6, 2026

  • Adds a "Disable" or "Enable" button to installed extensions.
  • Adds a new hidden server setting persisting the choices.
  • Disabled extensions are not loaded by the C# project, so their metadata (description, author, etc) must be read separately

I can keep the button in its current slot, or move it somewhere else.

All enabled:

CleanShot 2026-02-05 at 18 41 05

Pending restart after disable:

CleanShot 2026-02-05 at 18 43 21

One disabled:

CleanShot 2026-02-05 at 18 43 31

@jtreminio jtreminio marked this pull request as ready for review February 6, 2026 00:52
@mcmonkey4eva
Copy link
Member

mcmonkey4eva commented Feb 6, 2026

I think you overcomplicated this -- you can already disable extensions by putting .disable on the end of the ext folder, I believe the main thing needed is just the UI button to automatically do that.

EDIT: on discord fair counter to this was given

@jtreminio jtreminio marked this pull request as draft February 6, 2026 23:34
@jtreminio jtreminio marked this pull request as ready for review February 9, 2026 16:06
}

/// <summary>Returns normalized "src/Extensions/{folderName}/" for a direct child folder match, or null if not found.</summary>
public static string GetNormalizedExtensionFolderPath(string folderName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does nothing

}

/// <summary>Builds <see cref="DisabledExtensions"/> and returns disabled extension folders.</summary>
public HashSet<string> BuildDisabledExtensionsAndGetDisabledFolders()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is slowly manually rebuilding a list that's already saved? And is redundant

{
return false;
}
int removed = Program.ServerSettings.Extensions.DisabledExtensions.RemoveAll(f => string.Equals(f, folderName, StringComparison.OrdinalIgnoreCase));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these string.equals ordinal things still do not need to exist as commented before

/// <summary>Removes an extension folder from the disabled list in settings.</summary>
public bool RemoveDisabledExtensionSetting(string folderName)
{
folderName = folderName?.Trim();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these cleanups and checks aren't needed

public HashSet<string> InstalledExtensionFolders = [];

/// <summary>Folder names of disabled extensions.</summary>
public HashSet<string> DisabledExtensions = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is a duplicate tracker of what's already in settings

<th>Actions</th>
</tr>
@foreach (ExtensionsManager.ExtensionInfo ext in Program.Extensions.KnownExtensions.Where(e => !Program.Extensions.LoadedExtensionFolders.Contains(e.FolderName) && !e.Tags.Contains("hidden")))
@foreach (ExtensionsManager.ExtensionInfo ext in Program.Extensions.KnownExtensions.Where(e => !Program.Extensions.InstalledExtensionFolders.Contains(e.FolderName) && !e.Tags.Contains("hidden")))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this back

public HashSet<string> LoadedExtensionFolders = [];

/// <summary>Hashset of folder names of all extensions currently installed (loaded or disabled).</summary>
public HashSet<string> InstalledExtensionFolders = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a redundant duplicate of already tracked data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants