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

[BUG] Tags with Spaces in Searchbar #112

Open
TechCrafterGaming opened this issue May 1, 2024 · 4 comments
Open

[BUG] Tags with Spaces in Searchbar #112

TechCrafterGaming opened this issue May 1, 2024 · 4 comments
Labels
bug Something isn't working critical issue A bug or issue that requires immediate attention enhancement New feature or request

Comments

@TechCrafterGaming
Copy link
Contributor

If you have a tag that contains spaces and you search for files that contain this tag, it will only work if you remove the spaces in the search bar.

I would say there are 2 simple solutions

On the one hand, you could always remove all spaces from the search line automatically, but I don't know if that could have other problems.

On the other hand, you could take a closer look at the search function and make sure that it can handle such tags.

I would be willing to solve this directly once it has been clarified how we want to approach this.

@Loran425
Copy link
Collaborator

Loran425 commented May 1, 2024

Hmmm this is an interesting question but it will need an opinionated answer, my expectation of how the search would behave if I knew nothing about Tagstudio is that spaces were treated as commas so a search for Brown Hat would be interpreted as "Show me all the files I have that are tagged with Brown AND Hat which would either break or require a great deal of clever code to parse if spaces were removed. my other thought of just replacing spaces with underscores in tag names in the database and search also wouldn't work to resolve this.

I think making people type commas to separate tags is less clean that what we are looking for.

I think a rough way to resolve this and might be only searching for the first word in a tag with spaces so searching for Brown Hat would match on the search Brown.

@CyanVoxel any thoughts on the intended behavior of tags with spaces or spaces in the search query, not necessarily how its implemented but how it should behave? I have some solutions that come to mind for down the road but there's a fair few things between now and those ideas.

@Loran425 Loran425 added the enhancement New feature or request label May 1, 2024
@TechCrafterGaming
Copy link
Contributor Author

I've just had another idea...
What if you had a kind of autocomplete where tags could be suggested in a list and when a tag was recognized in the search bar it could be displayed as a tag instead of text.
And then you could do the same with concatenations. So that or, and etc are also converted from text.

I think it's hard to imagine exactly what I mean...
I will try to illustrate this graphically later, I hope that will help

@Loran425
Copy link
Collaborator

Loran425 commented May 2, 2024

Haha this was exactly what I was thinking, but since the database swap is still being sorted implementing it right now would just mean re-implementing it with the new system as soon as that goes live.

But if you want to take a swing at it with the current system have at it.

@Qronikarz
Copy link

my expectation of how the search would behave if I knew nothing about Tagstudio is that spaces were treated as commas so a search for Brown Hat would be interpreted as "Show me all the files I have that are tagged with Brown AND Hat

Exactly how Booru programs work. Replacing the space with underscore so "blue sky" becomes "blue_sky". That also means that the whitespace becomes a forbidden character to use in tag names. Of course, it's up to CyanVoxel how to solve this, but it needs to be decided.

What if you had a kind of autocomplete where tags could be suggested in a list and when a tag was recognized in the search bar it could be displayed as a tag instead of text.

Kind of reminds me of how the Spacedrive allows you to search with tags, but I only tested it with few tags so don't know how well it will work when the number of tags grows to 100+ or 500+

@CyanVoxel CyanVoxel added bug Something isn't working critical issue A bug or issue that requires immediate attention labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical issue A bug or issue that requires immediate attention enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants