Remove double flags for bookmarks

- Remove the double flag if a checkpoint exists
- Add the "replace checkpoint" functionality as a Shift+Click option to the checkpoint flag
This commit is contained in:
Wolfsblvt 2024-09-07 23:55:34 +02:00
parent d5b9231157
commit f5d164302b
3 changed files with 13 additions and 2 deletions

View File

@ -5777,7 +5777,7 @@
<div title="Create branch" class="mes_button mes_create_branch fa-regular fa-code-branch" data-i18n="[title]Create Branch"></div> <div title="Create branch" class="mes_button mes_create_branch fa-regular fa-code-branch" data-i18n="[title]Create Branch"></div>
<div title="Copy" class="mes_button mes_copy fa-solid fa-copy " data-i18n="[title]Copy"></div> <div title="Copy" class="mes_button mes_copy fa-solid fa-copy " data-i18n="[title]Copy"></div>
</div> </div>
<div title="Open checkpoint chat" class="mes_button mes_bookmark fa-solid fa-flag" data-i18n="[title]Open checkpoint chat"></div> <div title="Open checkpoint chat&#13;&#13;Shift+Click to replace the existing checkpoint with a new one" class="mes_button mes_bookmark fa-solid fa-flag" data-i18n="[title]Open checkpoint chat&#13;&#13;Shift+Click to replace the existing checkpoint with a new one"></div>
<div title="Edit" class="mes_button mes_edit fa-solid fa-pencil " data-i18n="[title]Edit"></div> <div title="Edit" class="mes_button mes_edit fa-solid fa-pencil " data-i18n="[title]Edit"></div>
</div> </div>
<div class="mes_edit_buttons"> <div class="mes_edit_buttons">

View File

@ -10563,7 +10563,14 @@ jQuery(async function () {
await duplicateCharacter(); await duplicateCharacter();
}); });
$(document).on('click', '.select_chat_block, .bookmark_link, .mes_bookmark', async function () { $(document).on('click', '.select_chat_block, .bookmark_link, .mes_bookmark', async function (e) {
// If shift is held down, we are not following the bookmark, but creating a new one
if (e.shiftKey) {
var selectedMesId = $(this).closest('.mes').attr('mesid');
createNewBookmark(selectedMesId);
return;
}
let file_name = $(this).hasClass('mes_bookmark') let file_name = $(this).hasClass('mes_bookmark')
? $(this).closest('.mes').attr('bookmark_link') ? $(this).closest('.mes').attr('bookmark_link')
: $(this).attr('file_name').replace('.jsonl', ''); : $(this).attr('file_name').replace('.jsonl', '');

View File

@ -3963,6 +3963,10 @@ input[type="range"]::-webkit-slider-thumb {
display: inline-block; display: inline-block;
} }
.mes:not([bookmark_link='']) .mes_create_bookmark {
display: none;
}
.mes_edit_buttons { .mes_edit_buttons {
display: none; display: none;
flex-direction: row; flex-direction: row;