Add toggle for showing hidden reasoning

This commit is contained in:
Wolfsblvt
2025-02-12 22:04:48 +01:00
parent 34db46d84b
commit b5fc7d6d4d
4 changed files with 18 additions and 8 deletions

View File

@ -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">

View File

@ -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',

View File

@ -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();

View File

@ -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%;