# Field: Multi-Entity Observability & Dashboard Design

**Scope:** Rendering, visual encoding, and information design for live multi-entity state (terminal panes, agents, processes). Does NOT cover workspace taxonomy, tmux internals, or backend integration.

---

## Canonical Concepts

### Shneiderman's Visual Information-Seeking Mantra (1996)
"Overview first, zoom and filter, then details on demand." The canonical sequence for any multi-entity display: start with a structured summary of all entities; allow faceted filtering to narrow focus; reveal full detail only on explicit selection. Originally from *The Eyes Have It* (IEEE VLang 1996). Cited as foundational in every observability HCI review.

### "Single Pane of Glass" & Operational Dashboard Canon
A "single pane of glass" (SPOG) consolidates heterogeneous entity state into one coherent view. Grafana's official guidance: each dashboard must "tell a story or answer a question" — not display everything possible. Hierarchy principle: overview → namespace/group → individual entity. Template variables (parameterized dashboards) prevent sprawl: one dashboard for N entities via filters, not N dashboards.

### Signal-vs-Noise & The Cost of the "Unknown" Bucket
Grafana docs explicitly: "Show only relevant information — if asking 'which servers are troubled?', display only troubled ones." An undifferentiated "unknown" bucket is high-cardinality noise that buries signal. The design response: treat unclassified entities as a *triage queue*, not a discard pile — show count + most-recently-active + a "classify" affordance. Do not collapse unknowns into a single muted row; surface their activity honestly.

### Munzner's Nested Design Model (VAD, 2014)
Tamara Munzner's *Visualization Analysis & Design* defines four nested design levels: domain characterization → data/task abstraction → visual encoding/interaction → algorithm. The key principle: visual encoding must match the semantic type of the data. A 0..1 confidence score is a quantitative ordered attribute — encode as a continuous visual channel (opacity, bar fill, color luminance), not a discrete icon.

### Focus + Context
Fisheye/focus+context: the active/selected entity gets full detail; surrounding entities remain visible at reduced resolution. Implemented in k9s (active resource expands; namespace context stays in header), btop (selected process gets expanded stats; others remain in list). Avoids the "zoom to blindness" failure of naive drill-down.

---

## Key Findings / Principles

### TUI Reference Implementations

**k9s (Kubernetes):** Two-region layout — header (diagnostic/cluster context, breadcrumb trail) + main pane (resource list). Resources are grouped by namespace. Color semantics: green = healthy, yellow = degraded, red = failing. Fuzzy filter (`/`) narrows the list in-place without navigation. Real-time polling with continuous diff-apply: only changed rows re-render. Drill-down is `Enter` → child resource list. The model: *grouping by operational domain + color health encoding + in-place filter + keypress drill-down.* (verified:true, k9scli.io)

**lazydocker:** Left panel = entity list (containers/services); right panel = context (logs, stats, env). All Compose services visible simultaneously. Key design choice: "every common command lives one keypress away" — no mode-switching. Multi-container selection for bulk ops. (verified:true, github.com/jesseduffield/lazydocker)

**btop:** Process list with CPU graph per row; sortable by `cpu_lazy` (activity-smoothed, easier to track) or `cpu_direct` (raw, instantaneous). Uses color gradient darkening for lower-priority items. Sparkline-style resource graphs in headers. The `cpu_lazy` sort is a critical UX decision: it prevents the list from thrashing when many processes compete. (verified:true, github.com/aristocratos/btop)

**htop/btop common pattern:** Color-coded bars scaled to percentage of max; fixed columns with sortable headers; tree-view for process hierarchy. Recency-by-activity is the default sort.

### Grafana Observability Canon
- RED method (Rate, Errors, Duration per entity) and Four Golden Signals (Latency, Traffic, Errors, Saturation) give a canonical 3–4 metric fingerprint per entity, enabling small-multiples layout.
- Stacked charts that hide entity-level signal are explicitly deprecated in Grafana docs.
- Color semantic contract: establish it once (blue=good, red=bad, grey=unknown-but-present) and hold it across all panels.
- Hierarchical drill-down with linked dashboards: clicking a domain chip navigates to a domain-scoped view.
- Dashboard sprawl anti-pattern: do not create one view per entity; use parameterized views. (verified:true, grafana.com/docs)

