SillyTavern icon indicating copy to clipboard operation
SillyTavern copied to clipboard

[FEATURE_REQUEST] Tags for Persona Management

Open Avroboros opened this issue 1 year ago • 7 comments

Have you searched for similar requests?

No

Is your feature request related to a problem? If so, please describe.

No response

Describe the solution you'd like

Similar to Character Management, it would be extremely cool and VERY useful and convenient to be able to create and assign tags for personas (in order to properly organize them, rather than having them scattered).

For example, I always use my real name when it comes to my RPs and discussions, however, the only thing that I use to somewhat organize the dozens of personas I made (for each specific use) are their profile pictures. Hence, the implementation of tags to organize them would be extremely helpful.

Describe alternatives you've considered

No response

Additional context

No response

Priority

Medium (Would be very useful)

Are you willing to test this on staging/unstable branch if this is implemented?

Yes

Avroboros avatar Aug 30 '24 08:08 Avroboros

I am pretty sure you are not the first to ask about this. Can't find another issue about this right now though, so might've been on Discord. I'll keep this as reference.

This is a nice-to-have feature. I agree it makes sense. But considering most people likely don't use personas that much and that much in depth, it might not be profitable for a lot.

If someone is willing to do it, nice. I'll put it in my backlog and maybe come back to it some day, but can't promise anything.

Wolfsblvt avatar Aug 30 '24 14:08 Wolfsblvt

I could probably do it if you could point me in the right direction (such as what files deal with Persona Management, what files deal with the Tag system for Character Management.. etc). This is a change I'm really looking forward to see, so I definetly wouldn't mind implementing it myself if that's what it takes.

Avroboros avatar Aug 31 '24 05:08 Avroboros

Most code for tags is inside tags.js, while we have filters.js to do the actual filtering and sorting.

The biggest reason why I haven't done this yet is, that it's likely not as easy and there's some refactoring work to be done. While the filter stuff is already extracted into a class, I think many functionality is currently being tied to the actual filter button UI elements, and I am not sure if they rely on ids. It'll likely make sense to not duplicate the whole filter panel with the buttons and all the logic behind, but refactor it this way so the filtering can be placed wherever you want, just with a different FilterHelper instance behind.

For saving the tags, there is a tag_map where tags are currently connected with characters. That either needs to be extended to discern between chars and personas, or the tags could be actually saved inside the persona data, which is also part of the settings.json.

If you have questions or want to brainstorm, feel free to reach out.

Wolfsblvt avatar Aug 31 '24 14:08 Wolfsblvt

Understandable. I suggest starting with detaching any tag and filtering functionality that might be attached to Character Management, then modify it (refactor like you said) with the intent of applying it easily in any UI (2 in this case, Character and Persona Management). The code behind tags and filters is already perfect, all that needs to be done is copy it, and inside it make an instance that checks where is the tag being applied to (rather than making 2 separate files and making it more complicated than it needs to be).

I kinda suck with words and explanations, so here's a little chart I made to make sure my suggestion is understood:

image


UI and Design:

But before starting with anything, we must first come up with proof-of-concepts, designs and schematics.

This is the simplistic design I came up with on paint:

image

First, I pushed the personas a little further down to create a decent space that I highlighted in a red rectangle (which will contain all the tags, like Character Management).

The green circle I made shows how the buttons would be like. Instead of the "create" button taking all the space like this:

image

It should be a small button containing its icon (and no text), and right next to it, another button that will serve as the one to create/manage tags with (just like... you guessed it, like the one in Character Management).

As for the other grid view, it should look something like this:

image

All the tags of the specific persona right below its description, and all the tags ever created for personas on top like usual.

To end this ramble, here's a proof-of-concept design I made of how it could look like if successfully implemented:

image

Avroboros avatar Sep 01 '24 02:09 Avroboros

Generally in line with what I've thought.

I don't think there is much that needs to be planned about layout design. Maybe where exactly to place it. Your suggestion are already good. But generally, the whole tag filter panel and then the tag detail list for a specific selected persona should just look and work exactly like those in character management.

Just make this image exactly look like this image

And on the right side for a selected persona, you can just copy the same design (and use the same functions that already exist) to make it look like this image

It starts to get interesting when you want to implement the same folder tag management though. That would be the logical consequence, but that's a lot of work.

Wolfsblvt avatar Sep 01 '24 04:09 Wolfsblvt

Fantastic, great minds think alike (and I agree, in order to avoid any confusion I'll copy the same design and buttons that already exist from Character Management).

Speaking of which, I'll start with implementing them first because they're the easiest part of this whole thing. My coding is pretty decent but since I've never "reverse engineered" SillyTavern before, It'll take me some time to "dissect" it in order to fully understand it.

I'll keep updating my progress over the next few days so that this thread doesn't get locked.

Avroboros avatar Sep 04 '24 06:09 Avroboros

Takes 6 months until issues get locked, no worries. You are also totally free to open a draft PR already and track your progress there.

And if want to have a more direct line to questions about ST source code, functionality, how to do what, blah blah. We devs hang out on Discord a lot and answer questions there. There is a dedicated code-contribution channel. No requirement though, GitHub alone is fine too.

Wolfsblvt avatar Sep 04 '24 17:09 Wolfsblvt