@@ -39,7 +39,7 @@ import UpdateSkillActivationCommand from '@cardstack/host/commands/update-skill-
39
39
import { Message } from ' @cardstack/host/lib/matrix-classes/message' ;
40
40
import type { StackItem } from ' @cardstack/host/lib/stack-item' ;
41
41
import { getAutoAttachment } from ' @cardstack/host/resources/auto-attached-card' ;
42
- import { getRoom } from ' @cardstack/host/resources/room' ;
42
+ import { RoomResource } from ' @cardstack/host/resources/room' ;
43
43
44
44
import type CardService from ' @cardstack/host/services/card-service' ;
45
45
import type CommandService from ' @cardstack/host/services/command-service' ;
@@ -67,6 +67,7 @@ import type { Skill } from '../ai-assistant/skill-menu';
67
67
interface Signature {
68
68
Args: {
69
69
roomId: string ;
70
+ roomResource: RoomResource ;
70
71
monacoSDK: MonacoSDK ;
71
72
};
72
73
}
@@ -78,7 +79,7 @@ export default class Room extends Component<Signature> {
78
79
class =' room'
79
80
data-room-settled ={{this .doWhenRoomChanges.isIdle }}
80
81
data-test-room-settled ={{this .doWhenRoomChanges.isIdle }}
81
- data-test-room-name ={{this . roomResource.name }}
82
+ data-test-room-name ={{@ roomResource.name }}
82
83
data-test-room ={{@ roomId }}
83
84
>
84
85
<AiAssistantConversation
@@ -149,10 +150,10 @@ export default class Room extends Component<Signature> {
149
150
@ filesToAttach ={{this .filesToAttach }}
150
151
/>
151
152
<LLMSelect
152
- @ selected ={{this . roomResource.activeLLM }}
153
- @ onChange ={{this . roomResource.activateLLM }}
153
+ @ selected ={{@ roomResource.activeLLM }}
154
+ @ onChange ={{@ roomResource.activateLLM }}
154
155
@ options ={{this .supportedLLMs }}
155
- @ disabled ={{this . roomResource.isActivatingLLM }}
156
+ @ disabled ={{@ roomResource.isActivatingLLM }}
156
157
/>
157
158
</div >
158
159
</div >
@@ -215,11 +216,6 @@ export default class Room extends Component<Signature> {
215
216
@service private declare operatorModeStateService: OperatorModeStateService ;
216
217
@service private declare loaderService: LoaderService ;
217
218
218
- private roomResource = getRoom (
219
- this ,
220
- () => this .args .roomId ,
221
- () => this .matrixService .getRoomData (this .args .roomId )?.events ,
222
- );
223
219
private autoAttachmentResource = getAutoAttachment (
224
220
this ,
225
221
() => this .topMostStackItems ,
@@ -515,25 +511,25 @@ export default class Room extends Component<Signature> {
515
511
};
516
512
517
513
private isDisplayingCode = (message : Message ) => {
518
- return this .roomResource ? .isDisplayingCode (message );
514
+ return this .args . roomResource .isDisplayingCode (message );
519
515
};
520
516
521
517
private toggleViewCode = (message : Message ) => {
522
- this .roomResource .toggleViewCode (message );
518
+ this .args . roomResource .toggleViewCode (message );
523
519
};
524
520
525
521
private doMatrixEventFlush = restartableTask (async () => {
526
522
await this .matrixService .flushMembership ;
527
523
await this .matrixService .flushTimeline ;
528
- await this .roomResource .loading ;
524
+ await this .args . roomResource .loading ;
529
525
});
530
526
531
527
private get messages() {
532
- return this .roomResource .messages ;
528
+ return this .args . roomResource .messages ;
533
529
}
534
530
535
531
private get skills(): Skill [] {
536
- return this .roomResource .skills ;
532
+ return this .args . roomResource .skills ;
537
533
}
538
534
539
535
private get supportedLLMs(): string [] {
@@ -551,7 +547,7 @@ export default class Room extends Component<Signature> {
551
547
}
552
548
553
549
private get room() {
554
- let room = this .roomResource .matrixRoom ;
550
+ let room = this .args . roomResource .matrixRoom ;
555
551
return room ;
556
552
}
557
553
0 commit comments