[GH-ISSUE #190] Multi Level completion / coloring for wildcards #135

Closed
opened 2026-10-30 21:19:52 +00:00 by bsakaguchi · 6 comments
Owner

Originally created by @DominikDoom on GitHub (Jun 20, 2023).
Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/190

Originally assigned to: @DominikDoom on GitHub.

As suggested by @PaperOrb.

Wildcards that are organized in nested folders will currently complete the whole path both if a suggestion is chosen with enter or on pressing tab.
It would be better if tab would only complete up to the next folder level, so the user can choose again from a more limited selection without having to type the path until that point manually or having to delete the added path partially.

For the same reasoning, some color differentiation between folder levels would also be nice.

Originally created by @DominikDoom on GitHub (Jun 20, 2023). Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/190 Originally assigned to: @DominikDoom on GitHub. As suggested by @PaperOrb. Wildcards that are organized in nested folders will currently complete the whole path both if a suggestion is chosen with enter or on pressing tab. It would be better if tab would only complete up to the next folder level, so the user can choose again from a more limited selection without having to type the path until that point manually or having to delete the added path partially. For the same reasoning, some color differentiation between folder levels would also be nice.
bsakaguchi 2026-10-30 21:19:52 +00:00
Author
Owner

@DominikDoom commented on GitHub (Jun 20, 2023):

@PaperOrb I hope this is what you imagined:

https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/assets/34448969/a5c1c86e-6592-413c-9bc2-915d46cead76

For any path that contains a slash, it will complete up to the next one when pressing Tab, allowing you to then select the next set of subfolders or the final wildcard file.

If you want to skip it in case you already have your wanted file selected, you can use Enter instead which will always insert the full thing.

<!-- gh-comment-id:1598314084 --> @DominikDoom commented on GitHub (Jun 20, 2023): @PaperOrb I hope this is what you imagined: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/assets/34448969/a5c1c86e-6592-413c-9bc2-915d46cead76 For any path that contains a slash, it will complete up to the next one when pressing <kbd>Tab</kbd>, allowing you to then select the next set of subfolders or the final wildcard file. If you want to skip it in case you already have your wanted file selected, you can use <kbd>Enter</kbd> instead which will always insert the full thing.
Author
Owner

@Xyem commented on GitHub (Jun 20, 2023):

I don't get the point of this. The progressive autocomplete I suggested can also do this but doesn't just randomly stop and require unnecessary user input.

hair/colour/light/blonde
hair/colour/light/brunette

Your suggestion would require 3 tabs and a choice (h<TAB>c<TAB>l<TAB><CHOOSE>), progressive autocomplete would require 2 tabs (h<TAB>l<TAB> to select the blonde wildcards).

<!-- gh-comment-id:1598577029 --> @Xyem commented on GitHub (Jun 20, 2023): I don't get the point of this. The progressive autocomplete I suggested can also do this but doesn't just randomly stop and require unnecessary user input. ``` hair/colour/light/blonde hair/colour/light/brunette ``` Your suggestion would require 3 tabs and a choice (`h<TAB>c<TAB>l<TAB><CHOOSE>`), progressive autocomplete would require 2 tabs (`h<TAB>l<TAB>` to select the blonde wildcards).
Author
Owner

@DominikDoom commented on GitHub (Jun 20, 2023):

@Xyem Well, at least for wildcards I could do it like this as well since the result set is limited and the cross-comparison to find the first difference doesn't get out of hand:

https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/assets/34448969/6668111c-b857-4572-9548-6dd98838a39e

If that is more to your liking. I pressed __su TAB b TAB a TAB in that example.
It is a different method to get to the same goal. This behaves more like completion in most command line terminals, where it stops at the first difference until you provide further input or choose directly.

The first method instead is more like navigating in the file explorer or cd-ing in the terminal level by level. I don't think it is that wasteful of user input either, since I imagine most wildcards will not be many unused layers deep, but only branch off into different folders where a categorical difference happens.
So skipping long parts with the same start should be a relatively rare occurrence.

I think both have their benefits, maybe a setting to choose which variant it uses would be best?

<!-- gh-comment-id:1599074172 --> @DominikDoom commented on GitHub (Jun 20, 2023): @Xyem Well, at least for wildcards I could do it like this as well since the result set is limited and the cross-comparison to find the first difference doesn't get out of hand: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/assets/34448969/6668111c-b857-4572-9548-6dd98838a39e If that is more to your liking. I pressed `__su` <kbd>TAB</kbd> `b` <kbd>TAB</kbd> `a` <kbd>TAB</kbd> in that example. It is a different method to get to the same goal. This behaves more like completion in most command line terminals, where it stops at the first difference until you provide further input or choose directly. The first method instead is more like navigating in the file explorer or cd-ing in the terminal level by level. I don't think it is that wasteful of user input either, since I imagine most wildcards will not be many unused layers deep, but only branch off into different folders where a categorical difference happens. So skipping long parts with the same start should be a relatively rare occurrence. I think both have their benefits, maybe a setting to choose which variant it uses would be best?
Author
Owner

@DominikDoom commented on GitHub (Jun 20, 2023):

I have added both methods and an option to choose between them now (default is the folder level way since it is less computationally demanding), hopefully this way everyone should be happy.
It will stay only for wildcards though for now, for normal tags it is too computationally expensive to go through all the results and find the first difference, since the result lists can get much longer than the usual wildcard collections. And like I said before, with the current tag completion regex, I feel false positives are rare enough that it isn't needed there.

<!-- gh-comment-id:1599120163 --> @DominikDoom commented on GitHub (Jun 20, 2023): I have added both methods and an option to choose between them now (default is the folder level way since it is less computationally demanding), hopefully this way everyone should be happy. It will stay only for wildcards though for now, for normal tags it is too computationally expensive to go through all the results and find the first difference, since the result lists can get much longer than the usual wildcard collections. And like I said before, with the current tag completion regex, I feel false positives are rare enough that it isn't needed there.
Author
Owner

@PaperOrb commented on GitHub (Jun 20, 2023):

Edit: just realized I hadn't refreshed this page to see new comments. @DominikDoom yep that's exactly what I envisioned! I think adding an option to select the variant was the right call.

Awesome to see this got its own issue. I look forward to it because I have wildcard folders that are 4 levels deep, so I basically have to type the whole thing out.

If this feature can't be implemented, a less desirable alternative could be enabling the pre-existing * functionality to work for wildcards so that __*ead would find things like /characters/monsters/undead.

edit: nm, I forgot that __ead would already work to find /characters/monsters/undead.

<!-- gh-comment-id:1599473429 --> @PaperOrb commented on GitHub (Jun 20, 2023): Edit: just realized I hadn't refreshed this page to see new comments. @DominikDoom yep that's exactly what I envisioned! I think adding an option to select the variant was the right call. Awesome to see this got its own issue. I look forward to it because I have wildcard folders that are 4 levels deep, so I basically have to type the whole thing out. If this feature can't be implemented, a less desirable alternative could be enabling the pre-existing * functionality to work for wildcards so that `__*ead` would find things like `/characters/monsters/undead`. edit: nm, I forgot that `__ead` would already work to find `/characters/monsters/undead`.
Author
Owner

@DominikDoom commented on GitHub (Jun 20, 2023):

@PaperOrb Just in case your didn't see it, the update is already pushed and contains both methods shown above, so you can use it right now.

I tried it out a fair bit with the wildcards I had lying around, but feel free to tell me here or in a new issue if something doesn't work like expected with your setup.

I kept this issue open to wait for feedback, but if you're happy with it I think I can already close it.

<!-- gh-comment-id:1599640053 --> @DominikDoom commented on GitHub (Jun 20, 2023): @PaperOrb Just in case your didn't see it, the update is already pushed and contains both methods shown above, so you can use it right now. I tried it out a fair bit with the wildcards I had lying around, but feel free to tell me here or in a new issue if something doesn't work like expected with your setup. I kept this issue open to wait for feedback, but if you're happy with it I think I can already close it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DominikDoom/a1111-sd-webui-tagcomplete#135
No description provided.