diff --git a/frontend/src/pages/agent-detail/AgentDetailPage.tsx b/frontend/src/pages/agent-detail/AgentDetailPage.tsx index 3a2f2191e..f757454fe 100644 --- a/frontend/src/pages/agent-detail/AgentDetailPage.tsx +++ b/frontend/src/pages/agent-detail/AgentDetailPage.tsx @@ -2063,6 +2063,10 @@ export default function AgentDetailPage() { const [showAllFocus, setShowAllFocus] = useState(false); const [showCompletedFocus, setShowCompletedFocus] = useState(false); const [showAllReflections, setShowAllReflections] = useState(false); + // Sidebar Focus group expand states + const [showAllSideActive, setShowAllSideActive] = useState(false); + const [showAllSideSystem, setShowAllSideSystem] = useState(false); + const [showAllSideCompleted, setShowAllSideCompleted] = useState(false); const [awareView, setAwareView] = useState<'list' | 'calendar'>('list'); const [awareCalendarMode, setAwareCalendarMode] = useState<'day' | 'week' | 'month'>('week'); const [awareCalendarDate, setAwareCalendarDate] = useState(() => new Date()); @@ -4448,12 +4452,42 @@ export default function AgentDetailPage() { ); }; - const renderFocusGroup = (title: string, items: FocusItem[]) => { + const SIDE_FOCUS_LIMIT = 12; + const renderFocusGroup = ( + title: string, + items: FocusItem[], + showAll: boolean, + setShowAll: (val: boolean) => void, + ) => { if (items.length === 0) return null; + const hasMore = items.length > SIDE_FOCUS_LIMIT; + const visibleItems = showAll ? items : items.slice(0, SIDE_FOCUS_LIMIT); return (
-
{title}
- {items.slice(0, 12).map(renderFocusItem)} +
+ {title} + {hasMore && ( + + {showAll ? '' : `${SIDE_FOCUS_LIMIT}/${items.length}`} + + )} +
+ {visibleItems.map(renderFocusItem)} + {hasMore && ( + + )}
); }; @@ -4612,19 +4646,38 @@ export default function AgentDetailPage() {
{t('agent.aware.focusEmpty')}
) : ( <> - {renderFocusGroup(isZh ? '进行中' : 'In progress', activeFocusItems)} - {renderFocusGroup(isZh ? '系统 Focus' : 'System Focus', systemFocusItems)} + {renderFocusGroup(isZh ? '进行中' : 'In progress', activeFocusItems, showAllSideActive, setShowAllSideActive)} + {renderFocusGroup(isZh ? '系统 Focus' : 'System Focus', systemFocusItems, showAllSideSystem, setShowAllSideSystem)} {completedFocusItems.length > 0 && (
- {showCompletedFocus && completedFocusItems.slice(0, 12).map(renderFocusItem)} + {showCompletedFocus && ( + <> + {(showAllSideCompleted ? completedFocusItems : completedFocusItems.slice(0, SIDE_FOCUS_LIMIT)).map(renderFocusItem)} + {completedFocusItems.length > SIDE_FOCUS_LIMIT && ( + + )} + + )}
)}