fix: fix tool output expansion checks (#1634)
This commit is contained in:
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user