Revert "fix(issues): prevent sticky mini bar oscillation with height placeholder"

This reverts commit 9fb25f4543.
This commit is contained in:
Naiyuan Qing 2026-04-03 18:35:52 +08:00
parent 9fb25f4543
commit 5548d60dbb

View file

@ -112,10 +112,8 @@ export function AgentLiveCard({ issueId, agentName, scrollContainerRef }: AgentL
const [autoScroll, setAutoScroll] = useState(true);
const [cancelling, setCancelling] = useState(false);
const [isStuck, setIsStuck] = useState(false);
const [cardHeight, setCardHeight] = useState(0);
const scrollRef = useRef<HTMLDivElement>(null);
const sentinelRef = useRef<HTMLDivElement>(null);
const cardRef = useRef<HTMLDivElement>(null);
const seenSeqs = useRef(new Set<string>());
// Check for active task on mount
@ -239,13 +237,7 @@ export function AgentLiveCard({ issueId, agentName, scrollContainerRef }: AgentL
const observer = new IntersectionObserver(
(entries) => {
if (!entries[0]) return;
const stuck = !entries[0].isIntersecting;
// Capture expanded height before collapsing to use as placeholder
if (stuck && cardRef.current) {
setCardHeight(cardRef.current.offsetHeight);
}
setIsStuck(stuck);
if (entries[0]) setIsStuck(!entries[0].isIntersecting);
},
{ root, threshold: 0, rootMargin: "-40px 0px 0px 0px" },
);
@ -292,10 +284,7 @@ export function AgentLiveCard({ issueId, agentName, scrollContainerRef }: AgentL
{/* Sentinel — zero-height element that IntersectionObserver watches */}
<div ref={sentinelRef} className="mt-4 h-0 pointer-events-none" aria-hidden />
{/* Placeholder preserves card height when stuck, preventing layout shift */}
<div style={{ minHeight: isStuck && cardHeight ? cardHeight : undefined }}>
<div
ref={cardRef}
className={cn(
"rounded-lg border transition-all duration-200",
isStuck
@ -385,7 +374,6 @@ export function AgentLiveCard({ issueId, agentName, scrollContainerRef }: AgentL
)}
</div>
</div>
</div>
</>
);
}