Closed AlexanderMelde closed 1 year ago
Unfortunately, I cannot reproduce this issue. I am always testing this with RPG-Awesome, and everything works fine for me. Icons are recognized even with a -
inside their name.
I am using the version of "fontawesome-solid" that can be downloaded via the option page.
Just so that i understand you correctly, the intended behaviour is to have
-
in the data.json
file and-
, as seen in my screenshot?Or does your example imply that with RPG-Awesome, filenames contain the -
?
This sounds like a variation of the issue I submitted, except in my case the icon pack itself goes missing from the plugin list on relaunching obsidian, though is still recognized as existing when I try to readd it and have to remove and manually add it through the plugin. I only get a "you have to create an icon pack" message when trying to select icons, and none are shown. And yet the vault items that have icons set prior to relaunch still display.
There's no hyphens or uppercase characters in the folder/filenames, but disappearing on relaunch might be related.
Do the missing icons on your issue still display after relaunch, if you set them prior?
Yes, I was testing the same functionality with the downloaded solid fontawesome pack.
When I download the fontawesome solid pack, I don't have any -
in the icon names (same for the data.json, when I set an icon).
So basically, no matter what the name of the icon is, it should directly match in the dom.
This sounds like a variation of the issue I submitted, except in my case the icon pack itself goes missing from the plugin list on relaunching obsidian, though is still recognized as existing when I try to readd it and have to remove and manually add it through the plugin. I only get a "you have to create an icon pack" message when trying to select icons, and none are shown. And yet the vault items that have icons set prior to relaunch still display.
There's no hyphens or uppercase characters in the folder/filenames, but disappearing on relaunch might be related.
Do the missing icons on your issue still display after relaunch, if you set them prior?
I think, it would be really good if you can create a minimal reproduction version of your vault (discard all the personal files, plugins etc.), so that I can reproduce it.
When I download the fontawesome solid pack, I don't have any - in [...] the data.json, when I set an icon
Wow, I did not expect that. On my two different vaults on different systems, every fontawesome icon is saved to data.json
with the -
in the name.
it would be really good if you can create a minimal reproduction version of your vault
Done! I just created an empty vault, put some notes in it, downloaded your plugin, downloaded fontawesome-solid, set icons to folders and notes, closed obsidian, opened obisidian - error is here 😄
Before re-opening Obsidian:
After:
data.json:
{
"settings": {
"migrated": true,
"iconPacksPath": ".obsidian/plugins/obsidian-icon-folder/icons",
"fontSize": 16,
"emojiStyle": "none",
"iconColor": null,
"recentlyUsedIcons": [
"FasBriefcase-medical",
"FasArrows-up-down-left-right",
"FasBattery-three-quarters"
],
"recentlyUsedIconsSize": 5,
"rules": [],
"extraMargin": {
"top": 0,
"right": 4,
"bottom": 0,
"left": 0
}
},
"Note in Folder.md": "FasBattery-three-quarters",
"Example Folder/Note in Root.md": "FasArrows-up-down-left-right",
"Example Folder": "FasBriefcase-medical"
}
After this observation, i deleted all non-relevant icons (there were over 1100 downloaded) to reduce vault size and put the whole vault into the attached .zip file icontest.zip.
Ok beautiful, now I can reproduce this as well, thanks for the reproduction. I've tested this on my Dev Fault and could reproduce it as well. I'll try to provide a fix today.
It also seems like that the bug only appears the first time when you download something like Fas and then immediately change the icon. If you download Fas and then restart obsidian, it will work :D
Ok, thanks for reporting. I've now fixed the issue. You can check out the main branch with the current code to check, if everything works. However, I've changed a lot of things in the codebase compared to the last update. So be aware that there could be some other potential bugs.
This should be fixed in 2.0.0.
Describe the bug Icons are sometimes not shown in the UI
To Reproduce Steps to reproduce the behavior:
Expected behavior All icons should be shown, even after restart.
Possible cause of error Only icons that have a hyphen or underscore are not shown, so it is likely to be caused by the icon name normalization.
Suggested Fix Inside data.json replace underscores and hyphens with empty string followed by capitalized next letter, e.g. from
to
(folder and file names censored for privacy reasons)
Additional context Operating System: Windows 11 Obsidian V: 1.1.16 Icon Folder V: 1.7.0
Screenshots