Add Share Thread feature + Charts export fixes#409
Open
ankit-thesys wants to merge 4 commits intothesysdev:mainfrom
Open
Add Share Thread feature + Charts export fixes#409ankit-thesys wants to merge 4 commits intothesysdev:mainfrom
ankit-thesys wants to merge 4 commits intothesysdev:mainfrom
Conversation
This commit prepares the OpenUI react-ui package for c1's migration from @crayonai/react-ui. It adds the Share Thread feature natively to OpenUI and fixes chart export naming. Share Thread (new feature): - Add ShareThread component, ShareThreadModal (Radix Dialog), and supporting hooks (useShareThread, useShareMessages) - Add generateShareLink prop to SharedChatUIProps — when provided, a share button appears in the chat header for all three variants - Wire into FullScreen (MobileHeader + ThreadHeader), Copilot (Header), and BottomTray (Header) - Add @radix-ui/react-dialog dependency - Add storybook stories for all three variants with share link Charts exports fix: - Remove Scrollable* aliases from Charts/index.ts — export AreaChart, BarChart, LineChart under their original names (matching subpath exports and consumer expectations) - Fix genui-lib chart condensed imports to use correct paths Shell Thread fixes: - Export AssistantMessageComponent type from _shared/types - Minor fixes to Shell, CopilotShell, BottomTray Thread components Checkpoint: openui-comp side of c1 migration is complete. The c1 repo (composition) has separate commits for Phases 1-6 covering the full migration from @crayonai to @openuidev. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace generateShareLink((messages) => url) with generateShareLink((threadId) => url). The consumer's backend looks up messages by threadId — no need to pass the full message array client-side. Changes: - Delete useShareMessages.ts (message selection no longer needed) - Rewrite useShareThread.ts to get selectedThreadId from store - Update ShareThread props and types to (threadId: string) - Remove Message type import from SharedChatUIProps This is a cleaner API that avoids message format conversion concerns and simplifies the hook from ~130 lines to ~28 lines. Checkpoint: Share Thread feature complete with threadId-based API. Builds on 8552f33 which added the initial messages-based version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
generateShareLinkprop toFullScreen,Copilot, andBottomTraycomposed chat variants. When provided, a share button appears in the header that opens a modal for generating and copying a shareable link.Scrollable*aliases fromCharts/index.ts— exportsAreaChart,BarChart,LineChartunder their original names, matching subpath exports and consumer expectations.AssistantMessageComponenttype, minor fixes to Shell/CopilotShell/BottomTray Thread components.New files
ShareThread.tsx— Share button component (adapts mobile/desktop)ShareThreadModal.tsx— Radix Dialog modal with generate → copy flowuseShareThread.ts/useShareMessages.ts— Supporting hooksshareThread.scss— StylesNew dependency
@radix-ui/react-dialogTest plan
pnpm --filter @openuidev/react-ui buildpassesStandaloneWithShareLink,CopilotWithShareLink,BottomTrayWithShareLinkstories render correctlyAreaChart,BarChart,LineChartimportable from both barrel and subpath🤖 Generated with Claude Code