Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Heuristic:777genius Agent teams ai Semantic Zoom

From Leeroopedia
Knowledge Sources
Domains Rendering, Optimization
Last Updated 2026-10-22 00:00 GMT

Overview

Adapt the level of visual detail rendered on the agent graph canvas based on zoom level, culling unnecessary nodes and effects to maintain 60fps.

Description

The agent graph uses three semantic zoom levels: `overview` (zoom < 0.24), `summary` (zoom < 0.62), and `detail` (zoom >= 0.62). At overview, only organization hierarchy nodes are rendered. At summary, team cards and important nodes appear. At detail, individual task pills and all visual effects are shown. This prevents rendering thousands of nodes when zoomed out, keeping canvas performance high. Additionally, particles (animated edges) are culled at overview unless `animateAtOverview` is set. Team cards are always rendered even at overview because they carry the most useful leaf-level signal.

Usage

Use this heuristic when rendering large graphs on Canvas to maintain frame rate. Apply `shouldRenderNodeAtZoom()` before drawing each node. Apply `shouldRenderParticlesAtZoom()` before drawing animated particles. The thresholds are tuned for the agent graph's node density.

The Insight (Rule of Thumb)

  • Action: Call `getGraphSemanticZoomLevel(zoom)` and `shouldRenderNodeAtZoom(node, zoom)` before rendering each node.
  • Value: `summaryMin: 0.24`, `detailMin: 0.62`. Below 0.09, only depth-0 organization nodes render.
  • Trade-off: Less detail at low zoom — users must zoom in to see tasks and individual members. Acceptable; overview is for navigation.
  • Compatibility: Works with Canvas 2D rendering. Team cards (`visualVariant === 'team'`) always render for context.

Reasoning

Rendering all nodes, task pills, glow effects, and animated particles at every zoom level would overwhelm the canvas at large team counts (100+ members, 500+ tasks). Semantic zoom culls non-essential visual elements progressively: overview shows only the organizational structure, summary adds team summaries, and detail shows everything. This keeps the frame budget under 16ms even with hundreds of nodes.

Code Evidence

Zoom thresholds from `semantic-zoom.ts:5-8`:

export const GRAPH_SEMANTIC_ZOOM = {
  summaryMin: 0.24,
  detailMin: 0.62,
} as const;

Zoom level determination from `semantic-zoom.ts:10-14`:

export function getGraphSemanticZoomLevel(zoom: number): GraphSemanticZoomLevel {
  if (zoom < GRAPH_SEMANTIC_ZOOM.summaryMin) return 'overview';
  if (zoom < GRAPH_SEMANTIC_ZOOM.detailMin) return 'summary';
  return 'detail';
}

Task visibility from `semantic-zoom.ts:34-42`:

export function shouldRenderTaskAtZoom(
  zoom: number,
  isEmphasized = false,
  visibility = 'detail'
): boolean {
  if (isEmphasized || visibility === 'overview') return true;
  const level = getGraphSemanticZoomLevel(zoom);
  return level === 'detail' || (visibility === 'summary' && level === 'summary');
}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment