-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
WI regex keys #2200
WI regex keys #2200
Conversation
- Switch key/secondarykey controls to select2 input - Custom tokenizer for regex parsing, allowing comma in regex - Keep mobile-compatibility by switching to textarea - select2 utility method to pre-fill options - New inline display mode of select2 multi to save space
- WI custom style for regex keys - moved select2 styling to its own file
- Cache all keys for the loaded lorebook - Key selection dropdown shows all keys and how often they are used already - More templating changes
Does select2 allow editing of the keys? Or only delete and re-add? |
Only delete and re-add. I could try and implement some kind of edit functionality, but is that worth it? |
That's gonna be pain, especially with regex keys. Edit: what I'm saying is: yes, definitely worth the effort. |
select2 is basically an extended dropdown selection box with search and all. So yeah, there is no built-in edit functionality. I see your point. And it shouldn't be too hard to implement. Left-click an entry opens it in edit-mode where you can edit the text of it again. |
I wouldn't call it a showstopper. ST isn't exactly known for great UX in the first place. |
- Allow click on WI keys to edit - Removes them from the key list, allowing direct text editing - Refactor select2 click subscribe some more, fixing a few issues
@Wolfsblvt P.S. I'm proposed about regexp keys long time ago, but if only I know that they will come with this... |
The "don't make nice UI" people appear. Not unexpected. The plain textbox still exists for mobile anyway. I can easily make this a toggle. |
@Wolfsblvt |
Typing for 10+ world entries is pretty easy, because the input hasn‘t changed at all. You can use Enter instead of comma, that‘s the only difference. Fixing mistakes until you have finished the key by typing Enter/Comma is easy too. Going back to a key with keyboard no. Editing past entries is okay too, but I can see how having to change keys regularly for whatever reason would be kind of annoying. This PR is on hold. The UI portion will be likely scrapped completely and just the Regex matching stays. We have another big thing planned for which I am really excited. |
- Implemented switch between fancy and plaintext input controls - Fixed splitting keys into regexes index issue - Fixed focus falsely adding text as key
Added an inline switcher of fancy/plaintext input modes. It'll reload the WI window and changes the input types back to the textarea, or the new select control. Saved in user settings. Also did a few more hotfixes I ran into. Even though I want to revamp the stuff like I said above, I think actually adding Regex key matching sooner than later makes sense. Would be sad to hold back the actual matching functionality if that one is completely done already. This PR also makes the existing select2 inputs in WI (world selector at the top, character filter) slimmer and a bit nicer. So yeah. |
@deffcolony seems like the repo bot is broken. There are no merge conflicts anymore but it didn't remove the tag. |
Want it to be more subtle yet still visible
Prevent height from jumping around when input is focused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now all we need is docs for it all.
I'll make docs this weekend, for all the new WI stuff. |
WI keys will now support regexes. (both keys and secondary keys)
Detailed list of all other changes: