mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add toggle for showing hidden reasoning
This commit is contained in:
@ -3810,6 +3810,12 @@
|
||||
Auto-Expand
|
||||
</small>
|
||||
</label>
|
||||
<label class="checkbox_label flex1" for="reasoning_show_hidden" title="Show reasoning time for models with hidden reasoning." data-i18n="[title]reasoning_show_hidden">
|
||||
<input id="reasoning_show_hidden" type="checkbox" />
|
||||
<small data-i18n="Show Hidden">
|
||||
Show Hidden
|
||||
</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex-container alignItemsBaseline">
|
||||
<label class="checkbox_label flex1" for="reasoning_add_to_prompts" title="Add existing reasoning blocks to prompts. To add a new reasoning block, use the message edit menu." data-i18n="[title]reasoning_add_to_prompts">
|
||||
|
@ -258,6 +258,7 @@ let power_user = {
|
||||
auto_parse: false,
|
||||
add_to_prompts: false,
|
||||
auto_expand: false,
|
||||
show_hidden: false,
|
||||
prefix: '<think>\n',
|
||||
suffix: '\n</think>',
|
||||
separator: '\n\n',
|
||||
|
@ -503,6 +503,15 @@ function loadReasoningSettings() {
|
||||
toggleReasoningAutoExpand();
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
toggleReasoningAutoExpand();
|
||||
|
||||
$('#reasoning_show_hidden').prop('checked', power_user.reasoning.show_hidden);
|
||||
$('#reasoning_show_hidden').on('change', function () {
|
||||
power_user.reasoning.show_hidden = !!$(this).prop('checked');
|
||||
$('#chat').attr('data-show-hidden-reasoning', power_user.reasoning.show_hidden ? 'true' : null);
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
$('#chat').attr('data-show-hidden-reasoning', power_user.reasoning.show_hidden ? 'true' : null);
|
||||
}
|
||||
|
||||
function registerReasoningSlashCommands() {
|
||||
@ -874,7 +883,6 @@ function registerReasoningAppEvents() {
|
||||
|
||||
export function initReasoning() {
|
||||
loadReasoningSettings();
|
||||
toggleReasoningAutoExpand();
|
||||
setReasoningEventHandlers();
|
||||
registerReasoningSlashCommands();
|
||||
registerReasoningMacros();
|
||||
|
@ -428,16 +428,11 @@ input[type='checkbox']:focus-visible {
|
||||
background-color: color-mix(in srgb, var(--SmartThemeQuoteColor) 33%, var(--SmartThemeBlurTintColor) 66%);
|
||||
}
|
||||
|
||||
/** Hide hidden reasoning blocks - revert this selector to show them again */
|
||||
.mes.reasoning[data-reasoning-state="hidden"] .mes_reasoning_details {
|
||||
/** If hidden reasoning should not be shown, we hide all blocks that don't have content */
|
||||
#chat:not([data-show-hidden-reasoning="true"]) .mes:has(.mes_reasoning:empty) .mes_reasoning_details {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/** Show "Thinking..." during generation, even if the reasoning is hidden by default */
|
||||
body[data-generating="true"] .last_mes.reasoning[data-reasoning-state="hidden"] .mes_reasoning_details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mes_reasoning_details .mes_reasoning_arrow {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
|
Reference in New Issue
Block a user