mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Thonk yeet
This commit is contained in:
@@ -6232,7 +6232,10 @@
|
|||||||
<details class="mes_reasoning_details">
|
<details class="mes_reasoning_details">
|
||||||
<summary class="mes_reasoning_summary">
|
<summary class="mes_reasoning_summary">
|
||||||
<span data-i18n="Reasoning">Reasoning</span>
|
<span data-i18n="Reasoning">Reasoning</span>
|
||||||
<div class="mes_reasoning_copy mes_button fa-solid fa-copy" title="Copy reasoning" data-i18n="[title]Copy reasoning"></div>
|
<div class="mes_reasoning_actions">
|
||||||
|
<div class="mes_reasoning_copy mes_button fa-solid fa-copy" title="Copy reasoning" data-i18n="[title]Copy reasoning"></div>
|
||||||
|
<div class="mes_reasoning_delete mes_button fa-solid fa-trash-can" title="Remove reasoning" data-i18n="[title]Remove reasoning"></div>
|
||||||
|
</div>
|
||||||
</summary>
|
</summary>
|
||||||
<div class="mes_reasoning"></div>
|
<div class="mes_reasoning"></div>
|
||||||
</details>
|
</details>
|
||||||
|
@@ -23,6 +23,7 @@ import {
|
|||||||
neutralCharacterName,
|
neutralCharacterName,
|
||||||
updateChatMetadata,
|
updateChatMetadata,
|
||||||
system_message_types,
|
system_message_types,
|
||||||
|
updateMessageBlock,
|
||||||
} from '../script.js';
|
} from '../script.js';
|
||||||
import { selected_group } from './group-chats.js';
|
import { selected_group } from './group-chats.js';
|
||||||
import { power_user } from './power-user.js';
|
import { power_user } from './power-user.js';
|
||||||
@@ -1573,9 +1574,30 @@ jQuery(function () {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.mes_reasoning_delete', async function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const confirm = await Popup.show.confirm(t`Are you sure you want to clear the reasoning?`, t`Visible message contents will stay intact.`);
|
||||||
|
|
||||||
|
if (!confirm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const mesBlock = $(this).closest('.mes');
|
||||||
|
const mesId = Number(mesBlock.attr('mesid'));
|
||||||
|
const message = chat[mesId];
|
||||||
|
if (!message?.extra){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
message.extra.reasoning = '';
|
||||||
|
await saveChatConditional();
|
||||||
|
updateMessageBlock(mesId, message);
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('pointerup', '.mes_reasoning_copy', async function () {
|
$(document).on('pointerup', '.mes_reasoning_copy', async function () {
|
||||||
const mesBlock = $(this).closest('.mes');
|
const mesBlock = $(this).closest('.mes');
|
||||||
const mesId = mesBlock.attr('mesid');
|
const mesId = Number(mesBlock.attr('mesid'));
|
||||||
const message = chat[mesId];
|
const message = chat[mesId];
|
||||||
const reasoning = message?.extra?.reasoning;
|
const reasoning = message?.extra?.reasoning;
|
||||||
|
|
||||||
|
@@ -348,7 +348,6 @@ input[type='checkbox']:focus-visible {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: 70vh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mes_reasoning_summary {
|
.mes_reasoning_summary {
|
||||||
@@ -356,18 +355,26 @@ input[type='checkbox']:focus-visible {
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mes_reasoning_details:not([open]) .mes_reasoning_copy {
|
.mes_reasoning_details:not([open]) .mes_reasoning_actions {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mes_reasoning_copy {
|
.mes_reasoning_actions {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: flex-end;
|
||||||
|
transition: all 200ms;
|
||||||
|
overflow-x: hidden;
|
||||||
|
padding: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mes_reasoning_summary > span {
|
.mes_reasoning_summary > span {
|
||||||
margin-left: 5px;
|
margin-left: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mes_reasoning_details:has(.mes_reasoning:empty),
|
.mes_reasoning_details:has(.mes_reasoning:empty),
|
||||||
|
Reference in New Issue
Block a user