### Confidence Encoding (0..1)
- Avoid false precision: "99.73%" is worse than "~high confidence." Use discrete tiers with honest labels: `low (<0.4)`, `medium (0.4–0.75)`, `high (>0.75)`.
- Visual encoding options, ranked by expressiveness for a continuous value: opacity/fill of a bar (most continuous, color-blind-safe), color luminance gradient (red→yellow→green), icon tier (warning/info/check — least precise but fastest to scan).
- Anti-pattern: using only hue (red vs green) without luminance or shape — excludes color-blind users and carries no magnitude.
- Show the driver of confidence where possible ("classified by: command pattern" vs "classified by: cwd only") — agentic design canon. (verified:true, agentic-design.ai)

### Real-Time Data UX
From Smashing Magazine (2025) and Raw Studio analyses:
- **Update cadence:** Not all data needs constant updates. Thrashing at high poll rate causes flicker. Use optimistic rendering: display cached data immediately, apply delta on arrival.
- **Flicker prevention:** 200–400ms CSS transitions on metric changes; only re-render changed cells, not the full list. Skeleton UI (greyed placeholder with expected shape) while loading — not a spinner.
- **Showing what changed:** Delta indicators (▲ +N, ▼ -N) with directional color. Pulse/glow micro-animation on changed rows (200ms fade). Mini-sparkline showing last N snapshots per entity.
- **Staleness:** Persistent "last updated: Xs ago" badge. If snapshot age > threshold, shift entity card to a "stale" visual state (reduced opacity, dashed border). Explicit "Reconnecting…" banner for connection loss.
- **Empty/degraded state:** Show expected structure (skeleton), not blank. "No panes detected" must distinguish from "data not yet loaded." (verified:true, smashingmagazine.com/2025/09)

### Agent/Process Fleet Surfacing
From Sentry's agent observability guide and Datadog fleet patterns:
- Default sort: **activity descending** (most recently active command, or highest token/CPU consumption). Idle agents sink; active ones float.
- Group by **operational role or domain**, not by PID or start time.
- Surface error-rate / anomaly indicator at group header level so one failing agent doesn't require scanning every row.
- Per-agent sparkline of activity over last N snapshots gives temporal context at a glance.
- Logz.io pattern: cluster similar anomalies, surface only the most critical first — suppress duplicate low-value events. (verified:true, blog.sentry.io)

---

## Direct Fixes for the tide-live Page

### 1. Eliminate the Flat "Unknown" Pile — Make It a Triage Queue
**Current:** All null-domain panes collapse into one undifferentiated bucket, dominating the view.
**Fix:** Render unknowns as a collapsible `⚠ Unclassified (N)` section, sorted internally by `captured_at DESC` (most recent first). Show each pane's `cwd` basename and last command as the primary label — that alone is enough to orient the operator. Add a count badge to the section header. Unknowns with recent activity (< 30s) get a pulsing dot; stale unknowns (> 2 min) get reduced opacity. The operator can collapse the section once they've scanned it.

### 2. Group Known Domains as Cards, Sort by Activity
**Current:** Flat list grouped by domain, no prioritization signal.
**Fix:** Render each domain as a card with: domain label + pane count badge + a 5-point sparkline of activity (commands/snapshot). Sort cards by `max(captured_at)` of member panes — most-recently-active domain floats to top. Within a card, sort panes by `captured_at DESC`. Active pane (is_active=true) gets a green left-border accent. This gives the operator an instant "where is work happening right now" signal without reading every row.

### 3. Encode Confidence as a Segmented Bar, Not Raw Number
**Current:** Confidence shown as a 0..1 number (or simple bar) with no tier semantics.
**Fix:** Map to three tiers with honest labels: `low (<0.40)` / `medium` / `high (>0.75)`. Render as a short fill-bar (width = confidence × 100%) with color: red fill for low, amber for medium, teal for high. Do NOT show the raw decimal. Add a tooltip: "Classified by: [cwd pattern | command history | both]". Panes at `low` tier display a faint italic style — signal they may belong in Unclassified and should be verified.

### 4. Show "What Changed" Since Last Snapshot (Drift Indicator)
**Current:** Each poll replaces state; no sense of what moved.
**Fix:** Keep previous snapshot in component state. On each poll, diff pane lists: new panes get a `▲ new` badge for 3s; panes that changed domain get a `~ moved` badge; panes that disappeared get a 2s fade-out before removal. Add a persistent "Last updated Xs ago" chip in the header. If poll fails, the header shifts to amber with "Reconnecting…". This is the single highest-impact change for reducing the "static wall of state" feeling.

