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
|
Auto-Expand
|
||||||
</small>
|
</small>
|
||||||
</label>
|
</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>
|
||||||
<div class="flex-container alignItemsBaseline">
|
<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">
|
<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,
|
auto_parse: false,
|
||||||
add_to_prompts: false,
|
add_to_prompts: false,
|
||||||
auto_expand: false,
|
auto_expand: false,
|
||||||
|
show_hidden: false,
|
||||||
prefix: '<think>\n',
|
prefix: '<think>\n',
|
||||||
suffix: '\n</think>',
|
suffix: '\n</think>',
|
||||||
separator: '\n\n',
|
separator: '\n\n',
|
||||||
|
@ -503,6 +503,15 @@ function loadReasoningSettings() {
|
|||||||
toggleReasoningAutoExpand();
|
toggleReasoningAutoExpand();
|
||||||
saveSettingsDebounced();
|
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() {
|
function registerReasoningSlashCommands() {
|
||||||
@ -874,7 +883,6 @@ function registerReasoningAppEvents() {
|
|||||||
|
|
||||||
export function initReasoning() {
|
export function initReasoning() {
|
||||||
loadReasoningSettings();
|
loadReasoningSettings();
|
||||||
toggleReasoningAutoExpand();
|
|
||||||
setReasoningEventHandlers();
|
setReasoningEventHandlers();
|
||||||
registerReasoningSlashCommands();
|
registerReasoningSlashCommands();
|
||||||
registerReasoningMacros();
|
registerReasoningMacros();
|
||||||
|
@ -428,16 +428,11 @@ input[type='checkbox']:focus-visible {
|
|||||||
background-color: color-mix(in srgb, var(--SmartThemeQuoteColor) 33%, var(--SmartThemeBlurTintColor) 66%);
|
background-color: color-mix(in srgb, var(--SmartThemeQuoteColor) 33%, var(--SmartThemeBlurTintColor) 66%);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Hide hidden reasoning blocks - revert this selector to show them again */
|
/** If hidden reasoning should not be shown, we hide all blocks that don't have content */
|
||||||
.mes.reasoning[data-reasoning-state="hidden"] .mes_reasoning_details {
|
#chat:not([data-show-hidden-reasoning="true"]) .mes:has(.mes_reasoning:empty) .mes_reasoning_details {
|
||||||
display: none;
|
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 {
|
.mes_reasoning_details .mes_reasoning_arrow {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
Reference in New Issue
Block a user