Skip to content

Adopt shadcn chat primitives#678

Open
dennisonbertram wants to merge 1 commit into
developfrom
codex/shadcn-chat-components
Open

Adopt shadcn chat primitives#678
dennisonbertram wants to merge 1 commit into
developfrom
codex/shadcn-chat-components

Conversation

@dennisonbertram

Copy link
Copy Markdown
Owner

Fixes #677

Summary

  • Add local shadcn-style chat primitives for message scrolling, marker/status rows, attachments, messages, and bubbles.
  • Wire desktop and mobile chat transcripts to the shared anchored MessageScroller while keeping user-message bubbles conservative.
  • Move status rows and composer attachment previews onto the new primitives, with shimmer and scroll-fade utilities plus focused render tests.

Verification

  • bun test apps/web/components/ui/chat-primitives.test.tsx apps/web/components/tool-calls-summary-bar.test.tsx
  • git diff --check
  • bun --bun run ci
  • Agent Browser desktop smoke at /sessions/codex-shadcn-chat-smoke-session/chats/codex-shadcn-chat-smoke-chat: rendered seeded transcript, expanded tool marker, uploaded a text attachment, and opened the attachment preview.
  • Agent Browser mobile smoke at /m/chat/codex-shadcn-chat-smoke-chat: rendered shared scroller/marker/composer at 390x844 and verified DOM scroller slots with 4 items and 2 user anchors.

Notes

  • Used Context7 for shadcn/ui lookup, then checked official shadcn changelog/component docs directly because the Context7 docs output did not contain the new chat component snippets.
  • Agentation pending annotations check was unavailable (fetch failed), so browser QA continued with Agent Browser.

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
open-agents Ready Ready Preview, Comment Jun 28, 2026 2:39pm

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 492ec3d75e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +181 to +188
requestAnimationFrame(() => {
const lastItem = lastItemId ? itemMapRef.current.get(lastItemId) : null;
if (hasNewLastItem && lastItem?.scrollAnchor && lastItemId) {
scrollToMessage(lastItemId, "smooth");
return;
}
scrollToEnd("smooth");
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the requested initial anchor scroll

When a pre-existing transcript mounts with multiple MessageScrollerItems and the last item is an assistant response, the first ref registration sets hasMountedScrollRef and schedules applyDefaultScrollPosition(), but every later initial ref registration then enters this auto-scroll branch while isAtEndRef is still true. The final scheduled callback usually calls scrollToEnd("smooth"), so callers that pass defaultScrollPosition="last-anchor" on desktop/mobile land at the bottom instead of the last user anchor. Treat the initial batch as mounting until all refs have settled, or suppress these auto-scroll callbacks until after the default position has been applied.

Useful? React with 👍 / 👎.

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.

1 participant