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

feature/add-searching-functionality #546

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

bee1850
Copy link

@bee1850 bee1850 commented Jul 6, 2023

Hey, I added a search functionality in the Wildcard Manager Tab and the TXT2IMG Tab.
Its probably not really efficient code at this moment but it works fairly well. It searches into subfolders aswell, if needed.

@bee1850
Copy link
Author

bee1850 commented Jul 6, 2023

I also have added the functionality, that the right editor moves along when scrolling through the list. If needed I can open another Pull Request for it, but its quite short, so i can also just post it here :)

@akx
Copy link
Collaborator

akx commented Jul 7, 2023

Thanks, this seems like a great feature! However... couldn't we do this purely in the frontend? I mean, the frontend already knows the entire wildcard hierarchy, so doing the tree filtering there seems more efficient (and would feel snappier to the user)? :)

@bee1850
Copy link
Author

bee1850 commented Jul 7, 2023

Thanks, this seems like a great feature! However... couldn't we do this purely in the frontend? I mean, the frontend already knows the entire wildcard hierarchy, so doing the tree filtering there seems more efficient (and would feel snappier to the user)? :)

Hey, yes I think Frontend only would be possible, I just did it in the backend to no not completely change the way things work in the extension, which was mostly backend based interaction. On the other hand: I have over 3000 wildcards in my folder and it isn't snappy at all for me. I have exams right now, so I wouldn't be able to do it in the next couple of days.

@akx
Copy link
Collaborator

akx commented Jul 7, 2023

@bee1850 Best of luck with your exams! 💪

@bee1850
Copy link
Author

bee1850 commented Jul 11, 2023

Coming back to this, I think there is two reasons that go against doing this manually:

  1. The txt2img tab currently does not have any custom js and I dont know how to embed it there
  2. I actually think it would generate more overhead to try to iterate through the html tree instead of iterating the actual tree object as we would have to get all elements that have the id tree-leaf and then iterate through their children to determine what child element were looking at. It feels easier and more efficient for me to iterate through the field.

As I said, I don't have any problems with speed or any lags when searching stuff. (I have over 2000-3000 individual wildcard files in my directory)

Another thing would be that the search is dependent on the html elements instead of the tree object. This would break things easier when adding stuff or modifying the extension itself. I tried to do as few modifications to the original code as possible so that in the case of a rework it would not be as much of a hassle to get the search working again.

@bee1850
Copy link
Author

bee1850 commented Jul 17, 2023

Any Thoughts on this? @akx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants