Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search sprites and sprites folder to not cooperate properly. #7298

Open
WindsorYeh-School opened this issue Mar 25, 2024 · 15 comments
Open

Search sprites and sprites folder to not cooperate properly. #7298

WindsorYeh-School opened this issue Mar 25, 2024 · 15 comments
Labels
scope: addon compatiblity Compatiblity issue between two or more addons scope: addon Related to one or multiple addons type: enhancement New feature for the project

Comments

@WindsorYeh-School
Copy link

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
@WindsorYeh-School WindsorYeh-School added status: needs triage Needs triaging by putting relevant labels type: bug A bug in the addon loader, or in a specific addon labels Mar 25, 2024
@Samq64 Samq64 added scope: addon Related to one or multiple addons scope: addon compatiblity Compatiblity issue between two or more addons and removed status: needs triage Needs triaging by putting relevant labels labels Mar 25, 2024
@Waakul
Copy link
Contributor

Waakul commented Mar 25, 2024

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.

@Samq64 Samq64 added type: enhancement New feature for the project and removed type: bug A bug in the addon loader, or in a specific addon labels Mar 25, 2024
@mxmou
Copy link
Member

mxmou commented Mar 25, 2024

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.

@Waakul
Copy link
Contributor

Waakul commented Mar 25, 2024

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?

@mybearworld
Copy link
Contributor

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.

Sprites called "In folder 1" and "In folder 2" in a folder called "Folder", and two sprites "Not in fold..." not in that folder.
Folder closed:
Two sprites called "Not in fold..." while "in fo" is being searched for
Folder opened:
Sprites called "In folder 1" and "In folder 2" in a folder, and two sprites "Not in fold..." not in that folder, while "in fol" is being searched for. The folder is not visible.

Here, the two sprites in the folder were renamed to "In 1" and "In 2", so the query doesn't match.
Two sprites called "Not in fold..." while "fol" is being searched for. Additionally, there's an opened folder called "Folder" that doesn't have any contents.

@Waakul
Copy link
Contributor

Waakul commented Mar 25, 2024

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.

Sprites called "In folder 1" and "In folder 2" in a folder called "Folder", and two sprites "Not in fold..." not in that folder. Folder closed: Two sprites called "Not in fold..." while "in fo" is being searched for Folder opened: Sprites called "In folder 1" and "In folder 2" in a folder, and two sprites "Not in fold..." not in that folder, while "in fol" is being searched for. The folder is not visible.

Here, the two sprites in the folder were renamed to "In 1" and "In 2", so the query doesn't match. Two sprites called "Not in fold..." while "fol" is being searched for. Additionally, there's an opened folder called "Folder" that doesn't have any contents.

It's supposed to act like that tbh. if the folder is closed, it's not supposed to display sprites inside that....

@mybearworld
Copy link
Contributor

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.

@windsoryeh
Copy link

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.

@windsoryeh
Copy link

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.
Sprites called "In folder 1" and "In folder 2" in a folder called "Folder", and two sprites "Not in fold..." not in that folder. Folder closed: Two sprites called "Not in fold..." while "in fo" is being searched for Folder opened: Sprites called "In folder 1" and "In folder 2" in a folder, and two sprites "Not in fold..." not in that folder, while "in fol" is being searched for. The folder is not visible.
Here, the two sprites in the folder were renamed to "In 1" and "In 2", so the query doesn't match. Two sprites called "Not in fold..." while "fol" is being searched for. Additionally, there's an opened folder called "Folder" that doesn't have any contents.

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.

@iqnite
Copy link
Contributor

iqnite commented Mar 31, 2024

What about the following fix:
When the user searches for a sprite by name...

  1. Remember which folders are opened and which ones are closed
  2. Open all folders
  3. Search for the sprite
    When the search is cleared, close the folders that were closed before the search.

@WorldLanguages
Copy link
Member

@iqnite Sounds reasonable.

@windsoryeh
Copy link

That's the way to go 😀

@iqnite
Copy link
Contributor

iqnite commented Apr 4, 2024

Is there a way to share info between addons?

@WorldLanguages
Copy link
Member

@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.

@WorldLanguages
Copy link
Member

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.

@mybearworld
Copy link
Contributor

Last time I checked, folders does expose a few methods as a module. Maybe something's there that would be useful for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: addon compatiblity Compatiblity issue between two or more addons scope: addon Related to one or multiple addons type: enhancement New feature for the project
Projects
None yet
Development

No branches or pull requests

8 participants