@@ -140,6 +140,8 @@ function AskAiExchangeCard({
140140 isLastExchange &&
141141 ! displayParts . some ( ( part ) => part . type !== 'step-start' ) ;
142142
143+ const messageId = agentStudio ? assistantMessage ?. id || exchange . id : userMessage ?. id || exchange . id ;
144+
143145 return (
144146 < div className = "DocSearch-AskAiScreen-Response-Container" >
145147 < div className = "DocSearch-AskAiScreen-Response" >
@@ -236,12 +238,11 @@ function AskAiExchangeCard({
236238 </ div >
237239 < div className = "DocSearch-AskAiScreen-Answer-Footer" >
238240 < AskAiScreenFooterActions
239- id = { userMessage ?. id || exchange . id }
241+ id = { messageId }
240242 showActions = { showActions }
241243 latestAssistantMessageContent = { assistantContent ?. text || null }
242244 translations = { translations }
243245 conversations = { conversations }
244- agentStudio = { agentStudio }
245246 onFeedback = { onFeedback }
246247 />
247248 </ div >
@@ -262,7 +263,6 @@ interface AskAiScreenFooterActionsProps {
262263 translations : AskAiScreenTranslations ;
263264 conversations : StoredSearchPlugin < StoredAskAiState > ;
264265 onFeedback ?: ( messageId : string , thumbs : 0 | 1 ) => Promise < void > ;
265- agentStudio ?: boolean ;
266266}
267267
268268export function AskAiScreenFooterActions ( {
@@ -272,7 +272,6 @@ export function AskAiScreenFooterActions({
272272 translations,
273273 conversations,
274274 onFeedback,
275- agentStudio,
276275} : AskAiScreenFooterActionsProps ) : JSX . Element | null {
277276 // local state for feedback, initialised from stored conversations
278277 const initialFeedback = React . useMemo ( ( ) => {
@@ -310,26 +309,25 @@ export function AskAiScreenFooterActions({
310309
311310 return (
312311 < div className = "DocSearch-AskAiScreen-Actions" >
313- { ! agentStudio &&
314- ( feedback === null ? (
315- < >
316- { saving ? (
317- < LoadingIcon className = "DocSearch-AskAiScreen-SmallerLoadingIcon" />
318- ) : (
319- < >
320- < LikeButton title = { likeButtonTitle } onClick = { ( ) => handleFeedback ( 'like' ) } />
321- < DislikeButton title = { dislikeButtonTitle } onClick = { ( ) => handleFeedback ( 'dislike' ) } />
322- </ >
323- ) }
324- { savingError && (
325- < p className = "DocSearch-AskAiScreen-FeedbackText" > { savingError . message || 'An error occured' } </ p >
326- ) }
327- </ >
328- ) : (
329- < p className = "DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible" >
330- { thanksForFeedbackText }
331- </ p >
332- ) ) }
312+ { feedback === null ? (
313+ < >
314+ { saving ? (
315+ < LoadingIcon className = "DocSearch-AskAiScreen-SmallerLoadingIcon" />
316+ ) : (
317+ < >
318+ < LikeButton title = { likeButtonTitle } onClick = { ( ) => handleFeedback ( 'like' ) } />
319+ < DislikeButton title = { dislikeButtonTitle } onClick = { ( ) => handleFeedback ( 'dislike' ) } />
320+ </ >
321+ ) }
322+ { savingError && (
323+ < p className = "DocSearch-AskAiScreen-FeedbackText" > { savingError . message || 'An error occured' } </ p >
324+ ) }
325+ </ >
326+ ) : (
327+ < p className = "DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible" >
328+ { thanksForFeedbackText }
329+ </ p >
330+ ) }
333331 < CopyButton
334332 translations = { translations }
335333 onClick = { ( ) => navigator . clipboard . writeText ( latestAssistantMessageContent ) }
@@ -373,7 +371,7 @@ export function AskAiScreen({ translations = {}, ...props }: AskAiScreenProps):
373371 startNewConversationButtonText = 'Start a new conversation' ,
374372 } = translations ;
375373
376- const { messages, askAiError, status } = props ;
374+ const { messages, askAiError, status, agentStudio } = props ;
377375
378376 // Check if there's a thread depth error
379377 const hasThreadDepthError = useMemo ( ( ) => {
@@ -448,7 +446,7 @@ export function AskAiScreen({ translations = {}, ...props }: AskAiScreenProps):
448446 loadingStatus = { props . status }
449447 translations = { translations }
450448 conversations = { props . conversations }
451- agentStudio = { props . agentStudio }
449+ agentStudio = { agentStudio }
452450 onSearchQueryClick = { handleSearchQueryClick }
453451 onFeedback = { props . onFeedback }
454452 />
0 commit comments