Search sprites and sprites folder to not cooperate properly.
Description
With the "search sprite" feature, I cannot search for sprites that are contained inside an unopened folder. Opened folders work as expected.
Steps to reproduce
1.Install the extension. 2.Enable both "Sprite folders" by GarboMuffin and "Search box in sprite pane" by BarelySmooth and GarboMuffin. 3.In a project, add some sprites into a folder and close the folder. 4.Search for the contained sprites. Those sprites in the closed folder do not show up in the results.
Demonstration(s) and additional context
Unable to provide screenshots for now.
Environment
Google Chrome | 120.0.6099.200 (Official Build) (64-bit) (cohort: Stable Installs & Version Pins) -- | -- Revision | 4c400b5eade71f580ad9e320a2c4634dc5a0a0f9-refs/branch-heads/6099@{#1669} OS | Windows 10 Version 22H2 (Build 19045.3803) JavaScript | V8 12.0.267.14
It is working as it is supposed to be, to search in a folder you're supposed to open it. Think about how folders and files work on your computer.
It is working as it is supposed to be, to search in a folder you're supposed to open it. Think about how folders and files work on your computer.
At least on Windows, searching in a folder includes all subfolders. I think users will expect a similar behavior here.
It is working as it is supposed to be, to search in a folder you're supposed to open it. Think about how folders and files work on your computer.
At least on Windows, searching in a folder includes all subfolders. I think users will expect a similar behavior here.
Yes, indeed we can search for subfolders in a folder... And we can search folders here?
The issue here seems to be that folders are treated just like sprites. When the folder is closed, the sprites in that folder are not considered to exist.
Folder closed:
Folder opened:
Here, the two sprites in the folder were renamed to "In 1" and "In 2", so the query doesn't match.
The issue here seems to be that folders are treated just like sprites. When the folder is closed, the sprites in that folder are not considered to exist.
Folder closed:
Folder opened:
Here, the two sprites in the folder were renamed to "In 1" and "In 2", so the query doesn't match.
It's supposed to act like that tbh. if the folder is closed, it's not supposed to display sprites inside that....
It's supposed to act like that tbh. if the folder is closed, it's not supposed to display sprites inside that....
But then you have to, before your search, open all the folders you want to search in.
I think it should always show folders if their name or a name of a sprite inside of them matches the search query, regardless of if they're opened or closed.
My expectation here is that the add-on is supposed to know the existence of the sprites inside the closed folders. I am aware that the issue is caused by the folders being treated as sprites. The reason why we should be able to search for sprites inside closed folders is because that way, we can instantly locate the sprites without having to plow through the folders we have created.
The issue here seems to be that folders are treated just like sprites. When the folder is closed, the sprites in that folder are not considered to exist.
Folder closed:
Folder opened:
Here, the two sprites in the folder were renamed to "In 1" and "In 2", so the query doesn't match.
It's supposed to act like that tbh. if the folder is closed, it's not supposed to display sprites inside that....
If we weren't able to search for contents of closed folders, we would have to open EVERY folders in able to search for all sprites, by the time we would have already located where the sprite was. By the way, the addon could do well with an option to open or close every folders.
What about the following fix: When the user searches for a sprite by name...
- Remember which folders are opened and which ones are closed
- Open all folders
- Search for the sprite When the search is cleared, close the folders that were closed before the search.
@iqnite Sounds reasonable.
That's the way to go 😀
Is there a way to share info between addons?
@iqnite In this case, I think ideally the folders addon should expose 2 functions: one that opens all folders, and a getter/setter for the state of which folders are open. Consider that theoretically, folders can be renamed or deleted while a search is taking place, so it needs a bit of validation.
Is there a way to share info between addons?
For prototyping, it's okay to attach things to the global window object or using any other way to expose data/methods. Before actually merging it, we'd try to use standard JS modules instead.
Last time I checked, folders does expose a few methods as a module. Maybe something's there that would be useful for this.
Folder closed:
Folder opened: 