### 5. Inspector Panel: Contextual, Not Generic
**Current:** Click-to-inspect shows raw pane data.
**Fix:** Inspector panel header = domain chip + confidence bar + `classified_by` explanation. Body: `cwd` path (clickable to filter by parent dir), last 5 commands as a timeline (oldest dimmed), `captured_at` rendered as relative time ("3s ago"). A "Force domain" override field lets the operator manually assign domain — feeds back to classification logic as a training signal. This makes the panel feel like a decision-support tool, not a raw dump.

---

## Cautions

- **Color-only encoding fails color-blind users** — always pair color with shape, icon, or text label (confidence tier name, not just hue).
- **Premature grouping can be wrong:** if domain classification has high error rate, group headers mislead. Show confidence at group level too — a domain card with avg confidence < 0.5 should be visually flagged.
- **Over-animation creates cognitive noise** — limit to 200–400ms transitions; no persistent animations except the "active pane" pulse.
- **Sorting instability** — if recency-sort causes cards to reorder every poll, it's worse than stable ordering. Use a weighted sort: activity score = 0.7 × recency + 0.3 × command_rate. Reorder only if rank changes by more than 1 position.
- **False precision on confidence** — do not display 0.823. Display "high." Trust erodes when users learn the number is unstable between polls.

---

## Engineering Implications

- Maintain two snapshots in React state (`current`, `previous`) to enable diff computation client-side.
- Use CSS transitions (`transition: opacity 200ms, background-color 200ms`) on row elements — not JS animation — for flicker-free updates.
- Domain card order: compute a `domainActivityScore` (max `captured_at` epoch) once per poll, sort descending, memoize with `useMemo`. Avoid re-sorting on every render.
- Confidence tier thresholds (`LOW=0.4`, `HIGH=0.75`) should be configurable constants, not magic numbers — domain experts will tune them.
- Unclassified section: derive from `domain_id === null || domain_confidence < LOW_THRESHOLD`. Both cases belong in triage.
- Staleness: derive `isStale = (Date.now() - captured_at_ms) > STALE_THRESHOLD_MS` per pane. Default `STALE_THRESHOLD_MS = 120_000` (2 min).

---

## Sources

| # | Title | Author / Venue / Year | URL | DOI | Verified |
|---|-------|----------------------|-----|-----|---------|
| 1 | *The Eyes Have It: A Task by Data Type Taxonomy for Information Visualizations* | Ben Shneiderman, IEEE VLang 1996 | https://infovis-wiki.net/wiki/Visual_Information-Seeking_Mantra | — | verified:true |
| 2 | *Visualization Analysis and Design* | Tamara Munzner, AK Peters/CRC Press 2014 | https://www.cs.ubc.ca/~tmm/vadbook/ | 10.1201/b17511 | verified:true |
| 3 | Grafana Dashboard Best Practices (official docs) | Grafana Labs, 2025 | https://grafana.com/docs/grafana/latest/visualizations/dashboards/build-dashboards/best-practices/ | — | verified:true |
| 4 | *UX Strategies for Real-Time Dashboards* | Smashing Magazine, Sep 2025 | https://www.smashingmagazine.com/2025/09/ux-strategies-real-time-dashboards/ | — | verified:true |
| 5 | Confidence Visualization UI Patterns (CVP) | Agentic Design Patterns, 2025 | https://agentic-design.ai/patterns/ui-ux-patterns/confidence-visualization-patterns | — | verified:true |
| 6 | *AI Agent Observability: The Developer's Guide* | Sentry Blog, 2025 | https://blog.sentry.io/ai-agent-observability-developers-guide-to-agent-monitoring/ | — | verified:true |
| 7 | k9s — Kubernetes CLI TUI | Fernand Galiana (derailed), 2024–2026 | https://k9scli.io/ | — | verified:true |
| 8 | lazydocker — Terminal UI for Docker | Jesse Duffield, 2024–2026 | https://github.com/jesseduffield/lazydocker | — | verified:true |
| 9 | btop — Resource Monitor TUI | aristocratos, 2024–2026 | https://github.com/aristocratos/btop | — | verified:true |
| 10 | *Define Your Threshold: Communicating Confidence in UX Scorecards* | Microsoft Research, Customer Insights Group | https://www.microsoft.com/en-us/research/group/customer-insights-research/articles/define-your-threshold-communicating-confidence-in-ux-scorecards/ | — | verified:false |
