Class MessageListComponent
java.lang.Object
ai.mindconnect.adminui.ui.component.MessageListComponent
- All Implemented Interfaces:
UiComponent
The main conversation list of a chat page. Renders the message
history (interleaved with historic task cards rebuilt from
persisted TOOL_CALL/TOOL_RESULT messages) and exposes both the
navigation action buttons (Back / Memory / Traces / Todos /
Workspace) and the token-usage suffix in its title.
The component is the heart of the chat page in patch terms:
almost every streaming event translates into a patch against either
the list's root id (msg-list-{sid}) — for full refreshes
after a turn — or against individual item ids inside the list
(bot-pending placeholder, task cards, thinking indicator).
Patch shapes follow the renderer contract:
- APPEND with a single-item wrapper
UiList— the renderer extracts the wrapper'sitemsinto the existing<ul>so the list header isn't duplicated. - REPLACE with the rendered
UiListof the entire component — used when the header (token bar) needs to refresh alongside body changes. - REMOVE on a wrapper id — drops the surrounding
<li>.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe tool name and pretty-printed arguments out of a request's content JSON.static interfaceSupplies the pre-built sub-agent cards (with their nested child-task trees) for a given parenttoolCallId. -
Constructor Summary
ConstructorsConstructorDescriptionMessageListComponent(UUID sessionId, ai.mindconnect.agent.domain.AgentDefinition agent, List<ai.mindconnect.message.domain.Message> history, ai.mindconnect.agent.memory.domain.WorkingMemory memory) MessageListComponent(UUID sessionId, ai.mindconnect.agent.domain.AgentDefinition agent, List<ai.mindconnect.message.domain.Message> history, ai.mindconnect.agent.memory.domain.WorkingMemory memory, MessageListComponent.SubAgentTreeProvider subAgentTree) -
Method Summary
Modifier and TypeMethodDescriptionBuilds every tool / sub-agent card across this component's full history, in order.ai.mindconnect.ui.model.UiPatch.OperationappendApprovalCard(ai.mindconnect.ui.model.UiList.Item card) APPEND the live approval card — the stream-side twin of the historic render.ai.mindconnect.ui.model.UiPatch.OperationappendBotPending(String pendingId, String agentName) APPEND the bot-pending placeholder used as the streaming target.ai.mindconnect.ui.model.UiPatch.OperationappendErrorNotice(String message) APPEND a visible failure notice — a turn that FAILED (context overflow, backend error) must say so in the chat, not just stop the spinner.ai.mindconnect.ui.model.UiPatch.OperationAPPEND a task card to the list (running / done / failed variants).ai.mindconnect.ui.model.UiPatch.OperationappendTaskCardInto(String childListId, TaskCardComponent card) APPEND a task card into a nested sub-agent child list rather than the top-level message list.ai.mindconnect.ui.model.UiPatch.OperationappendThinking(String thinkingId, String agentName) APPEND an "AI is thinking …" placeholder shown between the user message and the first incoming token.ai.mindconnect.ui.model.UiPatch.OperationappendUserMessage(String text) APPEND a synthetic user-message item.static ai.mindconnect.ui.model.UiList.ItemThe approval card — ONE shape for every open question (root tool or sub-agent alike): the answer is a plain dispatch identified by callId alone, the ToolApprovalStore knows the rest.id()The DOM id this component renders with.The final assistant CHAT text in this component's history, ornull.parseApprovalContent(String content) ai.mindconnect.ui.model.UiPatch.OperationremoveThinking(String thinkingId) REMOVE the thinking indicator together with its wrapping<li>.ai.mindconnect.ui.model.UiListrender()Full render — emit the component as aUiNode.ai.mindconnect.ui.model.UiPatch.OperationREPLACE on the list root.ai.mindconnect.ui.model.UiPatch.OperationreplaceBotPending(String pendingId, String cumulativeText) REPLACE the bot-pending markdown body with the current cumulative text.ai.mindconnect.ui.model.UiPatch.OperationREPLACE a task card in place.withBubbledApprovals(List<ai.mindconnect.ui.model.UiList.Item> cards) Cards for the OPEN sub-agent approval questions of this (root) session — the controller builds them from theToolApprovalStore, the single truth for bubbled requests (nothing about them lives in this conversation's history).withParentSession(UUID parentSessionId) Sets the parent session id so the header shows an "↑ Parent Session" link.
-
Constructor Details
-
MessageListComponent
-
MessageListComponent
public MessageListComponent(UUID sessionId, ai.mindconnect.agent.domain.AgentDefinition agent, List<ai.mindconnect.message.domain.Message> history, ai.mindconnect.agent.memory.domain.WorkingMemory memory, MessageListComponent.SubAgentTreeProvider subAgentTree)
-
-
Method Details
-
withParentSession
Sets the parent session id so the header shows an "↑ Parent Session" link. Passnull(the default) for top-level, user-initiated sessions. Returnsthisfor fluent chaining. -
withBubbledApprovals
Cards for the OPEN sub-agent approval questions of this (root) session — the controller builds them from theToolApprovalStore, the single truth for bubbled requests (nothing about them lives in this conversation's history). Returnsthisfor fluent chaining. -
id
Description copied from interface:UiComponentThe DOM id this component renders with. Patch operations targeting this component (REPLACE / CLEAR / REMOVE) use this id, so it must match the id on the rootUiNodereturned byUiComponent.render().- Specified by:
idin interfaceUiComponent
-
render
public ai.mindconnect.ui.model.UiList render()Description copied from interface:UiComponentFull render — emit the component as aUiNode. Used both inside a page's full render and as the payload of a REPLACE patch.- Specified by:
renderin interfaceUiComponent
-
parseApprovalContent
-
approvalCard
public static ai.mindconnect.ui.model.UiList.Item approvalCard(UUID sessionId, String callId, String toolName, String argsJson, String time) The approval card — ONE shape for every open question (root tool or sub-agent alike): the answer is a plain dispatch identified by callId alone, the ToolApprovalStore knows the rest. The turn never ended, so there is no stream to start — the ORIGINAL stream carries the continuation once the parked tool task is woken. -
appendErrorNotice
APPEND a visible failure notice — a turn that FAILED (context overflow, backend error) must say so in the chat, not just stop the spinner. Not persisted: the failure lives on the task record; this is the live face of it. -
appendApprovalCard
public ai.mindconnect.ui.model.UiPatch.Operation appendApprovalCard(ai.mindconnect.ui.model.UiList.Item card) APPEND the live approval card — the stream-side twin of the historic render. -
replaceAll
public ai.mindconnect.ui.model.UiPatch.Operation replaceAll()REPLACE on the list root. Used after a turn finishes (streaming or non-streaming): rebuilds the full list from persisted history so the live bot-pending placeholder and live task cards get swapped for the final assistant message and its historic task cards. The token bar in the title refreshes at the same time. -
appendUserMessage
APPEND a synthetic user-message item. The id is temporary (epoch milliseconds) and only matters until the nextreplaceAll()— which is fine because the streaming chat always replaces the whole list at the end of the turn. -
appendBotPending
public ai.mindconnect.ui.model.UiPatch.Operation appendBotPending(String pendingId, String agentName) APPEND the bot-pending placeholder used as the streaming target. Subsequent token deltas REPLACE the placeholder's body (viareplaceBotPending(String, String)). -
replaceBotPending
public ai.mindconnect.ui.model.UiPatch.Operation replaceBotPending(String pendingId, String cumulativeText) REPLACE the bot-pending markdown body with the current cumulative text. The pendingId is the same id used byappendBotPending(String, String). -
appendThinking
public ai.mindconnect.ui.model.UiPatch.Operation appendThinking(String thinkingId, String agentName) APPEND an "AI is thinking …" placeholder shown between the user message and the first incoming token. Removed viaremoveThinking(String)when the stream begins. -
removeThinking
REMOVE the thinking indicator together with its wrapping<li>. Targets the wrapper id (thinking-wrapper-{thinkingId}) so the renderer's REMOVE path drops the surrounding list item. -
appendTaskCard
APPEND a task card to the list (running / done / failed variants). -
appendTaskCardInto
public ai.mindconnect.ui.model.UiPatch.Operation appendTaskCardInto(String childListId, TaskCardComponent card) APPEND a task card into a nested sub-agent child list rather than the top-level message list.childListIdis the id of the sub-agent card's nested<ul>-bearing list (TaskCardComponent.childListId(String)); the renderer's append-into-list path drops the card's<li>straight into that list's<ul>, so the card nests under its sub-agent. -
replaceTaskCard
REPLACE a task card in place. Targets the card's own id (the<li>'s id), not the wrapper — that's the shape REPLACE needs to morph an existing list item. -
allHistoricTaskCards
Builds every tool / sub-agent card across this component's full history, in order. Used to render a sub-session's activity as the nested body of its parent's sub-agent card — there's no user-turn interleaving to respect inside a sub-session, so the whole range is taken at once. Sub-agent calls recurse through this component'sMessageListComponent.SubAgentTreeProvider. -
lastAssistantText
The final assistant CHAT text in this component's history, ornull.
-