Merge #3971 (hide Worklog reasoning when Thinking disabled) onto master

This commit is contained in:
nesquena-hermes
2026-06-13 02:52:31 +00:00
4 changed files with 59 additions and 2 deletions

View File

@@ -1402,6 +1402,7 @@ function cmdReasoning(args){
const on=(arg==='show'||arg==='on');
// Update the UI render gate immediately for responsiveness.
window._showThinking=on;
if(!on&&typeof removeThinking==='function') removeThinking();
if(typeof renderMessages==='function') renderMessages();
// Persist via /api/reasoning → config.yaml display.show_reasoning
// (CLI reads the same key). Also mirror into WebUI settings.json

View File

@@ -7241,6 +7241,7 @@ function _renderWorklogReasonInto(row, text){
row.innerHTML=html;
}
function _worklogReasonNodeFromText(text, attrs){
if(window._showThinking===false) return null;
const html=_worklogReasonHtmlFromText(text);
if(!html) return null;
const row=document.createElement('div');
@@ -11477,9 +11478,10 @@ function removeThinking(){
const turn=$('liveAssistantTurn');
const blocks=_assistantTurnBlocks(turn);
if(blocks) blocks.querySelectorAll('.agent-activity-thinking').forEach(el=>el.remove());
if(blocks) blocks.querySelectorAll('.tool-call-group[data-agent-activity-group="1"]').forEach(group=>{
if(blocks) blocks.querySelectorAll('.wl-reason[data-worklog-reason-source="reasoning"]').forEach(el=>el.remove());
if(blocks) blocks.querySelectorAll('.live-worklog[data-live-worklog-shell="1"],.tool-worklog-group[data-live-tool-call-group="1"],.tool-call-group[data-live-tool-call-group="1"],.tool-call-group[data-agent-activity-group="1"]').forEach(group=>{
_syncToolCallGroupSummary(group);
if(!group.querySelector('.tool-card-row,.agent-activity-thinking')){
if(!group.querySelector('.tool-card-row,.agent-activity-thinking,.wl-reason')){
if(typeof _clearActivityElapsedTimer==='function') _clearActivityElapsedTimer();
group.remove();
}