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

Principle:777genius Agent teams ai Context Display

From Leeroopedia
Knowledge Sources
Domains Session_Analysis, UI_Overlay
Last Updated 2026-10-22 00:00 GMT

Overview

Pattern for rendering per-turn context token breakdowns and session-wide context phases as UI components (badges, hover popovers, full panels).

Description

Context Display is the practice of presenting context tracking data to the user through three complementary UI surfaces:

  • ContextBadge: A compact badge per timeline turn that shows a popover with the 6-category token breakdown when hovered.
  • TokenUsageDisplay: A hover-triggered breakdown showing token usage by category with formatted token counts.
  • SessionContextPanel: A full panel showing the complete session context overview with all phases and per-turn stats.

The display components consume `ContextStats` and `ContextPhaseInfo` from the context tracker, using type guards (`isClaudeMdInjection`, `isToolOutputInjection`, etc.) to discriminate the injection union type and render category-specific details.

Usage

Use this principle when designing multi-level UI surfaces for presenting complex per-turn analytics data, especially when the same data must be visible at different levels of detail (badge, hover, full panel).

Related Pages

Implemented By

Page Connections

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