Expand description
Ported from Arc (MIT) © 2026 Elia Kuratli
Reference: Arc源码/arc-library/registry/components/chat-thread/chat-thread.tsx & .module.css
P6 Component #15: chat-thread
- Full chat & support conversation thread:
- Automatic day separators (
Today,Yesterday, or UTC date) via zero-dependency civil calendar; - Consecutive messages by the same author within
group_window_ms(default 5 min) share a group with softened inner corner radii (6pxvs18px), single header, and bottom-aligned author avatar; - Image & file attachment chips (
format_chat_bytes); - Hoverable reaction trigger with inline emoji picker (
👍 ❤️ 😂 🎉 👀 🙏), active pill state, and count toggling; - Delivery status (
Sending/Sent/Delivered/Read/Not delivered+Retrybutton) and stacked reader avatars under the latest read message; - Animated 3-dot breathing typing indicator;
- Built-in rounded composer powered by
gpui_kit::component::input::{Input, InputState}with Enter-to-send and active send button morph.
- Automatic day separators (
Structs§
- Chat
Attachment - File or image attachment displayed inside a message bubble stack.
- Chat
Message - One message in a
ChatThread. - Chat
Participant - Participant in a
ChatThread. - Chat
Reaction - Emoji reaction count under a
ChatMessage. - Chat
Thread - Arc
ChatThread— grouped chat messages, reactions, read receipts, typing dots, and composer.
Enums§
- Chat
Attachment Kind - Kind of attachment on a
ChatMessage. - Chat
Message Status - Delivery state of the current user’s own message.
- ChatRow
- Flattened render row produced by
build_chat_rows.
Constants§
- CHAT_
DEFAULT_ GROUP_ WINDOW_ MS - Default grouping window: 5 minutes in milliseconds.
- CHAT_
DEFAULT_ REACTIONS - Default quick reaction set matching
chat-thread.tsx.
Functions§
- build_
chat_ rows - Groups chronological messages into day separators and
first/lastauthor runs. - format_
chat_ bytes - Formats byte sizes matching
chat-thread.tsx(B/KB/MB). - format_
chat_ day - Formats a day separator label relative to
now_ms. - format_
chat_ time - Formats
HH:MMUTC clock time for a message timestamp. - toggle_
chat_ reaction - Toggles the current user’s reaction on a message’s reaction list.