You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds an official plugin API for file and folder icon packs, plus a user setting to choose the active pack.
Plugins register packs with acode.require("fileIcons"). The loader binds that API to the loading plugin and supplies ownership automatically. Acode owns matching, loading, fallback, and rendering. Users pick the pack in Settings → App settings → Icon pack. Builtin stays the default and remains available while a plugin pack is loading.
This replaces the earlier draft/internal icon helpers with a stable public surface: register, icon, and onChange. Pack selection, catalog queries, and DOM refresh stay internal.
User-facing
New Icon pack setting under App settings (interface).
Builtin pack is always present.
A previously selected plugin pack is restored automatically when that plugin registers again after startup.
File and folder icons update in the explorer, recents, search results, and other file lists.
Plugin API
Capture acode.require("fileIcons") synchronously in the plugin main script, and keep that API for later async work. Do not call require("fileIcons") for the first time after an await. The same bound API is also available as options.fileIcons in setPluginInit. Omit pluginId; if supplied, it must match the loading plugin.
split() and join() in matchExtension() allocate multiple new arrays and strings on the heap for every single file evaluated. In large directories, this will trigger unnecessary Garbage Collection (GC) pauses and slow down the render cycle. Although, not that much but maybe worth noting? 🤔
We can achieve the exact same behavior with zero array allocations by using indexOf() and string slicing; if that keeps the current implementation intacted ofc.
split() and join() in matchExtension() allocate multiple new arrays and strings on the heap for every single file evaluated. In large directories, this will trigger unnecessary Garbage Collection (GC) pauses and slow down the render cycle. Although, not that much but maybe worth noting? 🤔
We can achieve the exact same behavior with zero array allocations by using indexOf() and string slicing; if that keeps the current implementation intacted ofc.
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
translationsAnything related to Translations Whether a Issue or PR
3 participants
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.
Summary
Adds an official plugin API for file and folder icon packs, plus a user setting to choose the active pack.
Plugins register packs with
acode.require("fileIcons"). The loader binds that API to the loading plugin and supplies ownership automatically. Acode owns matching, loading, fallback, and rendering. Users pick the pack in Settings → App settings → Icon pack. Builtin stays the default and remains available while a plugin pack is loading.This replaces the earlier draft/internal icon helpers with a stable public surface:
register,icon, andonChange. Pack selection, catalog queries, and DOM refresh stay internal.User-facing
Plugin API
Capture
acode.require("fileIcons")synchronously in the plugin main script, and keep that API for later async work. Do not callrequire("fileIcons")for the first time after anawait. The same bound API is also available asoptions.fileIconsinsetPluginInit. OmitpluginId; if supplied, it must match the loading plugin.register(pack)publishes or atomically replaces a pack. It does not select it.icon(resource)returns a CSS class string for a file or folder.onChange(listener)notifies when the active pack or assets change, for plugins that draw their own file lists.Example plugin: acode-icon-plugin-example