File tree Expand file tree Collapse file tree 3 files changed +12
-25
lines changed
Expand file tree Collapse file tree 3 files changed +12
-25
lines changed Original file line number Diff line number Diff line change @@ -142,10 +142,7 @@ export async function routeUserPrompt(
142142 filename,
143143 } )
144144
145- setMessages ( ( prev ) => [
146- ...prev ,
147- getSystemMessage ( `📎 Image attached: ${ filename } ` ) ,
148- ] )
145+ // Note: No system message added here - the PendingImagesBanner shows attached images
149146 saveToHistory ( trimmed )
150147 setInputValue ( { text : '' , cursorPosition : 0 , lastEditDueToNav : false } )
151148 setInputMode ( 'default' )
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import type { ContentBlock } from '../types/chat'
1111interface CopyIconButtonProps {
1212 blocks ?: ContentBlock [ ]
1313 content ?: string
14+ textToCopy ?: string
1415}
1516
1617const BULLET_CHAR = '•'
@@ -63,18 +64,20 @@ const extractTextFromBlocks = (blocks?: ContentBlock[]): string => {
6364export const CopyIconButton : React . FC < CopyIconButtonProps > = ( {
6465 blocks,
6566 content,
67+ textToCopy : textToCopyProp ,
6668} ) => {
6769 const theme = useTheme ( )
6870 const hover = useHoverToggle ( )
6971 const { setTimeout } = useTimeout ( )
7072 const [ isCopied , setIsCopied ] = useState ( false )
7173
72- // Compute text to copy from blocks or content
74+ // Compute text to copy from blocks or content (or use provided textToCopy)
7375 const textToCopy = useMemo ( ( ) => {
76+ if ( textToCopyProp ) return textToCopyProp
7477 return blocks && blocks . length > 0
7578 ? extractTextFromBlocks ( blocks ) || content || ''
7679 : content || ''
77- } , [ blocks , content ] )
80+ } , [ blocks , content , textToCopyProp ] )
7881
7982 const handleClick = async ( ) => {
8083 try {
Original file line number Diff line number Diff line change @@ -65,18 +65,6 @@ export type PlanContentBlock = {
6565 content : string
6666}
6767
68- export type ImageContentBlock = {
69- type : 'image'
70- image : string // base64 encoded image data
71- mediaType : string
72- filename ?: string
73- size ?: number
74- width ?: number
75- height ?: number
76- isCollapsed ?: boolean
77- userOpened ?: boolean
78- }
79-
8068export type AskUserContentBlock = {
8169 type : 'ask-user'
8270 toolCallId : string
@@ -110,11 +98,16 @@ export type ImageContentBlock = {
11098 mediaType : string
11199 filename ?: string
112100 size ?: number
101+ width ?: number
102+ height ?: number
103+ isCollapsed ?: boolean
104+ userOpened ?: boolean
113105}
114106
115107export type ImageAttachment = {
116- path : string
117108 filename : string
109+ path : string
110+ size ?: number
118111}
119112
120113export type ContentBlock =
@@ -136,12 +129,6 @@ export type AgentMessage = {
136129 subAgentCount ?: number
137130}
138131
139- export type ImageAttachment = {
140- filename : string
141- path : string // Full path for opening the file
142- size ?: number
143- }
144-
145132export type ChatMessage = {
146133 id : string
147134 variant : ChatVariant
You can’t perform that action at this time.
0 commit comments