()
| 2911 | } |
| 2912 | |
| 2913 | async function tryLoadIconsFromDirectoryListing() { |
| 2914 | // Try known size folders; if they don't exist or listing is disabled, we'll fall back. |
| 2915 | const dirs = ["icons/16x16/", "icons/32x32/"]; |
| 2916 | const all = []; |
| 2917 | for (const dir of dirs) { |
| 2918 | const sizeTag = dir.includes("16x16") ? "16x16" : (dir.includes("32x32") ? "32x32" : null); |
| 2919 | const files = await fetchDirListingPngFiles(dir); |
| 2920 | files.forEach((file) => { |
| 2921 | const rel = `${sizeTag}/${file}`; |
| 2922 | const name = normalizeIconNameFromFile(rel); |
| 2923 | all.push({ |
| 2924 | file: rel, |
| 2925 | name, |
| 2926 | tags: [...inferTagsFromName(name), ...(sizeTag ? [sizeTag] : [])], |
| 2927 | url: buildIconUrl(rel) |
| 2928 | }); |
| 2929 | }); |
| 2930 | } |
| 2931 | // Sort for stable UI |
| 2932 | all.sort((a, b) => (a.file || "").localeCompare(b.file || "")); |
| 2933 | return all; |
| 2934 | } |
| 2935 | |
| 2936 | function signatureForIcons(list) { |
| 2937 | return (list || []).map((i) => i.file).join("|"); |
no test coverage detected