lmg-anon / mikupad

LLM Frontend in a single html file
https://lmg-anon.github.io/mikupad/mikupad.html
Creative Commons Zero v1.0 Universal
175 stars 24 forks source link

Feature/Search and Replace #77

Closed neCo2 closed 2 weeks ago

neCo2 commented 1 month ago

Adding a search and replace function. Currently accessible via a button below the editor preferences button. The UI for search and replace uses a draggable component. The "active" surface for that is the darkened area with the title. firefox_2024-06-07_21-15-25

Right now, it can do plaintext and regex replacements. I want to add template replacements too, but maybe I should wait for your chat completions PR for that one.

neCo2 commented 1 month ago

And that should be it except for the template substitution, which I'll add at a later point in time. firefox_2024-06-08_13-27-15 Currently the replace button just replaces everything (unless you're using a non-global regex for some reason), so maybe a "replace only current match" button could be added at some point. I'll also try to figure out how to add this to the undo stack, but feel free to do that yourself if you know a simple way.

lmg-anon commented 1 month ago

I'll also try to figure out how to add this to the undo stack, but feel free to do that yourself if you know a simple way.

Theoretically, you shouldn't have to do anything, it will be handled as if the user replaced the text manually.

neCo2 commented 1 month ago

Resolved the merge conflict and changed the svgs to components.

Theoretically, you shouldn't have to do anything, it will be handled as if the user replaced the text manually.

Either I'm stupid, or it doesn't.

lmg-anon commented 4 weeks ago

Either I'm stupid, or it doesn't.

Sorry, I mean after https://github.com/lmg-anon/mikupad/pull/66 is merged. The current undo stack only supports changes made at the end of the prompt.

lmg-anon commented 4 weeks ago

I got around to reviewing this PR, and the code looks good to me. However, I have some suggestions for the UI:

image

Also, I see what you did with the placeholders, quite controversial lol. It's fine though, I won't pick on your creative choices.

neCo2 commented 4 weeks ago

Put in the requested adjustments. As for the placeholders, I just thought it was funny. But on second thought, some people might feel strongly enough about this to bother me, so I'll come up with something else.

neCo2 commented 4 weeks ago

My vocaloid knowledge is severely lacking, but this should do.

lmg-anon commented 2 weeks ago

Okay, this looks good to merge, I think there are still a few things that could be improved, but I guess they could be done in other commits/PRs as needed. Thank you for the contribution! :)

neCo2 commented 2 weeks ago

@lmg-anon

I think there are still a few things that could be improved

Feel free to let me know what the issues are exactly.

lmg-anon commented 1 week ago

@neCo2 The only thing I would call an "issue" is how the widget resizes with the window size, becoming too big on an ultra-wide screen: image

I guess this was my fault for suggesting vw for the widget size, probably em was the right call.

The other improvements I was considering include:

In other words, features that are in the find/replace of softwares like VSCode: image