Raxol. UI. Components. Harness. MessageBlock
(Raxol v2.6.1)
View Source
Renders a completed transcript message: item_completed{item_type: :message, content}.
content is a Markdown string. Body rendering is delegated entirely to
Raxol.UI.Components.Harness.MarkdownBody, which adds a streaming-aware
provisional close (mode: :streaming), control-char/ANSI sanitization,
and a never-raise fallback on top of the plain Markdown parse -- this
module only adds a dim, accent-colored role prefix
(role: :user | :assistant) above it so turns are visually
distinguishable without shouting. render/2 is pure content -> view: no
state of its own is read or written.
The stable-prefix optimization (cache the parse of the durable prefix of
a streaming message and only re-parse the live tail) is a documented
follow-up seam in MarkdownBody, not implemented here.
Behavioral note: sanitization applies in BOTH modes, so even a :sealed
render of control-char-bearing content is intentionally NOT
byte-identical to the old raw MarkdownRenderer parse -- control/ESC
bytes are stripped, invalid UTF-8 is recovered. Clean content renders
identically.
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
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.