Expand checkpoint tooltip to contain name

This commit is contained in:
Wolfsblvt 2024-09-08 00:20:56 +02:00
parent 3217087b0b
commit 6c94297724
3 changed files with 6 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="Copy" class="mes_button mes_copy fa-solid fa-copy " data-i18n="[title]Copy"></div>
</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 data-tooltip="Click to open checkpoint chat&#13;Shift+Click to replace the existing checkpoint with a new one" class="mes_button mes_bookmark fa-solid fa-flag" data-i18n="[data-tooltip]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>
<div class="mes_edit_buttons">

View File

@ -2102,6 +2102,7 @@ function getMessageFromTemplate({
tokenCount && mes.find('.tokenCounterDisplay').text(`${tokenCount}t`);
title && mes.attr('title', title);
timerValue && mes.find('.mes_timer').attr('title', timerTitle).text(timerValue);
bookmarkLink && mes.find('.mes_bookmark').attr('title', `Checkpoint\n${bookmarkLink}\n\n${mes.find('.mes_bookmark').data('tooltip')}`);
if (power_user.timestamp_model_icon && extra?.api) {
insertSVGIcon(mes, extra);

View File

@ -210,7 +210,10 @@ async function createNewBookmark(mesId) {
}
lastMes.extra['bookmark_link'] = name;
$(`.mes[mesid="${mesId}"]`).attr('bookmark_link', name);
const mes = $(`.mes[mesid="${mesId}"]`);
mes.attr('bookmark_link', name);
mes.find('.mes_bookmark').attr('title', `Checkpoint${name}\n\n${(mes.find('.mes_bookmark')).data('tooltip')}`);
await saveChatConditional();
toastr.success('Click the flag icon next to the message to open the checkpoint chat.', 'Checkpoint created', { timeOut: 10000 });