[Feature] Add Message component
Merged
DJ
5mo ago+1231+1231+0123456789012345678901234567890123456789-0-0-0123456789
Description
Ports the shadcn Message component to RubyUI — the higher-level chat layout that pairs an avatar with bubbles, headers, and footers.
Stacked on #445 (Bubble). Base is feat/bubble-component; this PR shows only the Message diff. Retarget to main once #445 merges.
Reference:
- Docs: https://ui.shadcn.com/docs/components/radix/message
- Source:
apps/v4/registry/bases/radix/ui/message.tsx
Closes #444.
What's included
Message— row container,align:(start/end); flips avatar/content viaflex-row-reverseMessageGroup— stacks messagesMessageAvatar— wraps the existingAvatar; anchors to the row bottom and lifts when a footer is presentMessageContent— column holding bubbles; drives bubble alignment viagroup-data-[align=end]/messageMessageHeader/MessageFooter— muted meta lines (name, timestamp, "Delivered")
Reuse — no new primitives
- Avatar (existing) inside
MessageAvatar - Bubble / BubbleContent / BubbleGroup / BubbleReactions (#445) inside
MessageContent
Bubble alignment inside a message is handled entirely by Message — Bubble is unchanged. dependencies.yml: message depends on Avatar + Bubble.
Notes
- shadcn ships these styles as a custom
cn-message-*CSS layer; this port translates every rule to Tailwind v4 utilities. No custom CSS, no JS. Marker(the "is typing…" indicator) is a separate shadcn component, out of scope here; the demo uses plain footer text instead.
Testing
cd gem && bundle exec rake→ tests + StandardRB green.- Docs page rendered locally at
/docs/message: conversation, header/footer, alignment, and group all verified visually against the shadcn demo.
Screenshots
Add before/after screenshots of /docs/message.
Summary by cubic
Add a chat Message layout that pairs an avatar with bubbles, headers, and footers to build aligned, grouped conversations. Ships with Tailwind v4 utilities and a docs page; no custom CSS or JS.
-
New Features
Messagewithalign: :start|:end; controls bubble alignment and flips rows.- Subcomponents:
MessageGroup,MessageAvatar,MessageContent,MessageHeader,MessageFooter. - Docs at
/docs/messagewith examples; routes, controller, nav, sitemap, and LLM docs maps updated. - Tests for slots, alignment, and grouping.
- MCP registry updated with
Messagefiles, metadata, and examples.
-
Dependencies
- Updated
dependencies.yml:messagedepends onAvatarandBubble;Bubbleis unchanged.
- Updated