fix: fix tool output expansion checks (#1634)

This commit is contained in:
Alice Hau
2025-03-11 19:56:20 -04:00
committed by GitHub
parent 9682bee157
commit abf44e2197
@@ -100,7 +100,9 @@ function ToolResultView({ result }: ToolResultViewProps) {
const shouldShowExpanded = (item: Content, index: number) => {
return (
(item.annotations.priority !== undefined && item.annotations.priority >= 0.5) ||
(item.annotations &&
item.annotations.priority !== undefined &&
item.annotations.priority >= 0.5) ||
expandedItems.includes(index)
);
};
@@ -110,7 +112,9 @@ function ToolResultView({ result }: ToolResultViewProps) {
{filteredResults.map((item, index) => {
const isExpanded = shouldShowExpanded(item, index);
const shouldMinimize =
item.annotations.priority === undefined || item.annotations.priority < 0.5;
!item.annotations ||
item.annotations.priority === undefined ||
item.annotations.priority < 0.5;
return (
<div key={index} className="relative">
{shouldMinimize && (