components / chat-log

chat-log.

an append-only stream of messages that follows the newest one — unless the reader has scrolled up to read something, in which case it holds still and offers a jump back. track-list and article-list render a collection that happens to be ordered; this is a *stream*, and its whole contract is what happens when content arrives while you're looking at it, which is a behaviour neither of those has and neither should grow. groups consecutive messages from one sender, marks the viewer's own, and announces additions via role=log.

nobody has said anything yet.

installation
bunx @justin06lee/chrome@latest add chat-log
props
nametypedefaultdescription
messages *ChatMessage[]-id, name, body, createdAt (epoch ms), and an optional mine flag that emphasises the viewer's own messages.
emptyReactNode-shown in place of the list when there is nothing yet.
groupWithinMsnumber120000consecutive messages from one person inside this window share a single name line. 0 disables grouping.
ariaLabelstring'chat'
classNamestring-