DevactionUI.ChatBubble (devaction_ui v0.2.3)

Copy Markdown View Source

One message of the conversation with the AI. The AI speaks on the left, with its mark beside the bubble and the corner nearest the mark squared; the person speaks on the right in ink. A message that did something (a lesson sent, a task made) is drawn :highlight, in the amber of "the AI did this" with the strong text of that tone; a message from :me ignores highlight. The mark of the AI (the avatar slot) sits in a 28px rounded box of the dark --bubble-mark colour.

The bubble is a <div>, so the message can hold paragraphs, lists or code. Give it a speaker to have assistive technology read who is talking before the text.

Summary

Functions

A message of the conversation, from the AI or from the person.

Functions

chat_bubble(assigns)

@spec chat_bubble(map()) :: Phoenix.LiveView.Rendered.t()

A message of the conversation, from the AI or from the person.

Attributes

  • from (:atom) (required) - Must be one of :ai, or :me.
  • highlight (:boolean) - an AI message that did something; ignored for :me. Defaults to false.
  • speaker (:string) - who is talking, read out before the message and not drawn. Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • avatar - the AI's mark, an icon, set in a 28px box; only used for :ai.
  • inner_block (required) - the message.