Repository navigation
feat(example): add an assistant-ui chat interface - #407
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Change: Feature Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
e1fa510 to
e4266e7
Compare
commit: |
|
@cubic-dev-ai review |
@robelest I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
Re-trigger cubic
…ons while a decision saves
Problem
Developers using assistant-ui with Convex Agent need a working example that connects Convex's reactive message history and streaming to a composable chat interface.
Closes #406.
Change
Add assistant-ui Chat at
/chat-assistant-uialongside the existing examples. The page includes a text composer, streamed Markdown, expandable reasoning and tool results, copy and scroll controls, paginated history, cancellation, and new conversations.useConvexRuntimefeedsuseUIMessagesintouseExternalStoreRuntime; a small converter uses Convex's stable message key across streaming and persistence. The existingstreamOneShotaction supplies the send lifecycle, including the interval before the first stream delta. Stop uses the existingabortStreamByOrdermutation once a stream is available. Failed sends retain the prompt for recovery. New-conversation failures show an alert while preserving the current conversation, and pending creation disables repeat requests.The route loads lazily. The messages and streaming docs list it alongside the existing React examples and link to its runtime hook and setup guide. The README explains the mapping, server-side credential setup, and scope: text input with the story agent, with uploads and tool approval covered by the existing examples. User messages appear when saved; the existing Streaming Chat example remains the reference for optimistic sending.
Verification
npm run buildnpm test— 42 files, 473 tests passed, including 15 new converter/runtime/page testsnpm run typechecknpm run lintnpx prettier --check example/ui/chat/ChatAssistantUI.tsx example/ui/chat/ChatAssistantUI.test.tsx example/ui/chat/assistant-ui/useConvexRuntime.test.tsx docs/streaming.mdx package.json package-lock.jsoncd example && npx vite buildjsdom@26.1.0declares Node>=18, preserving the package's Node>=22range; its DOM smoke test also passes on local Node 18.18.2.gpt-4o-mini: initial story and tool call, keyboard submission, follow-up context and Markdown, reload persistence, and stopping a response while retaining partial text.The production build reports its large-chunk and shared dynamic-import warnings. Provider credentials were configured only on the local backend and are absent from the change.
Public surface
Example frontend, messages/streaming docs, setup documentation, development dependencies, and lockfile only. No published package API or backend protocol changes.