Raxol.UI.Components.Harness.ContextMeter (Raxol v2.6.1)

View Source

Compaction-proximity gauge: how much of the context window is used.

Renders a Raxol.UI.Components.Progress.Bar bar colored green -> yellow -> red as used approaches total (the compaction threshold). Mirrors the three-tier gauge idiom already used by Raxol.Sensor.HUD.render_gauge/3 (percentage thresholds, not hardcoded token counts), kept local here since that module renders raw terminal cells rather than View DSL elements.

Summary

Types

t()

@type t() :: %{
  id: String.t() | atom(),
  used: non_neg_integer(),
  total: pos_integer(),
  width: pos_integer(),
  warn_threshold: float(),
  danger_threshold: float(),
  style: map(),
  theme: map()
}

Functions

broadcast(msg)

command(cmd)

handle_event(event, state, context)

Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.

mount(state)

Callback implementation for Raxol.UI.Components.Base.Component.mount/1.

schedule(msg, delay)

unmount(state)

Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.

update(props, state)

Callback implementation for Raxol.UI.Components.Base.Component.update/2.