Principle:777genius Agent teams ai Context Display
| 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).