Raxol. UI. Components. Harness. BlastRadiusPreview
(Raxol v2.6.1)
View Source
Renders the blast radius of an agent-harness action: everything it will touch, grouped by effect kind, with destructive/irreversible effects made impossible to miss.
Render-dual of the blast_radius field carried by the harness's
approval_requested payload (see
docs/proposals/in-flight/harness-spec-frontend.md, §4 row A6). Typically
embedded inside Raxol.UI.Components.Harness.ApprovalPrompt, but stands
alone for the playground and for testing.
Props
:blast_radius-%{writes: [path], deletes: [path], commands: [string], network: [host], reversible: boolean}. Every key is optional; missing lists default to[], missing:reversibledefaults totrue(a missing/absent flag is not itself a danger signal -- but deletes are still shown loud regardless, see below). A missing PROP defaults to%{}-- a caller that never mentions a blast radius at all is presumed to have nothing to declare, and renders the calm "No tracked effects." line. An explicitnilVALUE is a different claim entirely: it means a producer somewhere upstream had an approval to show but no blast radius payload for it (seeRaxol.UI.Components.Harness.Block.extract_approval_content/1) -- that renders a standalone warning instead (see below), never the "No tracked effects." line, because an undeclared radius is not known to be safe.
Visual hierarchy
Per the tui-design-science skill: hue carries identity (what kind of
effect this is), weight carries importance (how much attention it
needs) -- kept independent so red stays reserved for the one thing it
means.
:deletesare always red + bold. Deleting earns a second look even inside an otherwise-reversible action.:commandsare yellow (caution -- unpredictable side effects),:networkis cyan (informational -- reaching outside the sandbox),:writescarry no hue, just weight.- When
blast_radius.reversible == false, every group loses its dim/default weight and renders bold -- nothing here is a "minor" effect anymore -- and a standaloneIRREVERSIBLEmarker leads the list, in red (the one other case the alarm hue is reserved for). - When
blast_radius.reversible == true,:commands/:network/:writesrender dim -- present, but not competing with the deletes group for attention.
Every group is glyph-prefixed, not color-only, so the hierarchy survives
for colorblind readers: ✗ delete, ▲ run, ℹ network, • write.
Summary
Functions
Structural row-count estimate of this preview's rendered height (content
rows only -- no outer frame/padding), for callers that need to size an
enclosing overlay before render/2 has run (see
Raxol.UI.Components.Harness.ApprovalPrompt.estimate_height/1). Generous
by design, mirroring Raxol.UI.Components.Modal.Rendering.estimate_height/1.
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 t() :: %{ id: String.t() | atom(), blast_radius: blast_radius() | nil, style: map(), theme: map() }
Functions
@spec estimate_rows(blast_radius() | nil) :: pos_integer()
Structural row-count estimate of this preview's rendered height (content
rows only -- no outer frame/padding), for callers that need to size an
enclosing overlay before render/2 has run (see
Raxol.UI.Components.Harness.ApprovalPrompt.estimate_height/1). Generous
by design, mirroring Raxol.UI.Components.Modal.Rendering.estimate_height/1.
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.