Class TimelineAssistantThinkingMessageItem
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
io.jmix.aitoolsflowui.view.chat.renderer.component.TimelineAssistantThinkingMessageItem
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class TimelineAssistantThinkingMessageItem
extends AbstractTimelineItem
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
Row shown while the assistant is preparing a response. Displays a shimmer
indicator, the latest live status, and a history of prior steps delivered
by AI tools through
AiToolStatusPublisher.
Each AiToolStatusUpdate carries a message and an optional
resultSnippet; AiToolStatusUpdate.isCompleted() is true when
the snippet is non-blank. Completed past steps are prefixed with a
"✓ " check mark and their snippet is rendered next to the base
text; in-flight past steps render plain (no check, no snippet).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected @Nullable com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> protected static final Stringprotected Messagesprotected Metadataprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
actor, ACTOR_CN, AVATAR_CONTAINER_CN, avatarContainer, body, BODY_CN, header, HEADER_CN, time, TIME_CN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected com.vaadin.flow.component.html.SpanbuildStatusSpan(TimelineItemStatus update) protected com.vaadin.flow.component.html.SpanbuildStatusSpan(TimelineItemStatus update, String mainClass, boolean completedPrefix) protected com.vaadin.flow.component.ComponentcreateAvatar(String actorName) protected com.vaadin.flow.component.ComponentcreateThinkingStatusList(List<TimelineItemStatus> statusUpdates) protected voidprotected TimelineItemStatusresolveActiveStatus(List<TimelineItemStatus> statusUpdates, String defaultThinkingIndicatorText) voidsetAiAvatarIconSupplier(@Nullable com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> avatarIconSupplier) Sets the supplier of the avatar icon shown for this row.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetThinking(TimelineItem item, String assistantName, String defaultThinkingIndicatorText) Renders the "thinking" row: the latest live status, a shimmer indicator and the history of prior steps carried by the given item.Methods inherited from class io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
createActor, createAvatarContainer, createBody, createHeader, createRoot, createTime, initContent, initRow, setTimeMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
BASE_CN
- See Also:
-
THINKING_CN
- See Also:
-
THINKING_STATUS_CN
- See Also:
-
THINKING_STATUS_RESULT_CN
- See Also:
-
THINKING_TEXT_CN
- See Also:
-
THINKING_SHIMMER_CN
- See Also:
-
THINKING_STATUS_LIST_CN
- See Also:
-
THINKING_STATUS_LIST_ITEM_CN
- See Also:
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
metadata
-
messages
-
avatarIconSupplier
protected @Nullable com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> avatarIconSupplier
-
-
Constructor Details
-
TimelineAssistantThinkingMessageItem
public TimelineAssistantThinkingMessageItem()
-
-
Method Details
-
setApplicationContext
@NullMarked public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
initComponent
protected void initComponent() -
setThinking
public void setThinking(TimelineItem item, String assistantName, String defaultThinkingIndicatorText) Renders the "thinking" row: the latest live status, a shimmer indicator and the history of prior steps carried by the given item.- Parameters:
item- thinking timeline item carrying the status updatesassistantName- actor display name shown in the headerdefaultThinkingIndicatorText- text shown while no status update has arrived yet
-
createThinkingStatusList
protected com.vaadin.flow.component.Component createThinkingStatusList(List<TimelineItemStatus> statusUpdates) -
buildStatusSpan
-
buildStatusSpan
protected com.vaadin.flow.component.html.Span buildStatusSpan(TimelineItemStatus update, String mainClass, boolean completedPrefix) -
resolveActiveStatus
protected TimelineItemStatus resolveActiveStatus(List<TimelineItemStatus> statusUpdates, String defaultThinkingIndicatorText) -
setAiAvatarIconSupplier
@NullMarked public void setAiAvatarIconSupplier(@Nullable com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> avatarIconSupplier) Sets the supplier of the avatar icon shown for this row. The supplier must return a fresh component on every call.- Parameters:
avatarIconSupplier- supplier of the avatar icon, ornullto render no icon
-
createAvatar
- Specified by:
createAvatarin classAbstractTimelineItem
-