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-logprops
| name | type | default | description |
|---|---|---|---|
| messages * | ChatMessage[] | - | id, name, body, createdAt (epoch ms), and an optional mine flag that emphasises the viewer's own messages. |
| empty | ReactNode | - | shown in place of the list when there is nothing yet. |
| groupWithinMs | number | 120000 | consecutive messages from one person inside this window share a single name line. 0 disables grouping. |
| ariaLabel | string | 'chat' | |
| className | string | - |