File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ interface Signature {
75
75
errors: { id: string ; error: Error }[] | undefined ;
76
76
};
77
77
index: number ;
78
+ eventId: string ;
78
79
monacoSDK: MonacoSDK ;
79
80
registerScroller: (args : {
80
81
index: number ;
@@ -200,6 +201,7 @@ function isPresent(val: SafeString | string | null | undefined) {
200
201
201
202
export default class AiAssistantMessage extends Component <Signature > {
202
203
@service private declare cardService: CardService ;
204
+ @service private declare matrixService: MatrixService ;
203
205
get isReasoningExpandedByDefault() {
204
206
let result =
205
207
this .args .isStreaming &&
@@ -208,15 +210,18 @@ export default class AiAssistantMessage extends Component<Signature> {
208
210
! isThinkingMessage (this .args .reasoningContent );
209
211
return result ;
210
212
}
211
- @tracked _explicitlySetReasoningExpanded: boolean | undefined ;
212
213
get isReasoningExpanded() {
213
214
return (
214
- this ._explicitlySetReasoningExpanded ?? this .isReasoningExpandedByDefault
215
+ this .matrixService .reasoningExpandedState .get (this .args .eventId ) ??
216
+ this .isReasoningExpandedByDefault
215
217
);
216
218
}
217
219
updateReasoningExpanded = (ev : MouseEvent ) => {
218
220
ev .preventDefault ();
219
- this ._explicitlySetReasoningExpanded = ! this .isReasoningExpanded ;
221
+ this .matrixService .reasoningExpandedState .set (
222
+ this .args .eventId ,
223
+ ! this .isReasoningExpanded ,
224
+ );
220
225
};
221
226
222
227
<template >
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ export default class RoomMessage extends Component<Signature> {
108
108
@ reasoningContent ={{this .message.reasoningContent }}
109
109
@ monacoSDK ={{@ monacoSDK }}
110
110
@ datetime ={{this .message.created }}
111
+ @ eventId ={{this .message.eventId }}
111
112
@ index ={{@ index }}
112
113
@ registerScroller ={{@ registerScroller }}
113
114
@ isFromAssistant ={{this .isFromAssistant }}
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ export default class MatrixService extends Service {
142
142
cardsToSend : TrackedMap < string , CardDef [ ] | undefined > = new TrackedMap ( ) ;
143
143
filesToSend : TrackedMap < string , FileDef [ ] | undefined > = new TrackedMap ( ) ;
144
144
failedCommandState : TrackedMap < string , Error > = new TrackedMap ( ) ;
145
+ reasoningExpandedState : TrackedMap < string , boolean > = new TrackedMap ( ) ;
145
146
flushTimeline : Promise < void > | undefined ;
146
147
flushMembership : Promise < void > | undefined ;
147
148
flushRoomState : Promise < void > | undefined ;
You can’t perform that action at this time.
0 commit comments