Persona settings for auto-lock & multi connection

- Add setting to auto-lock persona to chat. Triggered on chat changed (creation/loaded) and on persona selection.
- Add setting to allow multiple persona<->char connections, which then triggers the popup to select one
- If no multi connections allowed, the connect toggle will remove all existing connections from personas to that character
This commit is contained in:
Wolfsblvt
2025-01-15 02:20:48 +01:00
parent 08a4cee48f
commit 776dedea82
3 changed files with 75 additions and 10 deletions

View File

@ -1477,6 +1477,8 @@ async function loadPowerUserSettings(settings, data) {
$('#custom_stopping_strings_macro').prop('checked', power_user.custom_stopping_strings_macro);
$('#fuzzy_search_checkbox').prop('checked', power_user.fuzzy_search);
$('#persona_show_notifications').prop('checked', power_user.persona_show_notifications);
$('#persona_allow_multi_connections').prop('checked', power_user.persona_allow_multi_connections);
$('#persona_auto_lock').prop('checked', power_user.persona_auto_lock);
$('#encode_tags').prop('checked', power_user.encode_tags);
$('#example_messages_behavior').val(getExampleMessagesBehavior());
$(`#example_messages_behavior option[value="${getExampleMessagesBehavior()}"]`).prop('selected', true);
@ -3652,6 +3654,16 @@ $(document).ready(() => {
saveSettingsDebounced();
});
$('#persona_allow_multi_connections').on('input', function () {
power_user.persona_allow_multi_connections = !!$(this).prop('checked');
saveSettingsDebounced();
});
$('#persona_auto_lock').on('input', function () {
power_user.persona_auto_lock = !!$(this).prop('checked');
saveSettingsDebounced();
});
$('#encode_tags').on('input', async function () {
power_user.encode_tags = !!$(this).prop('checked');
await reloadCurrentChat();