ConversationView
Category: Services
Source: conversation_view.dart
Classes
ConversationView
Read/write surface over the on-screen conversation transcript.
App owns the underlying storage (_blocks list, _streamingText, _streamingThinking, the terminal). The view holds references and callbacks so commands and other consumers can interact with the transcript without reaching into App.
Constructor
ConversationView({
required this._blocks,
required this._subagentGroups,
required this._streamingTextGetter,
required this._render,
required this._resetStreamingText,
required this._clearScreen,
required this._resetScrollOffset,
required this._clearToolUi,
required this._clearSubagentGroups,
})Properties
| Property | Type | Description |
|---|---|---|
entries | Iterable<ConversationEntry> get | Read-only iterable of currently rendered transcript entries. |
streamingText | String get | In-flight streaming assistant text (empty when no stream is active). |
entries | Iterable<ConversationEntry> get | Read-only iterable of currently rendered transcript entries. |
streamingText | String get | In-flight streaming assistant text (empty when no stream is active). |
Methods
String? lastAssistantText({bool includeStreaming = true})
Returns the most recent assistant text the user can see, including the in-flight streaming response if any. Returns null if no assistant content has appeared yet.
void notify(String message)
Adds a system message and re-renders.
void render()
Trigger a re-render without mutating the transcript. Used by panels that want to refresh their display while polling external state (e.g., the /provider add device-code flow's countdown).
void addEntry(ConversationEntry entry)
Append an entry to the rendered transcript and re-render. Used when a command needs to inject something other than a system message (e.g., tool calls / tool results from skill activation).
void clear()
Clears the transcript: blocks, in-flight streaming text, screen state. Used by /clear.
void resetForReplay()
Reset all transcript-shape state in preparation for a session replay (resume or fork). Unlike [clear], this does not touch the terminal screen — the caller will repaint via [appendReplayEntries] and other notifications. No render is issued.
void appendReplayEntries(List<SessionReplayEntry> entries)
Materialise a session's replay log into the rendered transcript. Reconstructs subagent groups on the fly: spawn opens a group keyed by subagent_id; subsequent events append to that group; completion just marks it done. Activity without a matching open group is skipped to avoid silent shape drift.