Skip to content

refactor(shadcn): replace ai-elements chat components with shadcn base#1365

Open
thomasyuill-livekit wants to merge 3 commits into
mainfrom
ty/replace-ai-elements-shadcn
Open

refactor(shadcn): replace ai-elements chat components with shadcn base#1365
thomasyuill-livekit wants to merge 3 commits into
mainfrom
ty/replace-ai-elements-shadcn

Conversation

@thomasyuill-livekit

Copy link
Copy Markdown
Contributor

Issue

No linked Linear ticket — please add one if this tracks a specific issue.

Overview

agents-ui (packages/shadcn) vendored its chat UI (Conversation, Message, Shimmer) from the external ai-elements registry (registry.ai-sdk.dev). This PR drops that dependency and rebuilds the same UI on shadcn's own native chat primitives (MessageScroller, Message, Bubble, and the shimmer CSS utility), released by shadcn in June 2026.

Summary of changes

Area Change
components/ai-elements/* Deleted (conversation.tsx, message.tsx, shimmer.tsx)
components/ui/{message-scroller,message,bubble}.tsx Added — vendored via shadcn add
agent-chat-transcript.tsx Rebuilt on MessageScroller/Message/Bubble + direct Streamdown
agent-session-block.tsx Pre-connect text now uses the shimmer CSS utility instead of a Shimmer component wrapped in motion.create
agent-chat-indicator.tsx Minor dot-size/animation tweak
components.json, registry.json, package.json Dropped @ai-elements registry alias, use-stick-to-bottom dep; registry deps repointed to message-scroller/message/bubble
tailwindcss (docs/storybook) Bumped 4.1.174.3.2 — the scroll button's centering utility (inset-s-*) only exists from Tailwind 4.2.0 onward
Tests Repointed mocks from @/components/ai-elements/* to @/components/ui/*

Testing

No Vercel preview is configured for this repo. Verified locally:

  • pnpm --filter @agents-ui test — 277 tests pass
  • pnpm --filter @agents-ui run registry:build — registry builds cleanly
  • Storybook (pnpm dev:storybook) — visually confirmed AgentChatTranscript and AgentSessionView-01 stories, including the scroll-to-bottom button centering fix

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 633ee88

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
components-js-storybook-5kld Ready Ready Preview, Comment Jul 10, 2026 6:39pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
LiveKitRoom only 6.01 KB (0%)
LiveKitRoom with VideoConference 32.25 KB (0%)
All exports 43.69 KB (0%)

…e primitives

Drops the external @ai-elements registry dependency in agents-ui, rebuilding
the chat transcript and pre-connect shimmer on shadcn's native MessageScroller,
Message, and Bubble components plus the shimmer CSS utility. Also bumps
Tailwind to 4.3.2 so the scroll button's logical-inset centering utility
(inset-s-*, added in 4.2.0) actually resolves.
…cript hit-testing

Adds a WithConversation story that populates the transcript with a scripted
conversation by emitting fake chat events onto the session's Room, plus a
play function to open the panel. Extends the sample conversation to 20
messages so the transcript overflows and scrolls.

While verifying it, found that TileLayout's absolutely positioned wrapper
(z-50, rendered after the transcript in DOM order) intercepts all
pointer/wheel events over the transcript whenever the chat panel is open,
even with no messages -- confirmed via AgentSessionView_01's Default story.
Fixes it with pointer-events-none, since nothing in that layer is
interactive today.
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