Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4223,6 +4223,7 @@ body.resizing .sidebar{transition:none!important;}
.transparent-event-row .thinking-card.open .thinking-card-body{
border-top-color:transparent;
padding:0 0 3px;
scrollbar-gutter:stable;
}
.transparent-event-row .tool-card-detail > *,
.transparent-event-row .thinking-card-body > *{min-height:0;}
Expand Down
59 changes: 56 additions & 3 deletions static/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -10945,6 +10945,7 @@ function _renderLiveAnchorActivitySceneTransparent(streamId, scene, opts){
});
const liveFooter=blocks.querySelector('#liveRunStatus');
let wrote=false;
const targetRenderedRows=[];
for(const row of rows){
const node=_anchorSceneTransparentNodeForRow(row,{
live:true,
Expand All @@ -10960,10 +10961,35 @@ function _renderLiveAnchorActivitySceneTransparent(streamId, scene, opts){
: node;
if(existing) preserveByKey.delete(key);
if(!renderedNode) continue;
if(liveFooter&&liveFooter.parentElement===blocks) blocks.insertBefore(renderedNode,liveFooter);
else blocks.appendChild(renderedNode);
targetRenderedRows.push(renderedNode);
wrote=true;
}
const transparentLiveRowNextSibling=(node)=>{
if(!node) return null;
if(typeof node.nextSibling!=='undefined') return node.nextSibling;
const parent=node.parentElement||node.parentNode;
if(parent&&parent.children&&typeof parent.children.length==='number'){
const index=Array.prototype.indexOf.call(parent.children,node);
return index>=0 ? (parent.children[index+1]||null) : null;
}
return null;
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated
};
const transparentLiveRowAlreadyPositioned=(node, expectedNextSibling)=>!!(
node &&
node.parentElement===blocks &&
transparentLiveRowNextSibling(node)===expectedNextSibling
);
let expectedNextSibling=(liveFooter&&liveFooter.parentElement===blocks) ? liveFooter : null;
for(let i=targetRenderedRows.length-1;i>=0;i--){
const renderedNode=targetRenderedRows[i];
if(transparentLiveRowAlreadyPositioned(renderedNode,expectedNextSibling)){
expectedNextSibling=renderedNode;
continue;
}
if(expectedNextSibling&&expectedNextSibling.parentElement===blocks) blocks.insertBefore(renderedNode,expectedNextSibling);
else blocks.appendChild(renderedNode);
expectedNextSibling=renderedNode;
}
preserveByKey.forEach(stale=>stale.remove());
if(wrote) _syncTransparentEventControls(turn);
if(typeof _moveLiveRunStatusToTurnEnd==='function') _moveLiveRunStatusToTurnEnd();
Expand Down Expand Up @@ -11029,6 +11055,7 @@ function _rehydrateTransparentLiveRow(existing, node, preservedState){
if(!existing) return;
if(node && Object.prototype.hasOwnProperty.call(node, '_tcData')) existing._tcData = node._tcData;
else if(Object.prototype.hasOwnProperty.call(existing, '_tcData')) delete existing._tcData;
try{ delete node._tcData; }catch(_){}
const header = existing.querySelector ? existing.querySelector('.tool-card-header,.thinking-card-header') : null;
if(header){
if(typeof _wireTransparentHeaderToggle === 'function') _wireTransparentHeaderToggle(header);
Expand All @@ -11049,6 +11076,26 @@ function _rehydrateTransparentLiveRow(existing, node, preservedState){
}
}

function _refreshTransparentThinkingLiveRow(existing, node){
if(!existing || !node || !existing.querySelector || !node.querySelector) return false;
const existingType = String(existing.getAttribute('data-event-type') || '');
const nodeType = String(node.getAttribute('data-event-type') || '');
const existingIsThinking = existingType === 'thinking' || (existing.classList&&existing.classList.contains('transparent-thinking-event'));
const nodeIsThinking = nodeType === 'thinking' || (node.classList&&node.classList.contains('transparent-thinking-event'));
if(!existingIsThinking || !nodeIsThinking) return false;
const existingPre = existing.querySelector('.thinking-card-body pre');
const nodePre = node.querySelector('.thinking-card-body pre');
if(!existingPre || !nodePre) return false;
const nextText = String(nodePre.textContent || '');
if(existingPre.textContent !== nextText) existingPre.textContent = nextText;
const nodePreview = node.querySelector('.transparent-event-thinking-preview');
const previewText = nodePreview ? String(nodePreview.textContent || '') : nextText;
if(typeof _decorateTransparentEventRow === 'function'){
_decorateTransparentEventRow(existing,{type:'thinking',text:nextText,preview:previewText});
}
return true;
}

function _refreshTransparentLiveRow(existing, node){
if(!existing || !node || !existing.getAttribute) return node;
if(existing===node) return existing;
Expand All @@ -11067,7 +11114,13 @@ function _refreshTransparentLiveRow(existing, node){
existing.setAttribute(name, value);
}
existing.className = node.className || '';
existing.innerHTML = node.innerHTML || '';
if(_refreshTransparentThinkingLiveRow(existing, node)){
_rehydrateTransparentLiveRow(existing, node, preservedState);
return existing;
}
const newHtml = node.innerHTML || '';
const htmlChanged = existing.innerHTML !== newHtml;
if(htmlChanged) existing.innerHTML = newHtml;
_rehydrateTransparentLiveRow(existing, node, preservedState);
return existing;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_issue3820_chat_activity_display_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def test_transparent_event_row_quiet_metadata_visual_rhythm():
assert "border-radius:0;" in STYLE_CSS
assert "margin-top:0;" in STYLE_CSS
assert "padding:0 8px 6px 27px;" in STYLE_CSS
assert ".transparent-event-row .thinking-card.open .thinking-card-body{\n border-top-color:transparent;\n padding:0 0 3px;\n}" in STYLE_CSS
assert ".transparent-event-row .thinking-card.open .thinking-card-body{\n border-top-color:transparent;\n padding:0 0 3px;\n scrollbar-gutter:stable;\n}" in STYLE_CSS

# Tabs: text-link style with an active underline (no pill background).
assert ".transparent-detail-mode.active{color:var(--text);opacity:1;font-weight:600;box-shadow:inset 0 -1px 0 var(--accent);}" in STYLE_CSS
Expand Down
Loading
Loading