diff --git a/src/web-ui/src/app/components/panels/content-canvas/anchor-zone/AnchorZone.tsx b/src/web-ui/src/app/components/panels/content-canvas/anchor-zone/AnchorZone.tsx index a753ec7d..087e4f93 100644 --- a/src/web-ui/src/app/components/panels/content-canvas/anchor-zone/AnchorZone.tsx +++ b/src/web-ui/src/app/components/panels/content-canvas/anchor-zone/AnchorZone.tsx @@ -46,11 +46,6 @@ export const AnchorZone: React.FC = ({ const startPosRef = useRef(0); const startSizeRef = useRef(size); - // Do not render when hidden - if (position === 'hidden') { - return null; - } - const isBottom = position === 'bottom'; // Handle resize start @@ -96,6 +91,10 @@ export const AnchorZone: React.FC = ({ }, [isCollapsed]); // Toggle position + if (position === 'hidden') { + return null; + } + return (
= ({ data }) => { const { t } = useTranslation('flow-chat'); const { toolItem, taskInput, sessionId } = data || {}; + const status = toolItem?.status; + const toolResult = toolItem?.toolResult; + const parentTaskToolId = toolItem?.id; const [subagentItems, setSubagentItems] = useState([]); const contentRef = useRef(null); // Track auto-scroll; disable when the user scrolls up. const shouldAutoScrollRef = useRef(true); - - if (!toolItem) { - return ( -
-
- - {t('toolCards.taskDetailPanel.untitled')} - -
-
- {t('toolCards.taskDetailPanel.noData', 'Unable to load task data')} -
-
- ); - } - - const { status, toolResult } = toolItem; - const parentTaskToolId = toolItem.id; // Collect subagent items associated with this task. useEffect(() => { @@ -221,6 +206,21 @@ export const TaskDetailPanel: React.FC = ({ data }) => { } }, [sessionId, handleOpenInEditor]); + if (!toolItem) { + return ( +
+
+ + {t('toolCards.taskDetailPanel.untitled')} + +
+
+ {t('toolCards.taskDetailPanel.noData', 'Unable to load task data')} +
+
+ ); + } + return (
diff --git a/src/web-ui/src/flow_chat/components/modern/ScrollAnchor.tsx b/src/web-ui/src/flow_chat/components/modern/ScrollAnchor.tsx index 50a1abb2..c7d2df4c 100644 --- a/src/web-ui/src/flow_chat/components/modern/ScrollAnchor.tsx +++ b/src/web-ui/src/flow_chat/components/modern/ScrollAnchor.tsx @@ -143,8 +143,6 @@ export const ScrollAnchor: React.FC = ({ return content.substring(0, maxLength) + '...'; }; - if (anchorPoints.length === 0) return null; - const handleContainerMouseEnter = useCallback(() => { setIsHovering(true); }, []); @@ -153,6 +151,8 @@ export const ScrollAnchor: React.FC = ({ setIsHovering(false); }, []); + if (anchorPoints.length === 0) return null; + return ( <>
= ({ const hasDetails = status === 'completed' && files.length > 0; const hasResultData = toolResult?.result !== undefined && toolResult?.result !== null; - if (status === 'error') { - return null; - } - const handleClick = useCallback(() => { if (hasDetails) { applyExpandedState(isExpanded, !isExpanded, setIsExpanded, { @@ -186,6 +182,10 @@ export const GlobSearchDisplay: React.FC = ({ ); + if (status === 'error') { + return null; + } + return (
= ({ const hasDetails = status === 'completed' && stats.matches > 0; const hasResultData = toolResult?.result !== undefined && toolResult?.result !== null; - if (status === 'error') { - return null; - } - const handleClick = useCallback(() => { if (hasDetails) { applyExpandedState(isExpanded, !isExpanded, setIsExpanded, { @@ -141,6 +137,10 @@ export const GrepSearchDisplay: React.FC = ({ ); + if (status === 'error') { + return null; + } + return (
= ({ const hasDetails = status === 'completed' && entries.length > 0; const hasResultData = toolResult?.result !== undefined && toolResult?.result !== null; - if (status === 'error') { - return null; - } - const handleClick = useCallback(() => { if (hasDetails) { applyExpandedState(isExpanded, !isExpanded, setIsExpanded, { @@ -182,6 +178,10 @@ export const LSDisplay: React.FC = ({ ); + if (status === 'error') { + return null; + } + return (
= ({ const displayMode = config?.displayMode || 'compact'; - if (displayMode === 'compact') { - return ( -
- - {isLoading ? ( - - ) : ( - - )} - - {todosToDisplay.length > 0 && ( - <> - {t('toolCards.todoWrite.tasksCount', { count: todosToDisplay.length })} - {t('toolCards.todoWrite.progress', { completed: taskStats.completed, total: taskStats.total })} - - )} -
- ); - } - const renderTrackDot = (todo: any, index: number) => { const statusClass = `track-dot--${todo.status}`; return ( @@ -125,6 +105,26 @@ export const TodoWriteDisplay: React.FC = ({ }); }, [applyExpandedState, isExpanded, todosToDisplay.length]); + if (displayMode === 'compact') { + return ( +
+ + {isLoading ? ( + + ) : ( + + )} + + {todosToDisplay.length > 0 && ( + <> + {t('toolCards.todoWrite.tasksCount', { count: todosToDisplay.length })} + {t('toolCards.todoWrite.progress', { completed: taskStats.completed, total: taskStats.total })} + + )} +
+ ); + } + return (
= ({ const hasResultData = toolResult?.result !== undefined && toolResult?.result !== null; const hasResults = searchResults && searchResults.results.length > 0; - if (status === 'error') { - return null; - } - const handleClick = useCallback(() => { if (status === 'completed' && hasResults) { applyExpandedState(isExpanded, !isExpanded, setIsExpanded, { @@ -141,6 +137,10 @@ export const WebSearchCard: React.FC = ({
); + if (status === 'error') { + return null; + } + return (