@@ -168,13 +168,13 @@ export class ChatQuestionCarouselPart extends Disposable implements IChatContent
168168
169169 const collapseToggleTitle = localize ( 'chat.questionCarousel.collapseTitle' , 'Collapse Questions' ) ;
170170 const collapseButton = interactiveStore . add ( new Button ( this . _headerActionsContainer , { ...defaultButtonStyles , secondary : true , supportIcons : true } ) ) ;
171- collapseButton . element . classList . add ( 'chat-question-collapse-toggle' ) ;
171+ collapseButton . element . classList . add ( 'chat-question-toggle' , 'chat-question- collapse-toggle') ;
172172 collapseButton . element . setAttribute ( 'aria-label' , collapseToggleTitle ) ;
173173 this . _collapseButton = collapseButton ;
174174
175175 // Expand button for showing/hiding full question text
176176 const expandButton = interactiveStore . add ( new Button ( this . _headerActionsContainer , { ...defaultButtonStyles , secondary : true , supportIcons : true } ) ) ;
177- expandButton . element . classList . add ( 'chat-question-collapse -toggle' ) ;
177+ expandButton . element . classList . add ( 'chat-question-toggle' , 'chat-question-expand -toggle') ;
178178 this . _expandButton = expandButton ;
179179 this . _isQuestionTextExpanded = false ;
180180 this . updateExpandButton ( ) ;
@@ -734,19 +734,18 @@ export class ChatQuestionCarouselPart extends Disposable implements IChatContent
734734 title . setAttribute ( 'aria-label' , messageContent ) ;
735735
736736 const isLong = messageContent . length > QUESTION_TITLE_TRUNCATION_THRESHOLD ;
737+ const titleRenderDisposable = questionRenderStore . add ( new MutableDisposable ( ) ) ;
737738 const renderTitle = ( expanded : boolean ) => {
738739 dom . clearNode ( title ) ;
739740 const plainTextValue = isMarkdownString ( questionText ) ? renderAsPlaintext ( questionText ) : questionText ;
740741 const collapsedValue = isLong
741742 ? plainTextValue . slice ( 0 , QUESTION_TITLE_TRUNCATION_THRESHOLD ) . replace ( / \s + \S * $ / , '' ) + '…'
742743 : plainTextValue ;
743744 const md = expanded && isMarkdownString ( questionText )
744- ? new MarkdownString (
745- question . required ? `${ questionText . value } *` : questionText . value ,
746- { isTrusted : questionText . isTrusted , supportThemeIcons : questionText . supportThemeIcons }
747- )
745+ ? MarkdownString . lift ( { ...questionText , value : question . required ? `${ questionText . value } *` : questionText . value } )
748746 : new MarkdownString ( question . required ? `${ collapsedValue } *` : collapsedValue ) ;
749- const rendered = questionRenderStore . add ( this . _markdownRendererService . render ( md ) ) ;
747+ const rendered = this . _markdownRendererService . render ( md ) ;
748+ titleRenderDisposable . value = rendered ;
750749 title . appendChild ( rendered . element ) ;
751750 } ;
752751
0 commit comments