Chat - Grouped message timeline
Group consecutive messages from the same author into a compact timeline with custom row presentation.
Use this pattern to render a thread that visually groups messages by author and time window without manual grouping logic in the page layer.
This pattern fits support timelines, collaboration surfaces, and assistant threads where readability and density outweigh per-message isolation.
This example exercises MessageGroup, groupingWindowMs, the Message.Avatar/Message.Content/Message.Meta primitives, and grouped-versus-ungrouped owner state.
The demo below shows an author-grouped timeline that collapses repeated avatars and metadata within a short time window:
Key primitives
MessageGroupfor first/last grouping decisions.Message.Rootfor message-level owner state.Message.Avatar,Message.Content, andMessage.Metafor the default row stack.Message.Actions(optional) when a timeline needs inline actions.
Implementation notes
- Vary timestamps so the grouping window is observable, not just theoretical.
- Include at least one break in author identity and one in time-window grouping.
- Keep the composition focused on message rows, not conversation selection or thread layout.
When to use this pattern
Use this pattern when:
- A chat surface needs compact message grouping.
- Avatar repetition should be reduced.
- Grouped and ungrouped rows need different styling or spacing.
This is especially useful in support timelines, collaboration surfaces, and assistant threads where one participant often sends several messages in a row.
Design notes
MessageGroupkeeps neighbor comparison logic out of the page layer.groupingWindowMsis a presentation decision, so it belongs near the message row composition rather than in the data model.
See also
- See Messages for details.
- See Custom message part rendering for details.