Repository navigation
feat(ai-components): message views, reply actions and icon overrides - #3928
Open
isekovanic wants to merge 1 commit into
Open
isekovanic wants to merge 1 commit into
isekovanic wants to merge 1 commit into
Conversation
Contributor
SDK Size
|
This branch has not been deployed
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.
Ticket: https://linear.app/stream/issue/RN-485
Stacked on #3926.
π― Goal
Show the person's messages and the agent's replies the way the native AI SDKs do, with the actions under a finished reply. The APIs come from React's AI components (#3376). The look follows StreamChatAI and the Android AI SDK.
π Implementation details
Views (props only, under
message/)AIUserMessage: the person's attachments, then their text in a bubble on the trailing side. WithonEditit shows an edit button.AIAssistantMessage: a reply's steps, then the answer (typed out while it streams), then what the agent attached.AIMessageAttachment:AIReplyActions: copy (shows a check for a moment), share through the system sheet, regenerate withonRegenerate, and a thumbs up/down rating withrating/onRate. Copy is hidden when the app has no clipboard module.Customising
messagesection: styles, and colours under StreamChatAI's names (userMessageBackground,attachmentIconBackground,messageAction, β¦). The defaults come from the design tokens.icons, which override any of the agent replies' 24 icons. This covers the step views from earlier PRs as well as the new ones.defaultAIIconsanduseAIIconsare exported.mergeThemescarries icons through as they are, since the JSON copy it makes would drop them.AIUserMessageandAIAssistantMessagetake anAttachmentcomponent, like the attachment view factories on Swift and Android.Also
expo-clipboard, which no longer hassetString. The AI clipboard service now usessetStringAsyncwhen it's there, as the core Expo package already does. This affected copying code blocks too.arandhecould use a native speaker's look.Left for later
onEditshows a button, as in React. If we want Swift's lifted preview, the menu needs a portal host of its own, whichAIConversationcan own in a later PR.ExpoChatGPTSample
AIUserMessage, and replies withAIAssistantMessageplusAIReplyActionsonce the router clearsgenerating.π¨ UI Changes
The person's bubble, replies with their steps and action row, and image and file attachments.
π§ͺ Testing
mergeThemes;Attachmentslot.yarn lint,yarn typecheck,yarn buildandyarn test:unitpass.βοΈ Checklist
developbranch (stacked on feat(ai-components): native AIAgent module for install id and tool-call sign-inΒ #3926)