Raxol. UI. Components. Harness. ActivityIndicator
(Raxol v2.6.1)
View Source
Working / idle / hung indicator for one harness turn.
since_ms is the elapsed time, in milliseconds, that the turn has spent in
its current state -- not a wall-clock timestamp. That keeps render/2 a
pure function of props (no System.monotonic_time/1 inside render, so the
component stays trivially testable); the caller's own tick/subscription
loop accumulates it, the same way Raxol.Playground.Demos.StatusBarDemo
accumulates model.tick.
When state: :working has run longer than hung_threshold_ms, the
indicator flips itself to the hung display even though the caller still
claims :working -- that override is the point: it catches the agent that
died but still looks like it is working.
Summary
Functions
Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.
Callback implementation for Raxol.UI.Components.Base.Component.update/2.
Types
@type activity_state() :: :working | :idle | :hung
@type t() :: %{ id: String.t() | atom(), state: activity_state(), since_ms: number(), frame: non_neg_integer(), hung_threshold_ms: pos_integer(), style: map(), theme: map() }
Functions
Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.
Callback implementation for Raxol.UI.Components.Base.Component.update/2.