feat: add official fileIcons API and Icon pack setting - #2887
Open
bajrangCoder wants to merge 8 commits into
Open
feat: add official fileIcons API and Icon pack setting#2887bajrangCoder wants to merge 8 commits into
bajrangCoder wants to merge 8 commits into
Conversation
Contributor
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
bajrangCoder
requested review from
Elitex07,
RohitKushvaha01,
UnschooledGamer and
deadlyjack
September 12, 2026 16:36
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.
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