Tracker Visualizations — Design Document

Status: Concept — depends on Trackers for the tracker system. (Update 2026-09-29: Trackers Phase 1 shipped 2026-05-30, and typed values gave every tracker a fixed, per-type visual in the chat's Story state bar — numeric/percentage as a progress bar, enum as a badge, list as chips, datetime with a clock (clientConsole/src/pages/chat-v2/components/TrackerBar.tsx). The creator-configured visualizations this doc designs — gauges, icon sets, color stops, image states — are still not built.)

Overview

Trackers currently display as text values in a collapsed bar or expanded detail view. Tracker visualizations allow creators to attach custom visual representations to trackers — progress bars, gauges, icon sets, color-coded states — that render directly in the chat UI alongside (or instead of) the raw value.

The goal is to let creators build immersive, game-like HUDs without any code. A health bar that drains red. A reputation meter that shifts from hostile to friendly. A day/night indicator with sun and moon icons. A relationship chart with character portraits. All driven by tracker values, all configured by the creator.

Core Goals


Visualization Types

Each tracker can have one visualization attached. The visualization type determines how the tracker value is rendered.

Progress Bar

A horizontal bar that fills based on a numeric value within a range.

Setting Type Description
min number Minimum value (left edge)
max number Maximum value (right edge)
colorStops array Color thresholds: [{ at: 25, color: "#ff0000" }, { at: 50, color: "#ffaa00" }, { at: 75, color: "#00cc00" }]
showValue boolean Display the numeric value alongside the bar
label string (optional) Label shown next to the bar
direction ltr | rtl Fill direction (default: ltr)

Collapsed rendering: Thin inline bar with value, fits within the tracker bar line.
Expanded rendering: Full-width bar with label, value, and color transitions.

Collapsed:  HP: ████████░░ 72/100
Expanded:   ♥ Hit Points  ████████████░░░░░ 72 / 100

Use cases: HP, mana, stamina, hunger, sanity, fuel, battery.

Gauge

A semi-circular or arc gauge for values that represent a spectrum or dial.

Setting Type Description
min number Minimum value
max number Maximum value
zones array Named zones: [{ from: 0, to: 3, label: "Hostile", color: "#ff0000" }, { from: 4, to: 6, label: "Neutral", color: "#cccc00" }, { from: 7, to: 10, label: "Friendly", color: "#00cc00" }]
showZoneLabel boolean Display the current zone name

Collapsed rendering: Zone label only (e.g., Reputation: Neutral), colored to match the zone.
Expanded rendering: Visual arc gauge with needle position and zone coloring.

Use cases: Reputation, alignment, temperature, mood, relationship level.

Icon Set

A row of icons where the active icon(s) reflect the current value. Works for both enum (one active) and numeric (fill up to N) trackers.

Setting Type Description
icons array Ordered icon entries: [{ value: "new_moon", icon: "🌑" }, { value: "crescent", icon: "🌒" }, ... { value: "full_moon", icon: "🌕" }]
mode select | fill select: highlight the matching icon. fill: highlight all icons up to the current value
inactiveOpacity number Opacity for non-active icons (0.0 - 1.0, default: 0.3)

Collapsed rendering: Only the active icon(s), inline.
Expanded rendering: Full icon row with active/inactive styling.

Collapsed:  Moon: 🌓
Expanded:   Moon Phase:  🌑 🌒 🌓 🌔 🌕    (🌓 highlighted, others dimmed)

Use cases: Moon phases, weather, time of day, character mood, skill levels (stars), hearts (lives).

Color State

The tracker value text is rendered with a background or text color that changes based on the value. Simplest visualization — just applies color.

Setting Type Description
states array [{ match: "poisoned", color: "#88ff00", bgColor: "#1a2b00" }, { match: "healthy", color: "#00ff44" }]
defaultColor string Fallback color if no state matches

Collapsed rendering: Tracker value text in the matching color.
Expanded rendering: Same, with optional background color as a badge/chip.

Collapsed:  Status: poisoned  (in sickly green)
Expanded:   Status:  [poisoned]  (green-on-dark chip)

Use cases: Status effects, alert levels, weather conditions, faction allegiance.

Badge

A compact visual token — icon + label + optional value — for trackers that represent countable or categorical state.

Setting Type Description
icon string Emoji or gallery image reference
colorMap object (optional) Map values to badge colors: { "gold": "#ffd700", "silver": "#c0c0c0" }

Collapsed rendering: Icon + value as a compact badge inline.
Expanded rendering: Larger badge with label.

Collapsed:  💰 340
Expanded:   💰 Gold: 340

Use cases: Currency, score, level, XP, kill count, collectibles.

Image State

A gallery image that changes based on the tracker value. The creator maps tracker values to different gallery images.

Setting Type Description
imageMap array [{ match: "day", imageId: "gallery-image-uuid-1" }, { match: "night", imageId: "gallery-image-uuid-2" }]
size small | medium | large Rendering size
fallbackImageId gallery_image_id (optional) Image shown when no match

Collapsed rendering: Small thumbnail inline (small size only).
Expanded rendering: Image at configured size with label.

Use cases: Character portraits (mood-based), location art, weather icons, item in hand, map state.


Configuration

Creators configure visualizations as part of the tracker definition. Each tracker has an optional visualization field:

{
  "name": "Hit Points",
  "type": "number",
  "min": 0,
  "max": 100,
  "visualization": {
    "type": "progress_bar",
    "colorStops": [
      { "at": 25, "color": "#ff0000" },
      { "at": 50, "color": "#ffaa00" },
      { "at": 75, "color": "#00cc00" }
    ],
    "showValue": true,
    "label": "HP"
  }
}

The visualization config is stored alongside the tracker definition — no separate table or entity needed. It's part of the tracker's JSON schema.

The image_state visualization type references gallery images by ID. This uses the same ImagePickerModal workflow as inventory items — the creator picks from their gallery while setting up the tracker.


Rendering Rules

Collapsed Tracker Bar

The collapsed bar has limited space. Visualizations render in compact mode:

If a visualization is too complex for the collapsed bar, it falls back to the standard text rendering. The creator can set collapsedMode: "text" to force text in collapsed view.

Expanded Tracker Detail

The expanded view has full width. Visualizations render at their intended size with labels, legends, and interactive hover states (showing tooltips with zone descriptions, item details, etc.).

Animation

Value changes between messages trigger subtle animations:

Animations are CSS-only, short (200-400ms), and respect prefers-reduced-motion.


Multiple Visualizations

A single tracker has one visualization. But a character can have multiple trackers, each with its own visualization. The tracker bar renders them all in sequence:

HP: ████████░░ 72 | Reputation: Neutral | Moon: 🌓 | 💰 340 | Status: poisoned

The expanded view stacks them vertically, each in its own row with full rendering.


Dependencies

Dependency Status What's Needed
Trackers Shipped (Phase 1, 2026-05-30; typed values) Tracker definitions with visualization config field
Gallery Shipped Image references for image_state visualization type

Scope Boundaries

In scope:

Out of scope (future):