Skip to content

[render preview] [Feature] Add Bubble component#445

Merged
cirdes merged 3 commits into
mainfrom
feat/bubble-component
Jun 30, 2026
Merged

[render preview] [Feature] Add Bubble component#445
cirdes merged 3 commits into
mainfrom
feat/bubble-component

Conversation

@djalmaaraujo

@djalmaaraujo djalmaaraujo commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Description

Ports the shadcn Bubble component to RubyUI — a chat bubble surface for conversational content.

Reference:

What's included

  • Bubble — root, variant: (default, secondary, muted, tinted, outline, ghost, destructive) and align: (start/end)
  • BubbleContent — content wrapper; polymorphic via as: (:div default, :a, :button) for link/button bubbles — the idiomatic Phlex equivalent of shadcn's asChild
  • BubbleReactions — edge-anchored reactions pill, side: (top/bottom) + align: (start/end)
  • BubbleGroup — stacks bubbles with tight spacing

Notes

  • shadcn ships these styles as a custom cn-bubble-* CSS layer. This port translates every rule to real Tailwind v4 utilities + RubyUI theme tokens, so no custom CSS is shipped.
  • No JS (no Stimulus controller).
  • Composes with the existing Tooltip and Popover components — examples included in the docs page.
  • No dependencies.yml entry (Bubble has no gem/JS/component deps, like Avatar/Card).

Testing

  • cd gem && bundle exec rake → tests + StandardRB green.
  • Docs page rendered locally at /docs/bubble: all 7 variants, alignment, reactions (top/bottom × start/end), group, link/button hover states, and Tooltip/Popover integration verified visually.

Screenshots

Add before/after screenshots of /docs/bubble.


Summary by cubic

Add a chat Bubble component to RubyUI for conversational UIs with 7 variants, alignment, grouping, reactions, docs, tests, and mcp registry entries. Built with Tailwind v4 utilities and RubyUI tokens—no custom CSS or JS.

  • New Features

    • RubyUI::Bubble with variants: default, secondary, muted, tinted, outline, ghost, destructive; align: :start|:end.
    • RubyUI::BubbleContent polymorphic via as: :div|:a|:button for link/button bubbles.
    • RubyUI::BubbleReactions pill anchored to the bubble edge; side: :top|:bottom, align: :start|:end.
    • RubyUI::BubbleGroup to stack bubbles with tight spacing.
    • Docs at /docs/bubble with examples and Tooltip/Popover integration; routes, menu, sitemap, and LLMs maps updated.
    • Rebuilt mcp registry to include Bubble metadata and examples.
  • Bug Fixes

    • Simplified BubbleContent interactive selectors to &:is(button,a) to match variant hover rules and reduce class noise without changing behavior.

Written for commit 1ae9145. Summary will update on new commits.

Review in cubic

Port the shadcn Bubble component: a chat bubble surface with 7 variants
(default, secondary, muted, tinted, outline, ghost, destructive),
start/end alignment, grouping, and edge-anchored reactions.

- Translates shadcn's cn-bubble-* CSS layer to real Tailwind v4 utilities
  and RubyUI theme tokens (no custom CSS shipped).
- BubbleContent is polymorphic via as: (:div/:a/:button) for link/button
  bubbles — the idiomatic Phlex equivalent of shadcn's asChild.
- No JS. Composes with Tooltip/Popover (docs examples included).

Docs page, route, controller, menu entry and site_files updated.
@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner June 30, 2026 15:16

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 14 files

Re-trigger cubic

djalmaaraujo added a commit that referenced this pull request Jun 30, 2026
Port the shadcn Message component: the higher-level chat layout that pairs
an avatar with bubbles, headers, and footers. Built on top of Bubble (#445).

- 6 parts: Message (align start/end), MessageGroup, MessageAvatar,
  MessageContent, MessageHeader, MessageFooter.
- Reuses the existing Avatar and the new Bubble components — no new
  primitives. Bubble alignment inside a message is driven by Message via
  group-data-[align=end]/message; Bubble itself is unchanged.
- Translates shadcn's cn-message-* CSS layer to Tailwind v4 utilities.
- dependencies.yml: message depends on Avatar + Bubble.

Closes #444.

Docs page, route, controller, menu entry and site_files updated.
Collapse the duplicated [&_button]/[&_a] pairs into [&:is(button,a)]
selectors targeting the content element itself (the polymorphic as:
:button/:a case), matching the variant hover selectors. Halves the
class string with identical behavior.
djalmaaraujo added a commit that referenced this pull request Jun 30, 2026
Port the shadcn Message component: the higher-level chat layout that pairs
an avatar with bubbles, headers, and footers. Built on top of Bubble (#445).

- 6 parts: Message (align start/end), MessageGroup, MessageAvatar,
  MessageContent, MessageHeader, MessageFooter.
- Reuses the existing Avatar and the new Bubble components — no new
  primitives. Bubble alignment inside a message is driven by Message via
  group-data-[align=end]/message; Bubble itself is unchanged.
- Translates shadcn's cn-message-* CSS layer to Tailwind v4 utilities.
- dependencies.yml: message depends on Avatar + Bubble.

Closes #444.

Docs page, route, controller, menu entry and site_files updated.
@djalmaaraujo djalmaaraujo changed the title [Feature] Add Bubble component [render preview] [Feature] Add Bubble component Jun 30, 2026
@djalmaaraujo djalmaaraujo temporarily deployed to feat/bubble-component - web-1 PR #445 June 30, 2026 15:45 — with Render Destroyed
djalmaaraujo added a commit that referenced this pull request Jun 30, 2026
Port the shadcn Message component: the higher-level chat layout that pairs
an avatar with bubbles, headers, and footers. Built on top of Bubble (#445).

- 6 parts: Message (align start/end), MessageGroup, MessageAvatar,
  MessageContent, MessageHeader, MessageFooter.
- Reuses the existing Avatar and the new Bubble components — no new
  primitives. Bubble alignment inside a message is driven by Message via
  group-data-[align=end]/message; Bubble itself is unchanged.
- Translates shadcn's cn-message-* CSS layer to Tailwind v4 utilities.
- dependencies.yml: message depends on Avatar + Bubble.

Closes #444.

Docs page, route, controller, menu entry and site_files updated.
@cirdes cirdes merged commit d95814f into main Jun 30, 2026
8 checks passed
@cirdes cirdes deleted the feat/bubble-component branch June 30, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants