Class TimelineUserMessageItem

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.TimelineUserMessageItem
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable

public class TimelineUserMessageItem extends AbstractTimelineItem
Timeline row for a persisted user AiChatMessage, rendering its content as plain text.
See Also:
  • Field Details

  • Constructor Details

    • TimelineUserMessageItem

      public TimelineUserMessageItem()
  • Method Details

    • setMessage

      public void setMessage(AiChatMessage message, String actorName)
      Renders the row for the given message.
      Parameters:
      message - message to display
      actorName - actor display name shown in the header
    • createAvatar

      protected com.vaadin.flow.component.Component createAvatar(String actorName)
      Specified by:
      createAvatar in class AbstractTimelineItem
    • avatarAbbreviation

      protected static String avatarAbbreviation(String actorName)
      Builds the avatar initials from the actor name. The Jmix user instance name embeds the login as "First Last [username]"; the bracketed login is dropped so the circle shows clean initials (e.g. "JS"), falling back to the login's first letter when no name is present. Set explicitly so the Avatar does not derive noisy initials from the whole string.
      Parameters:
      actorName - actor display name to derive initials from
      Returns:
      the avatar initials (empty string if none can be derived)
    • createMessageContent

      protected com.vaadin.flow.component.Component createMessageContent(AiChatMessage message)