mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
perf(agent-list): limit sidebar to 15 agents for fast rendering
Agents requiring attention are sorted to the top before slicing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,14 +20,16 @@ export function AgentList({ agents, isRefreshing = false, onRefresh, selectedAge
|
||||
const pathname = usePathname();
|
||||
const [actionAgent, setActionAgent] = useState<AggregatedAgent | null>(null);
|
||||
|
||||
// Sort agents with requires attention at the top
|
||||
// Sort agents with requires attention at the top, limit to 15 for fast rendering
|
||||
const sortedAgents = useMemo(() => {
|
||||
return [...agents].sort((a, b) => {
|
||||
// Requires attention first
|
||||
if (a.requiresAttention && !b.requiresAttention) return -1;
|
||||
if (!a.requiresAttention && b.requiresAttention) return 1;
|
||||
return 0;
|
||||
});
|
||||
return [...agents]
|
||||
.sort((a, b) => {
|
||||
// Requires attention first
|
||||
if (a.requiresAttention && !b.requiresAttention) return -1;
|
||||
if (!a.requiresAttention && b.requiresAttention) return 1;
|
||||
return 0;
|
||||
})
|
||||
.slice(0, 15);
|
||||
}, [agents]);
|
||||
|
||||
// Get the methods for the specific server
|
||||
|
||||
Reference in New Issue
Block a user