Skip to content

feat(chat): add timestamp, markdown, and streaming parts for agent use - #899

Closed
pasqualevitiello wants to merge 7 commits into
feat/composer-busy-modefrom
claude/chat-extensions-9b3050
Closed

pasqualevitiello wants to merge 7 commits into
feat/composer-busy-modefrom
claude/chat-extensions-9b3050

Conversation

@pasqualevitiello

Copy link
Copy Markdown
Contributor

Stacks on #897. Ticket 04 of the Agent UI work: the parts agent conversations need, added to coss chat rather than forked into a new agent family.

Summary

 apps/ui/registry/default/chat/
+├── chat-message-timestamp.tsx   # <time> with machine dateTime, caller label
+├── chat-message-markdown.tsx    # prose styles for parser output, no parser dep
+├── chat-message-caret.tsx       # optional zero-width trailing caret
+├── lib/get-chat-date-time.ts    # Date | string → dateTime attribute
 ├── chat-message-layout.tsx      # ChatMessageContent: + streaming → data-streaming
 ├── chat-message.tsx             # + streaming, forwarded to content
 └── chat-message-text.tsx        # + children rendered after the text, + data-slot
<ChatMessage
  side="incoming"
  streaming={streaming}
  footer={<ChatMessageTimestamp dateTime={createdAt}>{label}</ChatMessageTimestamp>}
>
  <ChatMessageText text={text}>{streaming && <ChatMessageCaret />}</ChatMessageText>
</ChatMessage>

<ChatMessageMarkdown>
  <Markdown remarkPlugins={[remarkGfm]}>{text}</Markdown>  {/* host's parser */}
</ChatMessageMarkdown>
  • The timestamp doesn't format anything. The host formats the label.
  • The Markdown part only styles what it's given: headings, lists, links, inline and fenced code, tables, block quotes and rules. It uses chat's text-sm leading-[1.55]. Tables keep their table semantics, and a wrapper the parser adds around them scrolls.
  • The streaming parts announce nothing. The docs point to live="off" plus the agent announcer (ticket 05).
  • Three particles (p-chat-1 to p-chat-3) cover timestamp, Markdown and streaming. They're embedded in a new "Timestamps, Markdown, and streaming" section of chat.mdx.
  • A new chat particle category.
  • validate-registry-deps now maps @/registry/default/chat/* imports to @coss/chat, so particles can depend on the family.

Evidence

  • Before: chat had no timestamp, Markdown or streaming parts (Cal used its own AgentMessageTimestamp and AGENT_MESSAGE_PROSE_CLASS_NAME).
    After:
    • bun test: 58 pass. That includes the new get-chat-date-time.test.ts cases:
      • Date → "2026-10-17T08:42:00.000Z"
      • strings pass through unchanged
      • an invalid Date gives undefined instead of throwing a RangeError
    • bun run typecheck is clean. registry:validate-deps is clean.
  • Layout jump, measured in the docs preview while p-chat-3 streams: the caret's width is 0. Hiding the caret changes the text block's height by 0 and its width by 0. data-streaming="true" is set while streaming and removed afterwards.
  • Reduced motion: the caret's pulse rule only exists inside @media (prefers-reduced-motion: no-preference).
  • Tables: a <table> in p-chat-2 computes to display: table, and the overflow is on the container.

Merge Danger

Door: two-way

All changes are additive. The existing props on ChatMessage, ChatMessageContent and ChatMessageText are unchanged; the new ones are optional.

Blast Radius: small

  • ChatMessageText now has data-slot="chat-message-text" and renders children after the text, so consumer CSS that matches [data-slot] could now also match it.
  • The particles page gets a chat filter.

Not in this PR: the base branch has unrelated Biome drift (an unused ComposerQuery import in composer-editor.ts and class order in composer.tsx), and some public/r/p-*.json files are stale. I reverted both from this diff.

🤖 Generated with Claude Code

pasqualevitiello and others added 5 commits October 17, 2026 16:02
Anchor the combobox to the dialog it sits in so its popup stays inside
the focus trap and scroll lock. Forward caller refs on trigger and chips
so an anchor ref no longer overrides the internal one.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A resize can bring the bottom into view without a scroll event, so
re-check the position in the resize observer and clear the jump button.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
coss-com Ready Ready Preview Oct 17, 2026 3:22pm UTC
coss-com-ui Ready Ready Preview Oct 17, 2026 3:22pm UTC
coss-examples-calcom Ready Ready Preview Oct 17, 2026 3:22pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
coss-com-origin Skipped Skipped Oct 17, 2026 3:22pm UTC

Request Review

pasqualevitiello and others added 2 commits October 17, 2026 17:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pasqualevitiello

Copy link
Copy Markdown
Contributor Author

Closing: the Agent UI is a sibling family to Chat UI built on coss primitives, not on chat parts, so these chat additions aren't needed. The branch is kept.

This branch was successfully deployed

3 active and 1 inactive deployments
Preview – coss-com-ui — e22255a1 Deployed Oct 17, 2026 by vercel[bot]
Preview – coss-examples-calcom — e22255a1 Deployed Oct 17, 2026 by vercel[bot]
Preview – coss-com — e22255a1 Deployed Oct 17, 2026 by vercel[bot]
Preview – coss-com-origin — e22255a1 Deployed Oct 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant