mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add collapse argument to /reasoning-set command
Allows controlling visibility of reasoning blocks through slash commands by adding a boolean 'collapse' parameter Respects default expansion settings when not explicitly provided This gives users direct control over block visibility during command execution rather than relying solely on global preferences
This commit is contained in:
@ -832,6 +832,12 @@ function registerReasoningSlashCommands() {
|
||||
typeList: ARGUMENT_TYPE.NUMBER,
|
||||
enumProvider: commonEnumProviders.messages(),
|
||||
}),
|
||||
SlashCommandNamedArgument.fromProps({
|
||||
name: 'collapse',
|
||||
description: 'Whether to collapse the reasoning block. (If not provided, uses the default expand setting)',
|
||||
typeList: [ARGUMENT_TYPE.BOOLEAN],
|
||||
enumList: commonEnumProviders.boolean('trueFalse')(),
|
||||
}),
|
||||
],
|
||||
unnamedArgumentList: [
|
||||
SlashCommandArgument.fromProps({
|
||||
@ -856,6 +862,9 @@ function registerReasoningSlashCommands() {
|
||||
|
||||
closeMessageEditor('reasoning');
|
||||
updateMessageBlock(messageId, message);
|
||||
|
||||
if (isTrueBoolean(String(args.collapse))) $(`#chat [mesid="${messageId}"] .mes_reasoning_details`).removeAttr('open');
|
||||
if (isFalseBoolean(String(args.collapse))) $(`#chat [mesid="${messageId}"] .mes_reasoning_details`).attr('open', '');
|
||||
return message.extra.reasoning;
|
||||
},
|
||||
}));
|
||||
|
Reference in New Issue
Block a user